|
-
Oct 22nd, 2007, 09:37 AM
#1
Thread Starter
New Member
Problem Passing Form Control to an ActiveX DLL.
Hi, I'm quite new to this forum, it's my first post, but it's been of some help in the past. I have a big problem, some VB6 code I have the chance to maintain doesn't work anymore.
I didn't change any code, but accidentally removed one of its dependencies (APEX True DBList Pro 6.0) and then reinstalled it after realizing my error. But now the project crash with "Run-time error '13': Type mismatch", so I investigated this problem and didn't found any way around it.
What is causing this error is that our main 'Standard EXE' application is calling a function (SetStdForm) in an ActiveX DLL with one of its Form has argument. Here's the isolated code that call the DLL:
Public WithEvents Rules As PCRules.Rules
Private Sub Form_Load()
Set Rules = New Rules
Rules.SetStdForm Me
End Sub
In that DLL, the Form is received by SetStdForm as an Object and then it set a private variable of type Form with this Object. It during the Set that the error happen. Here's the code form the DLL:
Private p_Form As Form
Public Function SetStdForm(ThisForm As Object, ...)
...
Set p_Form = ThisForm
...
So my questions are: Why is this error happening, it was working before and is still in production? What's the relation between this error and the dependency I reinstalled, considering I reinstalled the same version at the same place in the filesystem?
The DLL act as a kind of stylesheet, it apply some custom properties for every control in the main application. It's quite encrusted into the main program and I can't remove it easily. And
In my searches to find a way around that problem, I've found this Knowledge Base article which is relatively close to it: http://support.microsoft.com/kb/190210.
Thank you for reading this far!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|