From: Henry on
I try to use an OLE Automation Client, and the OLE object is called
oDigora.
When running the method
oDigora:OpenPatient(.t., .t.)
I get the Error:
SubSystem: OLE Automation Client
Error Subcode: 2147614735
Function: OpenPatient.

The Method: OpenPatient looks like this:
METHOD OpenPatient(;
bBeginSearch,; // AS LOGIC
bCreateIfNotFound; // AS LOGIC
) CLASS IPatientServer

LOCAL oMethod AS cOleMethod
LOCAL uRetValue AS USUAL

oMethod := cOleMethod{}
oMethod:symName := String2Symbol("OpenPatient")
oMethod:iMemberid := 14
oMethod:wInvokeKind := INVOKE_METHOD
oMethod:nParams := 2
oMethod:lNamedArgs := TRUE
oMethod:cParamTypes := VTS_BOOL + VTS_BOOL
oMethod:bRetType := VT_I2

uRetValue := self:__Invoke(oMethod, DWORD(_bp+16),PCount())

RETURN (uRetValue)

and the error occurs in the line: uRetValue := self:__Invoke(oMethod,
dWord(_bp ....

Any idea what can cause the error?
Thanks
Henry

From: Henry on
I forgot to mentuin that the error is:
Parameter not optional

Thanks
Henry


From: Karl-Heinz on
Henry,

>I forgot to mentuin that the error is:
> Parameter not optional

And what do the docs say about the usage of this method ? Are there more
params required or not ?

BTW. For the lurkers: A good link to translate automation errors :
http://support.microsoft.com/kb/186063/en-us

regards
Karl-Heinz







From: Henry on
Karl-Heinz,

No, The method has 2 logical parameters.
I can't see that the method uses these parameters, not even on the
line where the error occurs.

Henry

From: Karl-Heinz on
Henry,

> No, The method has 2 logical parameters.

strange ....

1. Does any VB-Sample-Code available, show another usage of this method ?

2. What happens when you do not use the generated class, but use late
bound code instead ?

e.g.

o := OleAutoObject { "YourProgID" }
o:OpenPatient(.t., .t.)


regards
Karl-Heinz