Hello Fabio,
"Then "this" is not a COM object, and SYS(3095,this)
return 0."
That's the problem, i've compiled it as a COM object and also instantiated it like one (CREATEOBJECT('fullcomclass')). VFP refuses to interpret "THIS" as an COM object reference in SYS(3095).
"Why want you that an object knows the interface infos with which it is seen from out?"
It has to be a valid COM object not only from the client's point of view, but also from inside the object.
I currenty helping Adam @ Thread #
1071961, where we have to register a DCOM object as a file moniker.
To register the object as a file moniker i need it's IDispatch pointer (exactly i need it's IUnknown pointer but these are the same for VFP COM objects anyway)
so i've written code like this in my FLL:
char aCommand[2048];
sprintfex(aCommand,"INT(SYS(3095,%S))",HANDTOPTR(p1));
if (nErrorNo = EVALUATE(vUnk,aCommand))
goto ErrorOut;
pUnk = (IUnknown*)vUnk.ev_long;
....
the problem is i cannot code a self registering COM object since "THIS" doesn't work as a parameter to SYS(3095)
e.g.
DEFINE CLASS mySelfRegisteringObject AS Session OLEPUBLIC
nRotKey = 0
FUNCTION Init
SET PATH ...
SET LIBRARY TO vfp2c32.fll ADDITIVE
THIS.nRotKey = RegisterObjectAsFileMoniker('THIS', ;
'project.mySelfRegisteringObject', ;
'\\myServer\myShare\someFile')
ENDFUNC
FUNCTION Destroy
IF THIS.nRotKey != 0
RevokeActiveObject(THIS.nRotKey)
ENDIF
ENDFUNC
ENDDEFINE
Regards
Christian