Author |
Topic |
|
morpheus
9 Posts |
Posted - 18 Nov 2003 : 10:37:07
|
Has anyone got a sample program of the Keypad Helper Class ( topic.asp?TOPIC_ID=1203 ) written in C++ ( eVC 3.0 )? I'm having some trouble loading the COM object and I'm not sure why... any working sample would make a huge difference ( COM not being my specialty ).
Thanks!
Scott LaCroix Dataline |
|
ctacke
877 Posts |
Posted - 18 Nov 2003 : 11:02:31
|
Scott,
There should be no reason the COM library wouldn't work in C++, but I'm curious why you need the added layer of abstraction for such a simple interface. Is there a specific reason you want to use the COM version rather than just adding a polling thread to your application directly? In eVB there really isn't a choice since a worker thread can't be spawned, but in eVC it's pretty simple.
|
|
|
morpheus
9 Posts |
Posted - 18 Nov 2003 : 11:10:12
|
No direct reason... except that the code is already there, and we're using COM objects for other things.
The sample class you guys wrote is an elegant solution, and I'm already doing message translation for Windows events. When I saw your class and how it allows sending user-defined Windows events from keypad presses, I figured I'd just use it rather than re-invent the wheel.
All I'm having trouble with is initialization... I'm sure the library works fine, and I think I've got the calls down, but I get these errors when I init the class:
Loading SMARTIO.DLL...
Can't find SMARTIO.DLL
Loading KEYBDDR.DLL...
KEYBDDR.DLL Loaded successfully... Setting defaults... RaiseException: Thread=814cb7b4 Proc=8114f5c4 'PocketPhone.exe' AKY=00000021 PC=03f83334 RA=800bde58 BVA=00000001 FSR=00000001 RaiseException: Thread=812c0400 Proc=8114f5c4 'PocketPhone.exe' AKY=00000021 PC=03f83334 RA=800bde58 BVA=00000001 FSR=00000001 Data Abort: Thread=812c0400 Proc=8114f5c4 'PocketPhone.exe' AKY=00000021 PC=000114a0 RA=00011498 BVA=0c000000 FSR=00000007
PocketPhone is my base application.
The loading code is pretty simple:
CComPtr pkbd ; CoInitializeEx( NULL, COINIT_MULTITHREADED ); CoCreateInstance(__uuidof(KeypadManager), NULL, CLSCTX_INPROC, __uuidof(IKeypadManager), (void **)&pkbd );
Any ideas?
- Scott |
|
|
ctacke
877 Posts |
Posted - 18 Nov 2003 : 11:45:57
|
Your code looks fine. The debug output seems to indicate that it's dying somewhere around the call to ClearKeypadMap() or after the ctor has run so you might start debugging there. |
|
|
morpheus
9 Posts |
Posted - 18 Nov 2003 : 12:05:01
|
Just for the heck of it I commented out all the code in the CKeypadManager constructor... to see if I could start narrowing down what call generated the errors.
Same list of errors, without any initailization.
*boggle*
- Scott |
|
|
morpheus
9 Posts |
Posted - 18 Nov 2003 : 13:12:39
|
Ahhh... CoCreateInstance is returning REGDB_E_IIDNOTREG
Are there dependancies I'm missing here? Possibly using the wrong class ID's in my call to CoCreateInstance?
Sorry if these questions are as basic as I think they are...
- Scott |
|
|
ctacke
877 Posts |
Posted - 18 Nov 2003 : 13:15:31
|
It is dependent on atlce300.dll under CE 3.0, but otherwise there are no dependencies. |
|
|
morpheus
9 Posts |
Posted - 18 Nov 2003 : 13:21:17
|
That one I knew... got that one copied into \Windows and registered with ADSCopy ( using ADSCopy to register ADSmartIO.dll as well ).
I'm truely baffled... I'd go back and do it myself, if the sample class didn't solve my problem so perfectly. Anything I write would end up being a re-write of what you've already done.
- Scott |
|
|
|
Topic |
|