PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Automation Object
Automation Object
Débuté par Rui Pereira, 13 aoû. 2008 16:25 - 2 réponses
Posté le 13 août 2008 - 16:25
Hi

I'm new with Windev and I have this problem:
I've this code in VB that I couldn't reproduce in Windev.

Dim GCOApiCon As GcoAPIInterfaces.Coneccao_0801001
GCOApiCon = CreateObject("GCOAPI.Coneccao")
GCOApiCon.Abre(ServerName, UserName, Password, Company, Year)

GcoAPIInterfaces: Is a COM component redistributable that I've added to the project by adding a reference to it.
GCOAPI: Is a COM component installed by the main application.

Is there any way to do it?

Thanks in advance
Rui
Posté le 15 août 2008 - 14:10
Hi,

I answered this in another forum, but it doesn't appear to be coming back into this forum;

Hi Rui,

Try something like


--------------begin snip-------------------------------------------

GCOApiCon is object automation "GCOAPI.Coneccao"

GCOApiCon>>Abre( sServername, sUsername, sPassword, sCompany, sYear)

--------------end snip---------------------------------------------

Let me know if this works or not.

Cheers!
ken
Posté le 18 août 2008 - 16:12
Hi Ken

That i already tried, the problem is that GCOAPI and GCOAPIInterfaces have different properties and methods so, if I define GCOAPICon as GCOAPI.Coneccao I get the methods from GCOAPI and not the methods from GCOAPIInterfaces. I know... wtf is this???? The guys that developed this API, say that we must create the Object as GCOAPI but use the interface API because compatibility issues, in VB or C it works fine, but I can't reproduce the code in windev. For now I solve the problem, I've created a small program in VB that runs in background and I call him from the windev project.

Thanks for trying to help me
Rui