GPF with OCX not registered

Started by Rainer Wiedemann, March 06, 2009, 10:17:49 AM

Previous topic - Next topic

Rainer Wiedemann

Hi,
I found a problem with firefly and ocx-controls:
I have a form: form1 and an ocxcontrol ocx1 (i.e. demoocx.ocx). Then firefly creates the includefile demoocx1_Events.inc. If the ocx is registered, everthing works fine. But if not, the app crashes with gpf before the form1_load procedure is started (there I check whether the ocx is registered or the file is presend at all). I found, that the gpf happens in the includefile in procedure demoocxIdemoocxEvents1_SetEvents because pthis=0 in the case of not registered.
So if I add the following code

   If pthis=0 then
         function=1
         exit function
   end if

after

   IID_CPC = GUID$("{...}")
   IID_CP  = GUID$("{...}")

everything is okay. My form1_load procedure realizes the missing of the ocx and can register it when the file is found (and must restart the app for working with the ocx).
I had this problem with several ocx. A few days ago, I did a new project and got an gpf. Last time I used an ocx was a year ago, so I forgot the workaround. After two hours I rememberd and everything was okay.
So I now ask, whether you can add this few lines of code in a future release. Would be pretty.  ;D
Thanks and regards
Rainer

TechSupport

Thanks Rainer - just so you know, I am reworking the entire OCX functionality in FireFly 3. Hopefully situations like yours will be caught much more easily in FF3.