Board index » delphi » D4 ActiveXDLL and IE4 Problems

D4 ActiveXDLL and IE4 Problems

Hello,

I've got D3 ActiveXDLL I created which works fine under IE4 using DHTML.
Since I've recompiled it using D4 I'm able to create an object but calling
methods
or getting/setting properties causes and application error in IE4.

This is an example of what I'm doing (Note: the following is VBScript though
I've
tried JScript with the same results):

(DHTML in .html file)

Sub  OnSomething()
  Dim  Obj

  Obj = CreateObject("MyActiveXDLL.MyObj")   ' This works

  Obj.SomeMethod    ' This crashes
End Sub

I've tried this using all threading models with the same results.  I've
created a couple of
different ActiveXDLLs with the same results and I've used three different
machines (All NT 4 SV 3)
with the same results.

A couple more notes:
If I create a delphi app. I have no problem doing something similar.  Using
VB I have a problem if I declare
Obj as MyObj but not if I declare it as IMyObj.

Any ideas?

Thanks,

Rick

 

Re:D4 ActiveXDLL and IE4 Problems


Hello,

I've got D3 ActiveXDLL I created which works fine under IE4 using DHTML.
Since I've recompiled it using D4 I'm able to create an object but calling
methods
or getting/setting properties causes and application error in IE4.

This is an example of what I'm doing (Note: the following is VBScript though
I've
tried JScript with the same results):

(DHTML in .html file)

Sub  OnSomething()
  Dim  Obj

  Obj = CreateObject("MyActiveXDLL.MyObj")   ' This works

  Obj.SomeMethod    ' This crashes
End Sub

I've tried this using all threading models with the same results.  I've
created a couple of
different ActiveXDLLs with the same results and I've used three different
machines (All NT 4 SV 3)
with the same results.

A couple more notes:
If I create a delphi app. I have no problem doing something similar.  Using
VB I have a problem if I declare
Obj as MyObj but not if I declare it as IMyObj.

Any ideas?

Thanks,

Rick

Re:D4 ActiveXDLL and IE4 Problems


Found the problem.  In D4 if you overload the
Initialize function (from TAutoOjbect) you MUST
call the "super class" Initialize (i.e. inherited Initialize).

The documentation says that it's not necessary.  This is
obviously still the D3 help for this topic.

Re:D4 ActiveXDLL and IE4 Problems


Hello,

Yep! This is the one thing you need to be aware of in D4. D3 let you get a
way with this because TAutoObject.Initialize had nothing in it. In D4, if
you forget you call inherited Initialize, you will get some IDispatch access
violations.

--
Binh Ly
Brickhouse Data Systems, Inc.
http://www.brickhouse.com

Quote
Rick Thompson wrote in message <35ae9b2a00000...@gjd01.viagj.com-MINC>...
>Found the problem.  In D4 if you overload the
>Initialize function (from TAutoOjbect) you MUST
>call the "super class" Initialize (i.e. inherited Initialize).

>The documentation says that it's not necessary.  This is
>obviously still the D3 help for this topic.

Other Threads