Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Syntax for Instantiating a VFP DLL in VB
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00454793
Message ID:
00454839
Views:
26
>>>Good Afternoon,
>>>
>>>I have a Multi-Threaded Dll which was created in VFP. If I do a create object from Fox I can run it without a problem.
>>>
>>>My problem is that I want to do it from within an existing VB application. Could someone help me or direct me to an example of calling a VFP application from within VB.
>>>
>>>Sincerely,
>>>
>>>Michael Brennan-White
>>
>>Add the VFP DLL's type library to the VB Project References, then you can use it like any other object, e.g. (once added to Project References)
Dim oVFPClass As MyVFPDLL.MyVFPClass
>>Set oVFPClass = New MyVFPDLL.MyVFPClass
>
>I'm not sure what I am doing wrong. I did exactly what you specified and the DLL gets instantiated.
>
>When I try to call my methods I get a run time error that I don't get if I call the DLL within Fox.
>
>
Dim oDLL as pplogviewer.pplogviewer
>Set oDLL = New pplogviewer.pplogviewer
>
>oDLL.rs2dbf Param1, Param2
>oDLL.parselog Param1
>
>I get a run time error -2147352567(80020009) while calling the rs2dbf method.
>
>Any other obvious things I am missing here?
>
>Thanks in advance for your assistance,
>
>Michael Brennan-White

Does it seem like the error is generated by VB or by the VFP COM object?

If it's the VFP COM object, add code to this class's Error() event as follows:
LPARAMETERS nError, cMethod, nLine

AError(laError)
COMReturnError("Error: " + Transform(nError) + Chr(13) + ;
    laError[1,2] + Chr(13) + ;
    "From: " + cMethod + ", Line: " + Transform(nLine))
and see if you get a better error message.
Insanity: Doing the same thing over and over and expecting different results.
Previous
Reply
Map
View

Click here to load this message in the networking platform