SFTP OpenFile Succeeds, but ReadFileBytes Fails

SSH/SFTP servers are notoriously bad at providing any sort of useful information about the cause of a problem. This is one of those cases. It was discovered that for one particular server, if a remote file is opened (via the OpenFile method) using “readWrite” access, then the OpenFile succeeds, but a subsequent call to a method such as ReadFileBytes fails. […]

Passing Strings to COM/ActiveX in C++ Builder

In C++ Builder, when passing a string to an ActiveX (COM) function, a BSTR is required. This is different than a NULL-terminated WideString. The correct syntax looks like this: long lSuccess; BSTR bstr = SysAllocString(L”UnlockCode”); spChilkatMHT->UnlockComponent (bstr, &lSuccess); SysFreeString( bstr ); The following is incorrect because a NULL-terminated WideString is passed, and not a BSTR: // This code will probably […]

IMAP Authentication using OAUTH

Using the Chilkat IMAP component/library, it is possible to authenticate using OAUTH via the SendRawCommand method. Instead of calling the imap.Login method, you would instead call imap.SendRawCommand as shown here: string response = imap.SendRawCommand(“AUTHENTICATE XOAUTH <base64_data>”); Your application will need to compute the OAUTH base64 string. Chilkat does not implement that computations required for generating the OAUTH data.

Using regsvr32 to Register a 32-bit ActiveX or 64-bit ActiveX on Windows 64-bit System

A 64-bit Windows system has two separate registries — one for 32-bit processes, and one for 64-bit processes. The reason for this is simple: Let’s say your application instantiates an instance of an ActiveX component by calling CreateObject(“Chilkat.Ssh”). If your application is running in a 32-bit address space, the registry entries for “Chilkat.Ssh” should point to a 32-bit DLL in […]

Posting a status update to Twitter

ASP: HTTP POST Twitter Status Update SQL Server: HTTP POST Twitter Status Update C#: HTTP POST Twitter Status Update C++: HTTP POST Twitter Status Update MFC: HTTP POST Twitter Status Update C: HTTP POST Twitter Status Update Delphi: HTTP POST Twitter Status Update Visual FoxPro: HTTP POST Twitter Status Update Java: HTTP POST Twitter Status Update Perl: HTTP POST Twitter […]

SOCKS4 proxy server sometimes rejects FTP data connection?

The FTP Extended Passive Mode (EPSV) continues to be both a solution to problems AND the cause of problems. The Chilkat FTP2 component will automatically use EPSV (as opposed to PASV) if it detects the FTP server supports EPSV. This is generally a good thing to do, and often solves problems. However, occasionally it can be the cause of problems. […]

VC++ Link problem: fatal error C1047, “Chilkat*.lib’ was created with an older compiler than other objects; rebuild old objects and libraries”

Regarding the following VC++ link problem: “fatal error C1047: The object or library file ‘c:\Chilkat\libs\x64\ChilkatRel_x64.lib’ was created with an older compiler than other objects; rebuild old objects and libraries” This can be resolved by building without the /LTCG flag turned on. Unfortunately, it is not possible to use the /LTCG flag if you are using the Chilkat libraries. Compiling and […]