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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW CAN I INVOQUE A DLL

Status
Not open for further replies.

FernandoCalisto

Programmer
Nov 16, 2010
3
PT
I have a DLL in .NET (Rsasoft.dll) that I want to execute in VFP9.

The code below perform this message:
"Cannot find entry point ASSINADOC in DLL"

Code:
cP1 = 'aaaaa'
cP2 = 'bbbbb'
DECLARE STRING AssinaDoc IN Rsasoft.dll ;
        STRING param1, ;
        STRING param2
cResult1 = AssinaDoc(cP1,cP2)

The DLL Rsasoft.dll is already registrated.

Thanks for any help




 
As you registered the dll you mostz probably have created it with COM interop, then you can use it in VFP via oDLL = CreateObject("OLE Class Name") and use it's method oDLL.AssinaDoc(...), DECLARE only works for functional DLLs, not assemblies.

Bye, Olaf.
 
Hi,
Thanks for yours replies.

Above a test DLL and his code in VB6 and the message it returns:
test DLL: Softcasus1.dll registered:
“REGSVR32 C:\WINDOWS\system32\SOFTCASUS1.DLL”

The code to invoke in VB6 is that:
*------------------------------------
Dim ss As ClassSoftcasus
Set ss = New ClassSoftcasus
Dim aa As String

aa = ss.teste(“a”,”b”)
*----------------------------------------

The VB6 code of the SOFTCASUS1.DLL:
*-------------------------------------------------------
Function teste(ss1 As String, ss2 As String) As String
teste = ss1 + ss2
End Function
*-------------------------------------------------------
The files of the VB6 project are: MSSCCPRJ.SCC; SoftCasus.vbw; SoftCasus1.lib; SoftCasus1.exp; SoftCasus1.DLL; Softcasus.vbp; ClassSoftCasus.cls

Code in VFP:
*-----------------------------------------------
ss = CREATEOBJECT("SOFTCASUS1.ClassSoftcasus")
aa = ss.teste(“a”,”b”)
*-----------------------------------------------

It return the error N.º 1733
"class definition SOFTCASUS1.CLASSSOFTCASUS not exist"

Calisto
 
Hi,

With this code it works:
Code:
ss = CREATEOBJECT("SOFTCASUS.ClassSoftcasus") 
aa =  ss.teste(“a”,”b”)
The name in registry is "softcasus.classSoftcasus" and not "softcasus1.classSoftcasus"

Thank you very much for all your help

Calisto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top