C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
2,749 questions
I have tried:
and in client app:
and pFactory1 is always NULL.
BTW, this code is working well without std::unique_ptr, it's just for testing purpose.
As it's a C++ method, its name won't be "SomeMethod", it'll be decorated.
Do you need to do dynamic (run-time) linking?
or:
Yes, will be used for dynamic linking, as DLL, if this is what you mean.
Is not working without new, got errors instead
You can use -
In this context dynamic-linking refers to using GetProcAddress to reference functions from the DLL at run-time instead of having the consumer of DLL functions link with the DLL's import library so that the linker can resolve the references at build-time.
I was wondering why you were using GetProcAddress rather than keeping it simple by using dllimport/dllexport.
Because that was the request, to use GetProcAddress. And everything is going fine if I don't use std::unique_ptr, but for my knowledge I tried with no success to use std::unique_ptr instead of raw pointer.
To export a C++ function under an undecorated name, use a DEF file.
You can use Dependency Walker to see the actual name the function got exported under. This is the exact name you need to pass to GetProcAddress. The way you export currently, it'd be a decorated name.
Sign in to comment
Activity