All Forums
 Microsoft Windows CE
 eVC Application Development
 Keypad Helper Class example in eVC? (init COM obj)
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

morpheus

9 Posts

Posted - 18 Nov 2003 :  10:37:07  Show Profile  Email Poster
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  Show Profile  Email Poster
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.

Go to Top of Page

morpheus

9 Posts

Posted - 18 Nov 2003 :  11:10:12  Show Profile  Email Poster
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
Go to Top of Page

ctacke

877 Posts

Posted - 18 Nov 2003 :  11:45:57  Show Profile  Email Poster
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.
Go to Top of Page

morpheus

9 Posts

Posted - 18 Nov 2003 :  12:05:01  Show Profile  Email Poster
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
Go to Top of Page

morpheus

9 Posts

Posted - 18 Nov 2003 :  13:12:39  Show Profile  Email Poster
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
Go to Top of Page

ctacke

877 Posts

Posted - 18 Nov 2003 :  13:15:31  Show Profile  Email Poster
It is dependent on atlce300.dll under CE 3.0, but otherwise there are no dependencies.
Go to Top of Page

morpheus

9 Posts

Posted - 18 Nov 2003 :  13:21:17  Show Profile  Email Poster
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
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.03 seconds. Snitz Forums 2000