I'm having problems trying to use the Windows Crypto API on a COM Server. I've built a MTL dll (basically copied the code from
www.feldstein.net/CodeCryptoArticle.htm) using the VFP _crypto wrapper class. If I install the .dll on the COM server and register it manually via the cmd line, it works fine if I call the class from VFP development on the same machine. However if I install it as a COM application via the Component Services Manager and then call it from the same machine, the COM application starts and the icon spins, however the only thing returned from the method is false.
Here's an excerp of code that is returning .F.
PROCEDURE encrypt(tcString AS String,;
tcPassword AS String) AS Character
LOCAL lcEncryptedString AS String
IF NOT THIS.oCrypto.encryptsessionstreamstring(tcString, tcPassWord, @lcEncryptedString )
lcEncryptedString = .F.
ENDIF
RETURN lcEncryptedString
If I call the encryptsessionstreamstring() method within the _cryptapi class directly from VFP it works fine. It's rather difficult to debug since it works fine in development mode, only when It's running as a COM application do I get this problem.
Thanks,
Kurt