Encrypting Chinese Characters

Question: Why is it the return is blank when encrypting chinese characters? Here’s a snippet of my code: crypt.KeyLength := 256; crypt.SecretKey := Password; crypt.CryptAlgorithm := ‘aes’; crypt.EncodingMode := ‘base64’; OutPutStr := crypt.EncryptStringENC(StringToEncrypt); Answer: Strings in some programming languages such as Visual Basic, C#, VB.NET, Delphi, Foxpro, etc. should be thought of as objects.  The object contains a string (i.e. […]

ActiveX Events IDL for (some but not all) Chilkat Components

SFtp: dispinterface _IChilkatSFtpEvents { properties: methods: [id(1), helpstring(“method PercentDone”)] HRESULT PercentDone([in] long pctDone); [id(2), helpstring(“method AbortCheck”)] HRESULT AbortCheck([out] long *abort); [id(3), helpstring(“method UploadRate”)] HRESULT UploadRate([in] long byteCount, [in] long bytesPerSec); [id(4), helpstring(“method DownloadRate”)] HRESULT DownloadRate([in] long byteCount, [in] long bytesPerSec); }; Zip: dispinterface _IChilkatZip2Events { properties: methods: HRESULT UnzipPercentDone([in] long percentDone, [out] long *abort); HRESULT WriteZipPercentDone([in] long percentDone, [out] long […]

ActiveX Events in FoxPro

ActiveX components and controls are used in many programming languages, each of which has it’s own way of handling event callbacks.  This blog post provides helpful hints about how to receive event callbacks from an ActiveX component. To receive the event, you must bind the ActiveX (also referred to as the COM server) event to the implemented interface methods on […]

LastErrorText

The first step in debugging a Chilkat method that returns a failed status is to examine the contents of the LastErrorText property. The LastErrorText property will contain information about the last method call on the object. For example: success = mailman.SendEmail(email); textBox1.Text = mailman.LastErrorText; The LastErrorText property is standard on all Chilkat classes/objects.  The error information may also be accessed […]

Client-Side SSL/TLS Authentication

This blog post is here to clarify a very common misunderstanding. The various Chilkat components that provide SSL/TLS support also provide an option that allows a client-side digital certificate to be used with the secure connection. A certificate identifies you to the server. In 99% of cases you do not need a client certificate. It is usually not necessary for […]

How to Track Bounced Emails after Sending

Question: I am using Chilkat MailMan to send email (SMTP) in Visual Basic 6.0. I need to track the details of bounced mails, please let me know how to do this. Answer: (This answer applies not only to VB6, but to all programming languages because the Chilkat API is identical across programming languages.) Before calling mailman.SendEmail, set the email object’s […]

UI-less Self-Extracting EXE

The most common question regarding Chilkat self-extracting EXE’s is: How do I create a silent extractor that runs a “setup” program after extracting? Answer: Here is a sample command line that creates a silent self-extracting EXE: ChilkatZipSE -u unlockCode -a -sm -sp -nowait -r setup.exe -exe a.exe a.zip The “-r” option is used to specify the name of a setup […]

Inflate from Zip to memory in C++

This example demonstrates how to inflate in-memory from a Zip in C++: CkZip zip; … // Assume we have a CkZip object and a .zip has been loaded. // It may have been loaded from a file by calling OpenZip, or from an // in-memory image of a .zip by calling OpenFromMemory. // (or any of the other CkZip.Open* methods) […]

Updating an ActiveX DLL

Question: I have several of your programs installed on many machines. The problem is that some of these are older file DLL’s that need updating. What is the easiest way to update a DLL? If I run the .msi install, I just end up with two version of the DLL when I go into add/remove programs of the DLL. Any […]

Non-English String Literals in C++ Source Code

When a C++ compiler compiles a C++ source file, it must process the bytes according to a character encoding and that is typically ANSI.  ANSI is not a character encoding, it is simply a keyword that says “Use the default multi-byte character encoding for this computer based on its current locale.”   Therefore, if your program is originally written in Poland […]