Sample code for 30+ languages & platforms
Unicode C

Transition from Cert.GetValidToDt to Cert.ValidToStr

Provides instructions for replacing deprecated GetValidToDt method calls with ValidToStr.

Chilkat Unicode C Downloads

Unicode C
#include <C_CkCertW.h>
#include <C_CkDateTimeW.h>

void ChilkatSample(void)
    {
    HCkCertW cert;
    HCkDateTimeW ckdt1;
    HCkDateTimeW ckdt2;

    cert = CkCertW_Create();

    //  ------------------------------------------------------------------------
    //  The GetValidToDt method is deprecated:

    ckdt1 = CkCertW_GetValidToDt(cert);
    if (CkCertW_getLastMethodSuccess(cert) == FALSE) {
        wprintf(L"%s\n",CkCertW_lastErrorText(cert));
        CkCertW_Dispose(cert);
        return;
    }

    //  ...
    //  ...

    CkDateTimeW_Dispose(ckdt1);

    //  ------------------------------------------------------------------------
    //  Do the equivalent using the ValidToStr property

    ckdt2 = CkDateTimeW_Create();
    CkDateTimeW_SetFromRfc822(ckdt2,CkCertW_validToStr(cert));


    CkCertW_Dispose(cert);
    CkDateTimeW_Dispose(ckdt2);

    }