Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
V

vesf

@vesf
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • C vs. C++ (VS2010)
    V vesf

    Got it! 'extern "C"' needed. I missed that when tracking down the defines and typedefs in WinBase.h.

    C / C++ / MFC question c++ visual-studio help

  • C vs. C++ (VS2010)
    V vesf

    I hope I chose an appropriate forum. Why does the test code below build in VS2010 as C code but not as C++ code (linker errors further below). And what's needed to make it compile as C++ code. Thanks. - Vince

    #include

    __declspec(dllimport) int __stdcall SetEnvironmentVariableA(const char *pName, const char *pValue);
    __declspec(dllimport) unsigned long __stdcall GetEnvironmentVariableA(const char *pName, char *pValue, unsigned long nSize);

    int main ( int argc, char **argv )
    {
    char szValue[32768];
    SetEnvironmentVariableA(argv[1], argv[2]);
    GetEnvironmentVariableA(argv[1], szValue, 32768);
    return 0;
    }

    error LNK2001: unresolved external symbol "__declspec(dllimport) unsigned long __stdcall GetEnvironmentVariableA(char const *,char *,unsigned long)" (__imp_?GetEnvironmentVariableA@@YGKPBDPADK@Z)
    error LNK2001: unresolved external symbol "__declspec(dllimport) int __stdcall SetEnvironmentVariableA(char const *,char const *)" (__imp_?SetEnvironmentVariableA@@YGHPBD0@Z)

    C / C++ / MFC question c++ visual-studio help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups