The first compiler error is somewhat self explanatory. get "W" at the end of GetProcAddressW
means that the method is the wide character API (as opposed to GetProcAddressA
, which is the ASCII version). Windows CE only exports the wide character versions of APIs. That means that you have to pass in a wide-character string. You used a TCHAR macro when you used _T
, which makes the enclosed string a wide character literal, and the error goes away.
The same code should work fine on big Windows (for any recent version anyway), provided that you #define UNICODE
(which is probably already on) and #include "tchar.h"
which I think you since _T
compiles. You could explicitly call GetProcAddressW
instead of just GetProcAddress (which should be #defined to the wide version if UNICODE is defined).
The source linker error you see isn't clear. I'm guessing __imp_Function2 is a function pointer that you're trying to assign with the GetProcAddress call? Basically the linker isn't finding it, but the root cause isn't clear with the info you've provided.