News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

GetProcAddress

Started by Berion, October 15, 2006, 11:38:21 AM

Previous topic - Next topic

Berion

I made a simple test dll with on exported function.

LoadLibrary worked, but I couldn't load the function with GetProcAddress().

I searched in this forum and found that I should use the name of the function in the .def file.

Now it works, but the function is called something like _Z4Testv instead of Test.

Now I have some questions:

Is there a way to use the real name?
Will the name change?

thomas

Makes me wonder how that is related to Code::Blocks... this is actually a Win32 specific programming question.

Anyway, GetProcAddress() failing is most often due to name mangling, i.e. a forgotten extern "C" in your code.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Berion

thanks

I posted it here because the last time I worked with it was with vc++ and there it worked. Not the same code.