Solved

Visual Studio 2005 (VB) - Calling FoxPro Program

Posted on 2014-12-12
3
341 Views
Last Modified: 2014-12-15
Hello Experts!
OK so this works fin on my laptop because I have FoxPro installed...but does NOT work on a PC that doesn't have FoxPro installed.

I thought that when I added the reference to FoxPro and it loaded this file (Interop.VisualFoxpro.dll) to my Debug Director as long as that file was present in the application directory on the PC without FoxPro it would use this dll for any and all FoxPro commands.

I'm trying to execute a report from my Visual Basic program and as I mentioned it works fine on my laptop it is when I load (copy) everything down to the PC without FoxPro install it doesn't work...I get Retrieving the COM Class factory for component...etc.

Here is my code:
                Dim FoxPro As New VisualFoxpro.FoxApplication

                FoxPro.DefaultFilePath = sSitePath & "Programs\"
                FoxPro.DoCmd("DO " & sSitePath & "Programs\r_ach_items.prg WITH 'sOutFile & "'

Thanks,
Mark
0
Comment
Question by:smithmrk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 82

Assisted Solution

by:David Johnson, CD, MVP
David Johnson, CD, MVP earned 100 total points
ID: 40497589
Did you add the runtime libraries to the client machine that doesn't have vfp installed?
http://msdn.microsoft.com/en-US/library/tz3tcs63(v=vs.80).aspx
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 400 total points
ID: 40498293
The interop is simply a bridge between your application (.NET) and the FoxPro library (COM). It makes the changes and type translations needed for the 2 worlds (.NET and COM) to communicate.

When you reference something that comes from the COM tab, the interop is generated, but the dll that you referenced is not really referenced. And the tools that generate setup programs won't include them in the distribution, to prevent the distribution of files that might be copyrighted. Otherwise, you would simply have to reference Microsoft Excel in one of your application and Word would be automatically installed for any user that uses your application.

You thus have to make sure you have the right to do so, and if so, install these dlls manually, through a script, or add them to whatever you use to distribute your application to your users.

As for the 2 files that are required for FoxPro and listed in the David's link, legally you have the right to redistribute them with your application if you have a valid license for FoxPro.
0
 

Author Closing Comment

by:smithmrk
ID: 40500520
Thanks for the explanation!

I thought that the Interop was a conversion from the COM DLL to the .Net version...didn't realize it was just a way to communicate to the COM DLL.
That just goes to show you how much I know about the COM DLL's in .Net!  I appreciate you taking the time to explain it to me, and I will be registering the FoxPro COM DLL now as we do have a valid license.

Thanks to both of you for helping me through my issue.

Mark
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question