Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
9
Erster Beitrag:
vor 4 Jahren, 4 Monaten
Letzter Beitrag:
vor 4 Jahren, 4 Monaten
Beteiligte Autoren:
Patrick Thijs, Al, Tor-Bjarne, Fabrice Harari

Troubles using ActiveX in Windev

Startbeitrag von Patrick Thijs am 28.08.2013 15:51

Hello everyone,

i'm facing a problem in a project where i'm using an ActiveX-control.

I've been using this control for years already, but now there are some new features that i want to use.

To use this feature, there is a method that I call from in my Windev-program
I have a VB syntax on how to use this method :

[Visual Basic]

control.Downloader.SessionStartToFile (
strURL as String,
strUsername as String,
strPassword as String,
strDestinationPath as String,
bDisableCache as enumBoolean,
nDllSessionUniqueId as Long,
nFileExceptionCause as Long
) as enumErrorCodes


the 5 first parameters are values that are submitted to the method, the 2 last parameters are references that on return from the method will contain a numeric value.

In my code this looks this :

nResultaat = player>>Downloader>>SessionStartToFile(sWebDir,gsFTPuserMain,gsPasswordMain,gsMusicPath,True,gnDownloadSessionID_A1,gnDownloadExceptionID_A1)

But when I execute the code, I get this error :

Error at line 164 of Local Procedure PrioRequest_1 process.
'SessionStartToFile' Automation method called.
Attempt to invoke method or to read property. Error returned by Automation/ActiveX object:
'Erreur 80020005, Type incorrect pour le paramètre 7'
Attempt to invoke method. Error returned by Automation/ActiveX object:
'Erreur 80020005, Type incorrect pour le paramètre 7'
Attempt to read property. Error returned by Automation/ActiveX object:
'Erreur 80020005, Type incorrect pour le paramètre 7'
Attempt to write property. Error returned by Automation/ActiveX object:
'Erreur 80020005, Type incorrect pour le paramètre 7'


It looks to me that there is a problem with the last two variables in my Method Call, I've been trying to change the type from Int to Int on 4 or Int on 8, but it's not helping..

Is there anyone who had a similar problem, and who found a solution for this ?

greetz,

Patrick

Antworten:

Hi Patrick

try passing the address of the variables instead (ie &VariableName instead of VariableName)

Best regards

von Fabrice Harari - am 28.08.2013 15:56
Hello Fabrice,

thanks for the fast answer, but this solution isn't helping.
I've tried it with the variables defined as Int, Int on 4 and Int on 8

Any other suggestions ?

grtz

Patrick

von Patrick Thijs - am 28.08.2013 16:03
Hello Patrick

Does it help if you define the numeric variables as system integers ?

Regards
Al

von Al - am 28.08.2013 16:31
Hello Al,

forgive me my stupid question, but what do you mean exactly ?
Declaring the variable as a global variable ?

greetz,

Patrick

von Patrick Thijs - am 28.08.2013 16:44
Hello Patrick

There is provision to create an integer as a system integer and it allows the integer size to adapt to the operating system, so 4 for Windows 32bit and 8 for Windows 64bit.

The declaration is:

nVar is system Int

Regards
Al

von Al - am 28.08.2013 22:10
Hello Al,

this isn't working neither...

greetz,

Patrick

von Patrick Thijs - am 29.08.2013 14:33
Hello Al,

in the mean time, I've contacted the maker of the ActiveX component, so hear if he has a solution for my problem, he responded with a question :

does your dev-language supports passing parameters by pointers or by reference? Both of the mentioned parameters are passed "ByRef"
to VB6 or by "long *" pointer to VC++


To be honest, I don't know what to answer here (me feeling very stupid at this moment) :eek:

greetz

Patrick

von Patrick Thijs - am 29.08.2013 15:50
Hi,

ByRef is this not by adress?

nVar is system Int

AX>>param2 = adress(nVar)

What ActiveX are you using?

Cheers
Tor-Bjarne

von Tor-Bjarne - am 02.09.2013 13:12
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.