Solved

Visual Studio 2005 (VB) - Calling FoxPro Program

Posted on 2014-12-12
3
335 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 81

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

Suggested Solutions

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

739 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