>Hi,
> I have a VFP COM DLL. I need to pass strings from VB to VFP COM DLL. I get error "type mismatch". Any idea?
>
>Code:
>VFP
>
>DEFINE CLASS obj AS SESSION
>PROCEDURE execute
>PARAMATER tcString, tcString2
>
>**Do watever
>
>ENDDEFINE
>
>VB
>
>Dim myobj as mydll.obj
>
>set myobj = NEW mydll.obj
>
>myobj.execute("aaa","bbb") ' error occured
>
>
>Why?
>
>Thank you
Add Error event code to your "obj" class definition in VFP, to get a better error message (you don't have to call it, the Error event will fire if there's a VFP error and will pass it the 3 parameters listed)
Procedure Error
LPARAMETERS nError, cMethod, nLine
Local laError(1)
AError(laError)
COMReturnError("VFP DLL object", ;
"Error: " + Transform(nError) + ": " + ;
laError[1,2] + ": " + ;
"Method: " + cmethod + ", Line: " + Transform(nLine))
EndProc
Insanity: Doing the same thing over and over and expecting different results.