Thread: GetProcAddres fails

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    519
    Thank you matsp. The problem seems to be the extern "C" linkage. If I take that out, run time loading does also fail with mingw.

    So the correct question should probably be: How can I get MSVC to compile the DLL functions with extern "C" linkage, if that functions returns non-pod types/classes ?

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I'm not sure what the BEST way to do this is, one way would be to pass in a pointer/reference to be filled in, instead of returning the data as a return value - from a performance aspect, it makes little difference, as returning "large" values is done by the calling function passing the address where the return type is supposed to be stored anyways.

    The other solution is of course to use MingW instead of MSVC - but I suspect that this is not a solution you want to have, as I would guess that the reason you want MSVC may be that it's your corporate standard or some such.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 21
    Last Post: 06-24-2009, 09:49 AM
  2. Mac - File locking with fcntl() fails on shared volumes!?
    By idelovski in forum Linux Programming
    Replies: 3
    Last Post: 11-10-2008, 07:37 PM
  3. Why this fails - confusing
    By manav-II in forum C++ Programming
    Replies: 2
    Last Post: 07-21-2008, 01:01 AM
  4. Replies: 0
    Last Post: 05-23-2005, 11:39 AM
  5. ReadFile function fails.
    By dpkeller in forum C++ Programming
    Replies: 2
    Last Post: 12-03-2004, 10:20 PM