Re: EuCOM : Attn Matt : String Return Value
- Posted by Rad <radhx at r?diff?ail.com> Oct 04, 2007
- 685 views
Hi Matt, allocate_string() and w32peek_string() gave the same results as before. Trying 2147614729 with peek_string() simply terminates the program. I tried out other string returning methods in the ocx which are:
-- file checksum OCString = invoke( OC6, {OneCryptA_m_FileChecksum}, {pBstrPathIn}, {VT_BSTR}, DISPATCH_METHOD ) void = message_box("Input File Checksum : " & OCString, "msg", MB_ICONINFORMATION) -- string checksum OCString = invoke( OC6, {OneCryptA_m_StringChecksum}, {pBstrAppId}, {VT_BSTR}, DISPATCH_METHOD ) void = message_box("AppID Checksum : " & OCString, "msg", MB_ICONINFORMATION)
and they worked fine returning string values as expected. The difference being these methods have only one parameter where as Encrypt method has 2 parameters.
-- encrypt string OCString = invoke( OC6, {OneCryptA_m_EncryptString}, {pBstrAppId, pBstr}, {VT_BSTR, VT_BSTR}, DISPATCH_METHOD )
Could this difference in number of parameters causing the error? Following is the discussion with the developer of 1Crypt ocx: ============================================================= Hi Rad, 1Crypt uses only VT_BSTR strings. These are Unicode strings with a maximum length of 2GB. 2147614729 decimal = 80020009 hex I'm wondering if this value could be a pointer to a string rather the string itself. I checked whether there is any difference between the strings returned by FileChecksum and StringChecksum, and those returned by EncryptString and DecryptString. They all return exactly the same kind of string, but it's possible that the compiler is handling the last two differently. I have an idea that in the first two cases, the string pointer returned is pointing to a string created in the virtual address space of the calling application, and in the other two cases it is in the virtual address space of the ocx. This is a pretty low-level difference, and I'm not certain that this is the case, but I've made a minor change to the code and recompiled, and I hope it will make a difference when calling it from Euphoria. The new ocx is attached. Please let me know how it goes. ======================================================= Unfortunately the revised ocx is giving the same result as previous one. Regards, Rad.