Board index » cppbuilder » BCB4: Creating Event Handler for ActiveX Control gives access violations when accessing properties

BCB4: Creating Event Handler for ActiveX Control gives access violations when accessing properties

I just upgraded from BCB1 to 4 and am having problems with my LeadTools
(v8) ActiveX control.  If I define an event handler for the TWAIN event,
I get access violations every time I access a property of the control,
even though the event never occurred.  If I remove the event, everything
works fine.  Add the event back in, access violations all the time.

This worked fine in C++ Builder 1.0 and Visual Basic (5), so I'm pretty
sure it's not a bug in the LeadTools control.  Any suggestions for
tracking this down would be most helpful.  My program is in alpha (soon
to be beta) and I really don't want to upgrade the leadtools control
unless I have to.

--
Mike / mike_n...@hotmail.com

 

Re:BCB4: Creating Event Handler for ActiveX Control gives access violations when accessing properties


Quote
"Mr. Mike" wrote:

> I just upgraded from BCB1 to 4 and am having problems with my LeadTools
> (v8) ActiveX control.  If I define an event handler for the TWAIN event,
> I get access violations every time I access a property of the control,
> even though the event never occurred.  If I remove the event, everything
> works fine.  Add the event back in, access violations all the time.

> This worked fine in C++ Builder 1.0 and Visual Basic (5), so I'm pretty
> sure it's not a bug in the LeadTools control.  Any suggestions for
> tracking this down would be most helpful.  My program is in alpha (soon
> to be beta) and I really don't want to upgrade the leadtools control
> unless I have to.

hmmm ... was the control created in VB by any chance?

Are you accessing properties through . (VTABLE) or -> (DISPINTERFACE)?

If (a) is yes and (b) is VTABLE, try using the DISPINTERFACE instead.

Also, if there is a downloadable/trial/free version of the LeadTools ActiveX,
tell me where I can get it, and i'll add it to my test suites.

Re:BCB4: Creating Event Handler for ActiveX Control gives access violations when accessing properties


Quote
> hmmm ... was the control created in VB by any chance?

Not sure, is there any way to tell?  I doubt it is but I'm not sure.

Quote
> Are you accessing properties through . (VTABLE) or -> (DISPINTERFACE)?

> If (a) is yes and (b) is VTABLE, try using the DISPINTERFACE instead.

> Also, if there is a downloadable/trial/free version of the LeadTools ActiveX,
> tell me where I can get it, and i'll add it to my test suites.

I used it like this:

Lead1->Bitmap = 0;

This worked fine in Builder 1 but not in Builder 4.

I'm using an older version (Version 8.0) so you won't be able to
download it.  I would download the latest version but I decided to stick
with Builder 1.0 for this release because of this problem and Async Pro
won't work with 4.0 either.

--
Mike / mike_n...@hotmail.com

Re:BCB4: Creating Event Handler for ActiveX Control gives access violations when accessing properties


Quote
"Mr. Mike" wrote:

> > hmmm ... was the control created in VB by any chance?

> Not sure, is there any way to tell?  I doubt it is but I'm not sure.

> > Are you accessing properties through . (VTABLE) or -> (DISPINTERFACE)?

> > If (a) is yes and (b) is VTABLE, try using the DISPINTERFACE instead.

> > Also, if there is a downloadable/trial/free version of the LeadTools ActiveX,
> > tell me where I can get it, and i'll add it to my test suites.

> I used it like this:

> Lead1->Bitmap = 0;

> This worked fine in Builder 1 but not in Builder 4.

OK, I would expect that to work.

Quote

> I'm using an older version (Version 8.0) so you won't be able to
> download it.  I would download the latest version but I decided to stick

OK, this might be slightly problematic, but if you can send me the control,
i'll test it and see if I can figure out what the problem is.

[I've got an eval copy, in a box, of version 10, but i'd rather test against
the version you have as it will tell me more. :)]

Other Threads