m35a2
12-18-2002, 09:00 AM
I am trying to create an ActiveX control in eVC++. I don't have much experience with ActiveX controls in VC++. I used the "ActiveX ControlWizard" template to create it and then I added some properties and methods. The control compiles and registers fine on any platform I try it on, but when I run my eVB program that tries to use the control, it generates a "catastrophic error" (0x8000FFFF or -2147418113). The "CreateObject" call is sucessful, and the result is NOT Nothing, but when trying to access the object, it dies with the above error.
Even if I don't add any methods or properties of my own, it still fails the same way. The wizard creates an "AboutBox" method. If I merely do "x.AboutBox", it fails exactly as before.
Here is a sample of the eVB code:
Private Sub Form_Activate()
On Error Resume Next
Dim x As object
MsgBox "In form activate"
Set x = CreateObject("TESTCTRL.TestctrlCtrl.1")
If Err.Number <> 0 Then
MsgBox "Error # " & Err.Number & Err.Description
End If
x.AboutBox
MsgBox "Error # " & Err.Number & Err.Description
End Sub
When debugging it, I see the first message box. The second does not get called because no error is set by the CreateObject call. The AboutBox of the control does not get displayed and the next msgbox contains "Error # -2147418113". If I look up the description in the help, it says "catastrophic error".
Can anyone offer any help or examples of a simple working control anywhere on the web. Or, is there a way to use class modules from within eVB?
Thanks in advance for any help.
Even if I don't add any methods or properties of my own, it still fails the same way. The wizard creates an "AboutBox" method. If I merely do "x.AboutBox", it fails exactly as before.
Here is a sample of the eVB code:
Private Sub Form_Activate()
On Error Resume Next
Dim x As object
MsgBox "In form activate"
Set x = CreateObject("TESTCTRL.TestctrlCtrl.1")
If Err.Number <> 0 Then
MsgBox "Error # " & Err.Number & Err.Description
End If
x.AboutBox
MsgBox "Error # " & Err.Number & Err.Description
End Sub
When debugging it, I see the first message box. The second does not get called because no error is set by the CreateObject call. The AboutBox of the control does not get displayed and the next msgbox contains "Error # -2147418113". If I look up the description in the help, it says "catastrophic error".
Can anyone offer any help or examples of a simple working control anywhere on the web. Or, is there a way to use class modules from within eVB?
Thanks in advance for any help.