-
August 22nd, 2003, 12:50 PM
#1
Could somebody please explain why this doesn't work!
I'm quite annoyed at the moment. This worked this morning, I swear, but now it doesn't. What is going on.
In one project, compiled as a DLL I have this code:
class cFormSFX:
Code:
Public Property Set TargetForm(frmNewValue As Object)
If (TypeOf frmNewValue Is Form) Then
MsgBox frmNewValue.Name
End If
End Property
In a second project, compiled as an exe I have this code.
form Form1
Code:
Private mobjTest As FormSFX.cFormSFX
Private Sub Form_Initialize()
Set mobjTest = New cFormSFX
Set mobjTest.TargetForm = me
End Sub
The typeof validation in the DLL fails, and I do not understand why. Can anyone help me?
Finite
"If a cat always lands on its feet, and a peice of bread always lands butter side down, if you strap a peice of bread butter side up to the back of a cat, will it hover?"
-
August 22nd, 2003, 01:32 PM
#2
How the heck were you able to display a messagebox from a DLL? Are there other components to the DLL you're not showing?
-
August 22nd, 2003, 01:42 PM
#3
I also use a Msgbox in my dll, it works perfectly.
What do you mean by it doesn't work anymore? Any error message? Was your DLL still registered when it failed?
Cheers,
Laurent
For an aviator, the three best things in life are a good landing, a good orgasm, and a good sh*t. A night carrier landing is one of the few opportunities to experience all three at the same time.
-
August 22nd, 2003, 03:25 PM
#4
In the dll. It does not recognise the value in frmNewValue as a VB.Form object when I try and validate it in the Typeof statement. I have no idea why. Any ideas.
Finite
"If a cat always lands on its feet, and a peice of bread always lands butter side down, if you strap a peice of bread butter side up to the back of a cat, will it hover?"
-
August 22nd, 2003, 03:48 PM
#5
Never mind guys. It seems that I can't run 2 IDE's at once (don't see why not, it works fine apart from that stupid little error).
If I compiled the DLL it works perfectly, I just can't tweak things and test them as fast as I could with 2 IDE's. Alas, such is life. Thanks for the suggestions anyhow.
Finite
"If a cat always lands on its feet, and a peice of bread always lands butter side down, if you strap a peice of bread butter side up to the back of a cat, will it hover?"
-
August 23rd, 2003, 08:32 AM
#6
Hi,
Just on a side note ...
Using the TypeName() VB function gives you a text name of what the variable type is, which might be useful when the TypeOf operator doesnt seem to be working.
Just knowing what the actual variable type is in this kind of situation can often help you solve the problem and bypass all that confusion and frustration.
Cheers,
Tinbum747
Zen-Programming:
If a compiler beeps in the IDE forest, and nobody hears it, was there really a bug?
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
|