Loading ...
Sorry, an error occurred while loading the content.

68376Re: [bugreport] libcall() cannot access envrionment variable set by vim

Expand Messages
  • mattn
    Feb 20, 2013
    • 0 Attachment
      On Wednesday, February 20, 2013 12:06:05 AM UTC+9, Jian wrote:
      > 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.
      >

      I make sure this.

      created dll with:

      === foo.c
      --------------------------
      __declspec(dllexport)
      char* foo(const char* name) {
      return getenv(name);
      }
      --------------------------

      gcc -shared -o foo.dll foo.c

      === foo.vim
      --------------------------
      let s:libfile = substitute(expand('<sfile>'), '.vim$', (has('win32')||has('win64'))?'.dll':'.so', '')
      let $FOO=localtime()
      echo libcall(s:libfile, "foo", "FOO")
      --------------------------

      And :so % on foo.vim

      I get correct values. Probably, your dll is not depend on same msvcrt.dll which vim is used.

      --
      --
      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 vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Show all 5 messages in this topic