Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Making a call to DLL with variant parameters
Message
 
 
To
20/01/1999 13:42:30
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00178164
Message ID:
00178194
Views:
24
Bruce,

Try dropping the array on the VFP side, just use simple memvars. the [in] and [out] are just indicators of whether a parameter is for input (read access) or output (write access, which must be passed by reference)

inColNames = "STATE"
inColVals = "CA"
ReqColNames = "MaxFHAFamily1LoanAmt"
OutVals = space(255) && usually have to preallocate this buffer to something bigger than needed.

? o.TableLookup( "County", @inColNames, @inColVals, @ReqColNames )

>I am trying to call a registered DLL. I have successfully instantiated and called its initialization function.
>
>Now I am trying to call a function, TableLookUp, which as the following prototype:
>
>STDMETHODIMP TableLookup(BSTR TableName[in],
> VARIANT *LookupColumnNames[in],
> VARIANT *LookupColumnValues[in],
> VARIANT *RequestedColumnNames[in],
> VARIANT *RequestedColumnValues[out])
>
>Here is a snippet of my VFP code to call this:
>
>*START
>LOCAL inColNames[1], inColVals[1], ReqColNames[1] OutVals[1,2]
>inColNames[1] = "STATE"
>inColVals[1] = "CA"
>ReqColNames[1] = "MaxFHAFamily1LoanAmt"
>OutVals = ""
>
>OutVals = o.tablelookup("County", @inColNames, @inColVals, @ReqColNames)
>*END
>
>I am getting:
>
>OLE Error Code 0x8000040c: Unknown OLE status code.
>
>I have tried the following, with no luck:
>
>* appending CHR(0) to the end of all the strings
>* passing arrays by value as opposed to by reference
>* praying to the VFP gods
>
>;-)
>
>Any thoughts? My fear is that I can't properly pass a "variant" data construct from VFP. I really hope this isn't true, but...
>
>Any advice, thoughts, comments, flames, etc. appreciated (well, except for the flames, but I'll take what I can get!).
>
>Thanks,
>
>--Bruce
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform