Hi everyone.
Some time ago I was working on a driver for my mobile device (it should read IR from my old Palm Wireless Keyboard and send data to the working application).
I worked out all the IR thing and created a whole application for testing input from keyboard. But when faced to sending data to the current application, I had no clue about how to do it, because none of the usual functions you would be using on desktop existed for CE Platform (there are some posts about on Windows CE Forum)
Reluctantly, I fell on Input Method (I expected to avoid it, but was not possible). I developed the ActiveX and although it registered well, it didn't work.
I left the project parked (I've been giving a shot at Playstation development and I can now read input from this same keyboard on PSP
)
Now, I'm picking up the project again. I added lots of logs and I think I've found the problem. And, of course, it's a real silly problem.
It happens that the dll containing my activeX has to export those functions:
DllMain
DllRegisterServer
DllUnregisterServer
DllGetClassObject
DllCanUnloadNow
and it does, except for the last two.
If I declare DllCanUnloadNow as
STDAPI DllCanUnloadNow (void)
it compiles and links fine, but the function is not exported. If I declare:
__declspec( dllexport ) STDAPI DllCanUnloadNow (void)
it should export (as it does with DllRegisterServer, that is declared the same way), but fails to link with:
POLINK: error: Unresolved external symbol '_$DllGetClassObject'.
I think the problem is related to the declaration of both functions at objbase.h
Question (at last) is... how can I export those two functions from my dll?
By the way, I'm compiling with -Gz and -Ze flags, but not -Gn. If I compile with -Gn the symptoms are the same. I also have -D_WINCE and -DUNICODE put on.