Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
10
Erster Beitrag:
vor 2 Jahren
Letzter Beitrag:
vor 2 Jahren
Beteiligte Autoren:
Gary Williams, Stewart Crisler, Fabrice Harari, Peter Holemans, CCC2

WinDev as Automation Server

Startbeitrag von Gary Williams am 04.02.2016 09:44

Is there anyway to get WinDev to be an Automation server?

We are in the early stages of converting a project to WinDev from VFP, we need to add some functionality to the existing application, but I wondered if there was a way to write it in WinDev and automate it from the existing app rather than have to write it twice.

In VFP you can declare a class as OLEPUBLIC and it is then accessible from external applications, I can't find anything in the help files, can anything similar be done in WinDev?

Gary.

Antworten:

Hi Gary,

Yes you can...

1) OLE Integration -> Only from WX towards VFP (not vice versa)
You can direcly do OLE calls out of WX.
Have a look at Automation in the help.
I have several integrations with Excel like this.
You can start looking here: WX Help Page

2) Native Integration -> Bidirectional
I have quite some integrations mostly via a C/C++ bridge by generating a custom DLL buit using Windows Foundation Classes.
If you look in the 'External Languages' folder in your installation directory you'll find samples for Basic, C, C#, Cobol, Fortran, Java and Pascal but unfortunately not for VFP.

I hope this helps...

Cheers,

Peter Holemans

von Peter Holemans - am 04.02.2016 10:04
Hello Gary,

to complete Peter's answer, you can ALSO generate a .net assembly in windev, and call any exposed method from anything else that is .net enabled.

Best regards

von Fabrice Harari - am 04.02.2016 12:19
Looking at the "external language" examples, they all use a function CALLWD(), which I assume must be a function in one of the WinDev DLL files.

If I knew which DLL I could declare it and probably use it from VFP, does anyone know which DLL it's in?

Fabrice, with .Net DLL can I expose windows or just procedures? I could not find much on it in the help file other than how to generate one.

Gary.

von Gary Williams - am 04.02.2016 15:21
forget about ole, that is old technology . in secure environment your program will get problem running .

von CCC2 - am 04.02.2016 15:31
Hi Gary,

CallWD calls your WD app when it is built as a WX library.
This will create a WDL instead of an exe (yourwdapplication.wdl).
Next it uses the available WX runtime DLL's (WD20....dll) in the same folder to talk with your application built as a .WDL.

I hope this helps,

Peter Holemans

von Peter Holemans - am 04.02.2016 16:27
I'm also programming in VFP and WinDev.

WinDev cannot be used as an automation server.

I have 2 techniques for getting stuff done in WinDev but called from VFP.
(1) Put the parameters I want to pass in a temp text file and if I need a response generate a name that WinDev should use. Then RUN the WinDev program passing the file names as parameters. When the response file is available, VFP can continue.

(2) Using the defunct ETechnologia .net integrator, I developed a socket protocol. I can then talk socket to socket.

I have not done it, but another option would be interprocess messaging via the Windows API and DLL calls.

My biggest problem is accessing VFP data from WinDev. The ODBC driver has not proven reliable enough and writing the code to use it is PAINFUL. I was playing with using the OLE Automation capabilities of VFP but got distracted and never got it working.

If you find any better techniques, I would love to know about them.

Best of luck.

Stewart Crisler

von Stewart Crisler - am 04.02.2016 19:52
Quote
Stewart Crisler
(2) Using the defunct ETechnologia .net integrator, I developed a socket protocol. I can then talk socket to socket.


You've just reminded me that I once wrote a socket type interface between two vfp apps so that they could talk to each other and swap data objects, maybe I'll look out that code and see if it could be of any use here.

Quote
Stewart Crisler

My biggest problem is accessing VFP data from WinDev. The ODBC driver has not proven reliable enough and writing the code to use it is PAINFUL. I was playing with using the OLE Automation capabilities of VFP but got distracted and never got it working.

If you find any better techniques, I would love to know about them.

Stewart Crisler


Actually I have had some success in that direction using HDBOpen() and HExecuteSQLQuery(), there are some restrictions on opening the same VFP table multiple times, but I have worked around that by having a flag to check if the table is already open and using Pete Halsted's data classes, so the data is loaded once into an array of data objects, then I can manipulate from there.

I haven't had to write back to VFP so not sure how that will work.

Gary.

von Gary Williams - am 04.02.2016 20:20
Hi Gary,

with the .net method, I do not remember if you can DIRECTLY expose a window. However, as you can always expose a method that does an open of a window, you can certainly do it in one or two lines of code

Best regards

von Fabrice Harari - am 04.02.2016 21:13
I agree, reading the data from VFP tables works very smoothly. I have even imported tables into an analysis as XBASE.

It's writing the data that is a real bear. I have it working using SQLExecute() and the ODBC driver. It's building up the set of VFP commands so that ODBC sees it as a block of executable fox code that is very painful.

Stewart Crisler

von Stewart Crisler - am 05.02.2016 18:34
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.