when i insert my ActiveX into a pocket PC project my application wont start

I don't under stand what is going on here, but I developed an activeX for windows CE (well, i developed it for desktop windows also) but when i insert it into an application, all of a sudden the application won't start. There isn't even an error. I just start the application on the windows CE device and nothing happens. I remove the activeX and the program runs fine. Whats weird is that the same activeX (and when i mean same i mean the same exact files for both destop and mobil projects) works on the desktop just fine. Does anyone know what is going on?
[579 byte] By [UltraTrunks] at [2007-11-17 17:50:15]
# 1 Re: when i insert my ActiveX into a pocket PC project my application wont start
Is it an MFC application? If it is, when you created the project, did you specify ActiveX support in Step 2 of the WCE MFC AppWizard?
stober at 2007-11-9 12:22:44 >
# 2 Re: when i insert my ActiveX into a pocket PC project my application wont start
are you using ppc 2002? you need to implement IObjectSafety interface, otherwise it will generate a silent exception and may affect your application. check out microsoft site for a related KB article.
Elenjickal at 2007-11-9 12:23:44 >
# 3 Re: when i insert my ActiveX into a pocket PC project my application wont start
Elenjickal:> I'm not using ppc 2002 i'm using the regular compile mode for ppc.

Stober:> well, its both a MFC activeX and a PPC activeX
UltraTrunks at 2007-11-9 12:24:37 >
# 4 Re: when i insert my ActiveX into a pocket PC project my application wont start
In the OnInitInstance() in <your application name>.cpp see if it looks like below. I experienced your same problem when I forgot to check the "ActiveX Controls" checkbox in Step 2 of the WCE MFC AppWizard.

BOOL CMyApp::InitInstance()
{
// The following line enables ActiveX controls
AfxEnableControlContainer();

}
stober at 2007-11-9 12:25:41 >
# 5 Re: when i insert my ActiveX into a pocket PC project my application wont start
stober:> does the AfxEnableControlContainer go into the application that is using the activeX or the ActiveX's project??

I Tried putting it in the Container's project and it did not help.
UltraTrunks at 2007-11-9 12:26:40 >
# 6 Re: when i insert my ActiveX into a pocket PC project my application wont start
:)

Sorry stober you were right. I put the AfxEnableControlConatiner too far down in the InitINstances() function. So it wasn't being called. I put it at the top and it works fine. :)

Thanks man
UltraTrunks at 2007-11-9 12:27:39 >