According to MSDN, GetDOSEnvironment is 16bit-windows API and does not exist on 32bit-windows. I tried GetEnvironmentVariable() in my DLL but it still does not work.
Jian 2013/2/19 Yasuhiro MATSUMOTO <[email protected]> > On Windows, vim uses C runtime library(probably msvcrt.dll). And it > store the environment varibles in memory of process. It is passed to > external processes at the time of starting it. So dll can't get them > via getenv. To solve this problem, one of way is add code calling > SetEnvironmentVariales/putenv both into vim. Another way is add code > calling GetDOSEnvironment instead of getenv into your dll. I'm not > sure the second way. > > On 2/19/13, Jian <[email protected]> wrote: > > Hi, > > > > I'm using gvim 7.3 on MS Windows 7. I set a envrionment variable in VIM > by > > command like: > > :let $PORT=19999 > > Then in my DLL, I read the variable via the standard C lib function: > > getenv("PORT"); > > When I call the DLL function via > > :echo libcall('mytest.dll', 'test','') > > > > but it fails to retrieve the variable. I tested it on Linux, it works as > > expected. > > > > BR, > > Jian > > > > -- > > -- > > You received this message from the "vim_dev" maillist. > > Do not top-post! Type your reply below the text you are replying to. > > For more information, visit http://www.vim.org/maillist.php > > > > --- > > You received this message because you are subscribed to the Google Groups > > "vim_dev" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to [email protected]. > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > > > > -- > - Yasuhiro Matsumoto > > -- > -- > You received this message from the "vim_dev" maillist. > Do not top-post! Type your reply below the text you are replying to. > For more information, visit http://www.vim.org/maillist.php > > --- > You received this message because you are subscribed to the Google Groups > "vim_dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
