Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COM Parameters
Message
 
 
À
16/03/2001 12:02:23
Monte Murdock
Universal American Mortgage Company
Clearwater, Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Divers
Thread ID:
00485944
Message ID:
00485970
Vues:
11
>>>Can you pass parameters to COM DLL objects? If so what is the syntax?
>>
>>Monte,
>>You would pass parameters the same as if were a regular VFP object.
>>
>>myreturnvalue = COMObject.Method(param1, param2, param3)
>>
>>The only difference with COM objects is you can't pass parameters directly to the Init using CreateObject/AddObject/NewObject. You need to create another method that accepts those parameters and does whatever processing you need done.
>
>Here is an example of what I'm doing...
>
>
DEFINE CLASS ComSecurity AS SESSION OLEPUBLIC
>
>    cSQLServer = "TEST"
>    cDatabase = "TEST"
>
>    FUNCTION Init
       * parameters deleted because they don't work in COM
>      RETURN .T.
>    ENDFUNC
<

     FUNCTION SetProps
       LPARAMETERS tcSqlServer, tcDatabase
       This.cSqlServer = tcSqlServer
       This.cDatabase  = tcDatabase
     ENDFUNC

>ENDDEFINE
>
>I compile the code above into a COM MTDLL and from my command window execute the following code.
>osec = createobject('comsecurity.comsecurity',"X","Y")
>? oSec.cSqlServer
>Result: .F.
>? oSec.cDatabase
>Result: .F.
>
>What am I doing wroing?

See the bold text from my other response. Add something like the new function I added above to set those properties.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform