Page 1 of 1
OleAutoObjectEx
Posted: Thu Mar 14, 2024 3:09 pm
by lagraf
Hallo,
ich habe eine Lib von VO nach X# übernommen. Darin ist eine Klasse definiert wie folgt:
USING SYSTEM
CLASS RKSVCOM INHERIT OLEAutoObjectEx
METHOD ...
Beim Compilieren bekomme ich den Fehler
error XS0246: The type or namespace name 'OLEAutoObjectEx' could not be found (are you missing a using directive or an assembly reference?)
Was muß ich einbinden, damit OleAutoObjectEx funktioniert?
LG Franz
Re: OleAutoObjectEx
Posted: Thu Mar 14, 2024 4:18 pm
by robert
Franz
I suggest you create the following code. I will add that to the runtime for the next build.
Code: Select all
class OleAutoObjectEx inherit OleAutoObject
constructor(cProgId as string)
super(cProgId)
constructor(cProgId as string)
super(cProgId)
constructor(cProgId as string, fRotCheck as logic)
super(cProgId, fRotcheck)
constructor(oObject as object)
super(oObject)
constructor(oObject as object, _type as System.Type)
super(oObject, _type)
end class
Robert
Re: OleAutoObjectEx
Posted: Fri Mar 15, 2024 8:11 am
by lagraf
Hi Robert,
I defined Class as you wrote, but now I get some compiler errors on Methods, e.g.:
error XS9042: Override of virtual method 'Equals' in child class has CLIPPER calling convention but overridden method in parent class is STRICT. 70,1 Class RKSVCOM.prg RKSVCOM:Equals
error XS0508: 'RKSVLibVO.RKSVCOM.Equals(params usual[])': return type must be 'logic' to match overridden member 'object.Equals(object)' 70,1 Class RKSVCOM.prg RKSVCOM:Equals
Code: Select all
METHOD Equals( obj; // AS USUAL ) // => Line 70
LOCAL oMethod AS cOleMethod
LOCAL uRetValue AS USUAL
LOCAL oMethod AS cOleMethod
LOCAL uRetValue AS USUAL
oMethod := cOleMethod{}
oMethod:symName := String2Symbol("Equals")
oMethod:iMemberid := 1610743809
oMethod:wInvokeKind := INVOKE_METHOD
oMethod:nParams := 1
oMethod:lNamedArgs := TRUE
oMethod:cParamTypes := VTS_VARIANT
oMethod:bRetType := VT_BOOL
uRetValue := SELF:__Invoke(oMethod, DWORD(_BP+16),PCount())
RETURN (uRetValue)
How do I have to define obj?
What type is the return of the __Invoke, can I set uRetValue to logic as XS0508 says?
Do I have to define an override method Equals() in missing OleAutoObjectEx class?
Regards, Franz