OleAutoObjectEx

Deutschsprachiges X#-Forum – German language forum

Moderator: wriedmann

Post Reply
lagraf
Posts: 450
Joined: Thu Jan 18, 2018 9:03 am
Location: A

OleAutoObjectEx

Post 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
User avatar
robert
Posts: 4540
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: OleAutoObjectEx

Post 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
XSharp Development Team
The Netherlands
robert@xsharp.eu
lagraf
Posts: 450
Joined: Thu Jan 18, 2018 9:03 am
Location: A

Re: OleAutoObjectEx

Post 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
Post Reply