Results 1 to 3 of 3

Thread: Wndproc

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2000
    Location
    Orlando, FL
    Posts
    253

    Wndproc

    Dows anyone know how to define the WNDPROC type?
    Always looking for a better and faster way!

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Oct 2000
    Location
    Orlando, FL
    Posts
    253
    I define an API function as so:

    Code:
    #define WINUSERAPI
    #define IN
    
    WINUSERAPI void * __stdcall LoadIcon(IN void  *hInstance, IN const unsigned short *lpIconName);
    I get this error:

    --------------------Configuration: Test - Win32 Debug--------------------
    Compiling...
    Test.cpp
    Linking...
    Test.obj : error LNK2001: unresolved external symbol "void * __stdcall LoadIcon(void *,unsigned short const *)" (?LoadIcon@@YGPAXPAXPBG@Z)
    Debug/Test.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.

    Test.exe - 2 error(s), 0 warning(s)

    Any Ideas?
    Always looking for a better and faster way!

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    This is because a C++ compiler gives the functions other internal names than a C compiler. Write
    extern "C" WINUSERAPI void * __stdcall LoadIcon(IN void *hInstance, IN const unsigned short *lpIconName);

    This will tell the compiler to use the C naming convention.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width