Board index » delphi » AV creating wrappered ActiveX control.

AV creating wrappered ActiveX control.

Gentlemen:

I have an OCX file from DataQ Instruments.  I installed it via their
regular installation which apparently registered them.

(The control DataqSdk.OCX came free from
http://www.dataq.com/products/software/activex.htm )

I imported the OCX with the IDE's Project / Import type Library /
Install (or was it Create Unit?) which put the icon for TDataqSdk
onto the ActiveX palette tab.
Running under WinNT4 and D5 IDE, regardless of whether I drop this
icon on a form and assign its properties at design time or attempt
to create the component at runtime, it AVs when trying to do the
license check in the D5 OleCtrls.pas procedure
TOleControl.CreateInstance where it is trying to execute the
function CoCreateInstance( FControlData^.ClassID, nil,
CLSCTX_INPROC_SERVER or CLSCTX_LOCAL_SERVER, IOleObject,
FOleObject).  (A possible clue:  IOleObject appears to be all nulls
when viewed with the IDE tool tip when at a breakpoint just before
the CoCreateInstance call.)

Running w/o the IDE, it seems to work.

Could this be a general problem due to my improper installation or
use of the OCX or is it more likely something peculiar to the
specific OCX?

TIA for any suggestions or comments.  Regards, JohnH

 

Re:AV creating wrappered ActiveX control.


Is there a better forum to ask why this AV is coming out of
OleCtrls.pas?

Re:AV creating wrappered ActiveX control.


<<John Herbster:
Could this be a general problem due to my improper
installation or use of the OCX or is it more likely
something peculiar to the specific OCX?

Quote

I just installed the TDataqSdk and TDQChart ocxs and they
seem to work without difficulty (D5, Win 98SE). So either
I've just tried things that happen to work, or it looks
like it's an NT thing (security?). Can you give any
specific code that fails?

--
Deborah Pate (TeamB)
http://delphi-jedi.org
Sorry, no email please.

Re:AV creating wrappered ActiveX control.


 Deborah Pate (TeamB) wrote

Quote
> I just installed the TDataqSdk and TDQChart ocxs and they
> seem to work without difficulty (D5, Win 98SE). So either
> I've just tried things that happen to work, or it looks
> like it's an NT thing (security?). Can you give any
> specific code that fails?

Deborah,  Thank you so much for trying.  I have tried various
configurations under Win98SE, WinNT4, and Win2K.  I should have
mentioned that in one of the old tests, Win98SE *did* allow it work
under the IDE de{*word*81}.  I will try to put together the simplest
example that fails and drop it into attachments.  Do you know  the
proper way to make an updated TDataqSdkLib_TLB.PAS type library file
from the OCX?  Best Regards, JohnH

Re:AV creating wrappered ActiveX control.


Deborah Pate (TeamB) <d.p...@cableinet.co.not-this-bit.uk> wrote

Quote
> <<John Herbster:
> Could this be a general problem due to my improper
> installation or use of the OCX or is it more likely
> something peculiar to the specific OCX?

What is the proper way to free an OCX object:  Free or set to nil?

Quote
> I just installed the TDataqSdk and TDQChart ocxs and they
> seem to work without difficulty (D5, Win 98SE). So either
> I've just tried things that happen to work, or it looks
> like it's an NT thing (security?). Can you give any
> specific code that fails?

I just dropped a small zip of a complete small project that uses the
TDataqSdk into attachments.

Thank you very much for your interest.  Regards, JohnH

Re:AV creating wrappered ActiveX control.


Deborah,

Under Win98SE, I have loaded tried the same demo that I zipped and
put into the attachments forum.  It works under Win98SE, and fails
under WinNT and Win2K.

Any ideas are welcome.  Regards, JohnH

Re:AV creating wrappered ActiveX control.


I can duplicate your problem under Win2k. I don't know the answer but I
suspect that it's some kind of incompatibility between TOleControl and this
specific component. What it is, I don't know (it could be some UI/Win32
messages timing issue) - the only way to tell is to be able to debug the
component itself (under Delphi as the host) if you have the source code to
it. I suspect it's an error in the Delphi TOleControl code somewhere because
I recall a while back another person posting the same problem but using a
different OCX.

have fun
--
Binh Ly
http://www.techvanguards.com

Quote
"John Herbster" <jo...@petronworld.com> wrote in message

news:3a22eb39_1@dnews...
Quote
> Gentlemen:

> I have an OCX file from DataQ Instruments.  I installed it via their
> regular installation which apparently registered them.

> (The control DataqSdk.OCX came free from
> http://www.dataq.com/products/software/activex.htm )

> I imported the OCX with the IDE's Project / Import type Library /
> Install (or was it Create Unit?) which put the icon for TDataqSdk
> onto the ActiveX palette tab.

> Running under WinNT4 and D5 IDE, regardless of whether I drop this
> icon on a form and assign its properties at design time or attempt
> to create the component at runtime, it AVs when trying to do the
> license check in the D5 OleCtrls.pas procedure
> TOleControl.CreateInstance where it is trying to execute the
> function CoCreateInstance( FControlData^.ClassID, nil,
> CLSCTX_INPROC_SERVER or CLSCTX_LOCAL_SERVER, IOleObject,
> FOleObject).  (A possible clue:  IOleObject appears to be all nulls
> when viewed with the IDE tool tip when at a breakpoint just before
> the CoCreateInstance call.)

> Running w/o the IDE, it seems to work.

> Could this be a general problem due to my improper installation or
> use of the OCX or is it more likely something peculiar to the
> specific OCX?

> TIA for any suggestions or comments.  Regards, JohnH

Re:AV creating wrappered ActiveX control.


Quote
"John Herbster" <jo...@petronworld.com> wrote in message

news:3a2439be$2_1@dnews...

Quote
> What is the proper way to free an OCX object:  Free or set to nil?

If you're using the wrapper, call Free. BTW, it appears that the AV is
non-catatrophic (does not seem to cause logic/code problems for you).
Therefore as a workaround, I suggest just wrapping the Free call around a
dummy try-except block.

have fun
--
Binh Ly
http://www.techvanguards.com

Re:AV creating wrappered ActiveX control.


Binh Ly <b...@techvanguards.com> wrote
Quote
>> ... If you're using the wrapper, call Free. BTW, it appears that

the AV is non-catastrophic (does not seem to cause logic/code
problems for you).  Therefore as a workaround, I suggest just
wrapping the Free call around a dummy try-except block.

Binh,  Thanks for the help.
I am using the *LibTLB.PAS wrapper generated by D5ud1.

In my very simple test in attachments, the attempt to Free the
object AVs in destructor TOleControl.Destroy during the execution of
the "FOleObject := nil" line.

Best Regards, JohnH

Re:AV creating wrappered ActiveX control.


Yep. I suspect this is some incompatibility bug between TOleControl and the
specific OCX you have. As a workaround, just silence and ignore the error
using an empty try-except block.

have fun
--
Binh Ly
http://www.techvanguards.com

Quote
"John Herbster" <jo...@petronworld.com> wrote in message

news:3a252d5a$1_1@dnews...
Quote
> Binh Ly <b...@techvanguards.com> wrote
> >> ... If you're using the wrapper, call Free. BTW, it appears that
> the AV is non-catastrophic (does not seem to cause logic/code
> problems for you).  Therefore as a workaround, I suggest just
> wrapping the Free call around a dummy try-except block.

> Binh,  Thanks for the help.

> I am using the *LibTLB.PAS wrapper generated by D5ud1.

> In my very simple test in attachments, the attempt to Free the
> object AVs in destructor TOleControl.Destroy during the execution of
> the "FOleObject := nil" line.

> Best Regards, JohnH

Other Threads