OLE Automation with FoxPro

Is there a way to implement OLE Automation on a second instance of VFP.  I can get a handle of the second instance, but how can I pass a reference between the two so that the OLE Automation hierarchy is available to access.  

As an example, Excel can be accessed via ->    x = CreateObject("Excel.Application")  of via the GetObject(,"Excel.Application")  command if Excel is open.

What would be the syntax for accessing a second instance of VFP?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

oFox = CREATEOBJECT("VisualFoxPro.Application")
? oFox.Version
? oFox.Eval("version()")
oFox = NULL


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dataliteAuthor Commented:
Thank you both for the solution.  Strangely enough I tried that, but I must have misspelled it.  It does work, but it creates a new instance of foxpro.  What I was looking for was the GETOBJECT(,"VisualFoxPro,Application"), which latches on to an existing instance of Foxpro.

But your solutions led me to it and I thank you for your kind help.

I will therefore split the total between the two of you...


dataliteAuthor Commented:
Ha ha ha...  It was just one person...  I did not read the names on the posts....
pcelba  Hope you got all 500 points...

You may also use _VFP system variable instead of GETOBJECT to obtain OLE reference to current VFP process.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.