>Can anyone tell me how to instantiate and call a VFP DLL in VB?
>
>Thanks
Kevin,
In order to use VFP Component Object Model (or any other Component Object Model)in VB the corresponding type library should be added to the project through Project/References menu option (find it in the list and put the checkmark next to it) so it will be available in your VB project.
Then you can instantiate it for example from VB form something like this:
Early binding:
Option Explicit
Dim oTest As myVFPdll.myVFPclass
Late binding:
Option Explicit
Dim oTest As Object
Set oTest = New myVFPclass
There is a lot of info on the subject in MSDN Library, for example the following links in will tell you the difference between early and late binding.
http://msdn.microsoft.com/library/devprods/vs6/vbasic/vbcon98/vbconoptimizingobjects.htmhttp://msdn.microsoft.com/library/devprods/vs6/vbasic/vbcon98/vbconhowbindingaffectsolecomponentperformance.htm
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison