Win32 API functions?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dragonslayer008@hotmail.com

    Win32 API functions?

    I moved some unmanaged C++ code into a C++/CLI project. The unmanaged
    code makes some Win32 API calls. I thought as long as I kept the API
    calls in a native class, it would integrate seamlessly. However, I am
    getting a whole bunch of linker errors with regards to the API calls:

    Example:

    error LNK2028: unresolved token (0A00001A) "extern "C" int __stdcall
    MessageBoxA(str uct HWND__ *,char const *,char const *,unsigned int)" (?
    MessageBoxA@@$$ J216YGHPAUHWND_ _@@PBD1I@Z) referenced in function
    "public: void __clrcall D3DException::s howMsg(void)" (?
    showMsg@D3DExce ption@@$$FQAMXX Z)

  • SvenC

    #2
    Re: Win32 API functions?

    Hi Dragonslayer (real names are welcome, btw),
    I moved some unmanaged C++ code into a C++/CLI project. The unmanaged
    code makes some Win32 API calls. I thought as long as I kept the API
    calls in a native class, it would integrate seamlessly. However, I am
    getting a whole bunch of linker errors with regards to the API calls:
    >
    Example:
    >
    error LNK2028: unresolved token (0A00001A) "extern "C" int __stdcall
    MessageBoxA(str uct HWND__ *,char const *,char const *,unsigned int)" (?
    MessageBoxA@@$$ J216YGHPAUHWND_ _@@PBD1I@Z) referenced in function
    "public: void __clrcall D3DException::s howMsg(void)" (?
    showMsg@D3DExce ption@@$$FQAMXX Z)
    You still need to tell the linker which libs to bind. MessageBox comes from
    user32.dll. So check your linker settings in your project properties. Don't
    forget to add the libs for debug and release (or all the configs you use).

    --
    SvenC

    Comment

    • dragonslayer008@hotmail.com

      #3
      Re: Win32 API functions?

      On Sep 17, 10:14 am, "SvenC" <sv...@communit y.nospamwrote:
      Hi Dragonslayer (real names are welcome, btw),
      >
      I moved some unmanaged C++ code into a C++/CLI project. The unmanaged
      code makes some Win32 API calls. I thought as long as I kept the API
      calls in a native class, it would integrate seamlessly. However, I am
      getting a whole bunch of linker errors with regards to the API calls:
      >
      Example:
      >
      error LNK2028: unresolved token (0A00001A) "extern "C" int __stdcall
      MessageBoxA(str uct HWND__ *,char const *,char const *,unsigned int)" (?
      MessageBoxA@@$$ J216YGHPAUHWND_ _@@PBD1I@Z) referenced in function
      "public: void __clrcall D3DException::s howMsg(void)" (?
      showMsg@D3DExce ption@@$$FQAMXX Z)
      >
      You still need to tell the linker which libs to bind. MessageBox comes from
      user32.dll. So check your linker settings in your project properties. Don't
      forget to add the libs for debug and release (or all the configs you use).
      Thanks. I forgot managed applications don't link that by default.

      Comment

      Working...