PDA

Click to See Complete Forum and Search --> : VB6 Fuction call to DLL - invalid property or method


kelljohm
Mar 9th, 2006, 04:02 AM
HI, I am having a problem passing a parameter from an EXE to a dll. If I pass a basic type then it works OK, such as string, Long,etc. However. I have created a new type. If I pass the parameters withing the same project it works OK but when I try to do it to a DLL then I get the error
Code call looks like this

Private oServer As pServer.c_Main

Private Sub cmdStartServer_Click()
Set oServer = New pServer.c_Main
oServer.StartServer

End Sub

Private Sub Command1_Click()

Dim newAlarm As c_Alarm_T
Set newAlarm = New c_Alarm_T
newAlarm.notificationId = "12345"



oServer.push_Alarm (newAlarm)

End Sub


I get the run-time error 438. Object doesn't support this property or method. Any help greatly appreciated.

yrwyddfa
Mar 20th, 2006, 05:33 AM
Sounds like an IID issue. Recompile the DLL with Binary Compatibility set to ON.

What it sounds like is inside the development environment VB will (behind the scenes) create temporary UUID,IID, and GUIDS to get you going. Once you try to use the compiled version you are using the registry (in some cases) to look up how to bind, and marshal too and from the object.

If the interface definition/specification, and it's subsequent 'tags' mismatch in any way, then errors will be raised.

In this case it sounds like you've added a method, or changed a method signature with recompiling with binary compatibility set.