Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SYS(3095,oObject) has a bug
Message
From
28/11/2005 14:15:51
 
 
To
28/11/2005 06:03:13
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01072326
Message ID:
01072560
Views:
30
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform