Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Interacting with a DLL COM (VC++)
Message
From
13/08/1999 22:07:30
 
 
To
13/08/1999 09:15:32
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00253364
Message ID:
00253714
Views:
42
This is a known problem. The error comes from the short params. VFP doesn't deal correctly with short COM params. At least this is the situation in 5.0. Maybe 6.0 fixed the problem but I haven't tested.

The only solution I know is to change the COM params to long. If it's a third party COM, call them and explain them your problem. Maybe they will accept to change it. BTW, there's really no gain from using short params. Long will do it just the same.

Vlad

>I´m working with a DLL COM (VC++) witch has 2 methods that give me problems.
>This is the definition of that methods in the dll (VC++ code):
>
>[id(1), helpstring("method Open")] HRESULT Open(BSTR xlName, [out] short* xlHandle);
>
>[id(7), helpstring("method Get")] HRESULT Get(short xlHandle, [out] VARIANT *xlValue, long xlRow, long xlCol, [out] BSTR *xlFont, [out] double *xlSize, [out] long *xlColor);
>
>From my VFP application I’m doing this:
>
>Obj = CreateObject(“Object”)
>
>Name=”c:\file”
>Handle=0
>Obj.Open( Name, @Handle ) ß I get a type mismatch (OLE error code 0x80020005: Type mismatch) (the parameter @HAndle is a short* in the dll).
>
>Value=space(20)
>Font=space(20)
>Size=0
>Color=0
>Obj.Get( Handle, @Value, 1, 1, @Font, @Size, @Color ) ß @Value (this parameter is a Variant* in the dll). I get the same error (OLE error code 0x80020005: Type mismatch).
>ß @Size (this parameter is a double* in the dll) the same error (OLE error code 0x80020005: Type mismatch)
>
>There’s no problem with long* and BSTR*.
>Any idea about working with short*, double*, and variant* of VC++ from a VFP application?
>Thanks.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform