Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a third party DLL as a COM-Server in VFP ?

Status
Not open for further replies.

manfrid

Programmer
Dec 12, 2008
15
DE
I got a dll from a another softwareprogrammer(Delphi) to use it in my vfp6 program in order to get some data from his runnig Delphi-program.

I got the dll-File (ICertificate.dll) which I must register as a COM-Server.

and also this information:

DLL-Functions:
Dllname: DCertificate.dll
Interface: ICertificate
ProgID: "D.Certificate"

ICertificate:
Methods:
HRESULT_stdcall Find([in] BSTR bstrPIC,[out, retval] VARIANT_BOOL *pbResult);

Output: True or False


HRESULT_stdcall GetInfo([in] BSTR bstrID, [in] BSTR bstrTypeID, [out, retva] VARIANT_BOOL *pbResult);

FunctionsID: bstrTypeID
Input: bstrID
output: pbResult

can anybody help me to implement this DLL in my VFP6?
or tell me the way to find out
Thank you all

Manfred


 
A COM Server is instanciated by CREATEOBJECT(ProgID), so for this oCert = CREATEOBJECT("D.Certificate"), that is after you registered the DLL with regsrv32.

And after that you should be able to call the Find method
oCert.Find()

The parameters you pass in are a binary string. and you pass a seconds parameter by reference to get the output TRUE or FALSE, presumably you pass an numeric and get 0 or 1 instead of VFPs .T. and .F.

It's unclear whyt you should pass as the first parameter, but you may try a simple string variable or the same stringconverted by CREATEBINARY(string).

Bye, Olaf.
 
Manfred,

You say you want to "register" the COM server. If that's what you meant, you just have to run REGSVR32.EXE, passing the fully-qualified file name of the DLL. You have to do that on every system on which the program is to be run.

But if you meant you want to use the COM server within a VFP program, then Olaf has given you the answer.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 

Thank you Olaf,

that was exact the way you do it in vfp6,

run/n REGSVR32 DCertificate.dll
oCert = CREATEOBJECT("D.Certificate")
m_Var=oCert.Find("string")

I got the answer in m_Var back

I did not need to use CREATEBINARY(string)


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top