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

"Cannot find entrypoint ... in the DLL" error 1

Status
Not open for further replies.

mkrausnick

Programmer
Apr 2, 2002
766
US
I am trying to implement PGP encryption in VFP7 to generate and email encrypted reports. I am using NSDPGP, a shareware com wrapper for PGP on Windows 2000. NSDPGP2 is written in VC++ and the doc comes with usage examples in WSH, ASP, Visual Basic and Visual C++, and states it also works with Delphi and Java.
I have registered the DLL using Regsvr32, and I can view NSDPGP32 in VFP's object browser. Here is a copy/paste from the VFP7 object browser:
Code:
Method GetKeyIDFromUserID(pubkeyring As String, privkeyring As String, userid As String) As String
Member of NSDPGP2Lib (cached).PGP
Defined in interface IPGP
Obtain the KeyID of a key from its UserID
Here is the VFP code I run:
Code:
DECLARE String GetKeyIDFromUserID IN nsdpgp2.dll String PublicRingFile , String PrivateRingFile , String UserID 
cPublicPGPKeyRing  = "C:\Documents and Settings\...\PGP\pubring.pkr"
cPrivatePGPKeyRing = "C:\Documents and Settings\...\PGP\secring.skr"
cUserName          = &quot;<myusername>&quot;
? GetKeyIDFromUserID( cPublicPGPKeyRing,cPrivatePGPKeyRing,cUserName )
The error message indicates VFP can't find the GetKeyIDFromUserID in the DLL.

What am I doing wrong?


Mike Krausnick
Dublin, California
 
If it's COM, you don't use DECLARE DLL, but you use CREATEOBJECT to get a reference to it.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports&quot;
 
Perfect! Thanks.

For others who want to do this, the code that works is:
Code:
oPGP=CreateObject(&quot;NSDPGP2Lib.PGP&quot;)
? oPGP.GetKeyIDFromUserID( cPublicPGPKeyRing,cPrivatePGPKeyRing,cUserName )



Mike Krausnick
Dublin, California
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top