Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to run a Visual Basic Prg or a C++ or C#.net from a VFP program

Status
Not open for further replies.

CCHSR

Programmer
Aug 3, 2005
15
US
Sorry
I posted this in the wrong forum before.

Does anyone know how to run a Visual Basic Prg or a C++ or C#.net from a VFP program.
This is a extension of the .TLB post I posted, I thought this might be a better approach.

Craig



 
There is not much more to say than in thread184-1706652

You have a DLL, you are advised to create a TLB file, which is short for typelib, that is describing the OLE classes and their methods and also included in the DLL. You don't need the TLB, as you don't link any DLL in VFP, you keep it a seperate file and once it is registered it would show up in a list of OLE classes in object browser. The vendor of the DLL should know how it's internal classes are named.

And then you use it like any COM/OLA class, via obj = CREATEOBJECT("class.name") and then calling obj.method(), whatever methods the class offers.

In C++ you typically don't create OLE classes, but functions, which can be declared in VFP via DECLARE function IN some.dll, but the TLB part of your requests suggests, this is not the case with your DLL.

If a C# assembly is not made COM visible, then you can't use it in VFP directly via any of these ways.

Bye, Olaf.
 
Olaf,

Thanks for jumping in, I really was tring to ask if I built a VB program using the dll the way they show.
Can I run that VB prg from inside of my VFP prg.

Craig
 
That surely is possible. You would need to create ole classes, at least one, you can use IN VFP, then we're at my first Answer again.
In VB.Net you create an assembly and at least in project settings check "Make assembly COM-Visible", you'll need to attribute classes and methods public to be available in VFP. You'll find much info about how to do that from Rick Strahl at West-Wind.

In VB6 you create an Active X DLL project.

Bye, Olaf.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top