>>>>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.
Thank you.