On 16/06/2009 21:19, Bulat Ziganshin wrote:
Hello Simon,

Tuesday, June 16, 2009, 5:02:43 PM, you wrote:

I don't know how getArgs fits in here - should we be decoding argv using
the ACP?

myGetArgs = do
    alloca $ \p_argc ->  do
    p_argv_w<- commandLineToArgvW getCommandLineW p_argc
    argc<- peek p_argc
    argv_w<- peekArray (i argc) p_argv_w
    mapM peekTString argv_w>>= return.tail

foreign import stdcall unsafe "windows.h GetCommandLineW"
   getCommandLineW :: LPTSTR

foreign import stdcall unsafe "windows.h CommandLineToArgvW"
   commandLineToArgvW :: LPCWSTR ->  Ptr CInt ->  IO (Ptr LPWSTR)

Right, so getArgs is already fine.

Cheers,
        Simon

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to