Thank you all for the suggestions about CfgConduit. 

I used the exact same CfgConduit function in AddCont provided with CDK3.0.
The function was called this time, but it still crashed. I got the same
error message as when I used ConfigureConduit. The error message is as
follows:
        "Debug Assertion Failed!
        Program: C:\PALM\HOTSYNC.EXE
        File: dbgheap.c
        Line: 1050
        Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)"

I don't know the reason. Does it have anything to do with MFC 6.0? All the
samples are using MFC 5.0. Thanks.

__declspec(dllexport) long CfgConduit(ConduitCfgEnum cfgType, void *pArgs,
DWORD *pdwArgsSize) {

    AFX_MANAGE_STATE(AfxGetStaticModuleState());
    long nRtn = -1;
    TCHAR szName[256];
    DWORD dwNamesize;
    CHotSyncActionDlg actDlg;
    ConduitRequestInfoType infoStruct;
    CfgConduitInfoType *pCfgInfo;

    dwNamesize = sizeof(szName);

    if (!pArgs)
        return CONDERR_INVALID_INARGS_PTR;
    if (!pdwArgsSize)
        return CONDERR_INVALID_ARGSSIZE_PTR;
    if (*pdwArgsSize != SZ_CFGCONDUITINFO) 
        return CONDERR_INVALID_ARGSSIZE;

    if (cfgType != eConfig1)
            return CONDERR_UNSUPPORTED_CFGCONDUIT_ENUM;

    pCfgInfo = (CfgConduitInfoType *)pArgs;
    if (pCfgInfo->dwVersion != CFGCONDUITINFO_VERSION_1)
        return CONDERR_UNSUPPORTED_STRUCT_VERSION;


    infoStruct.dwVersion = CONDUITREQUESTINFO_VERSION_1;
    infoStruct.dwSize = SZ_CONDUITREQUESTINFO;
    infoStruct.dwCreatorId = pCfgInfo->dwCreatorId;
    infoStruct.dwUserId = pCfgInfo->dwUserId;
    strcpy(infoStruct.szUser, pCfgInfo->szUser);
    nRtn = GetConduitInfo(eConduitName, (void *)&infoStruct, (void *)szName,
&dwNamesize);
    if (nRtn)
        return nRtn;

    actDlg.m_csGroupText = szName;

    switch (pCfgInfo->syncTemporary){
        case eFast:
        case eSlow:
            actDlg.m_nActionIndex = 0;
            break;
        case ePCtoHH:
            actDlg.m_nActionIndex = 1;
            break;
        case eHHtoPC:
            actDlg.m_nActionIndex = 2;
            break;
        case eDoNothing:
        default:
            actDlg.m_nActionIndex = 3;
            break;
    }

    nRtn = -1;
    if (actDlg.DoModal() == IDOK){

        switch (actDlg.m_nActionIndex) {
            case 0:
                pCfgInfo->syncNew = eFast;
                break;
            case 1:
                pCfgInfo->syncNew = ePCtoHH;
                break;
            case 2:
                pCfgInfo->syncNew = eHHtoPC;
                break;
            case 3:
            default:
                pCfgInfo->syncNew = eDoNothing;
                break;
        }

        pCfgInfo->syncPref = (actDlg.m_bMakeDefault) ? ePermanentPreference
: eTemporaryPreference;

        nRtn = 0;
    }

    return nRtn;
}

> -----Original Message-----
> From: Jason Dawes [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, April 18, 2000 1:43 PM
> To:   Palm Developer Forum
> Subject:      RE: ConfigureConduit crash
> 
> At 03:18 PM 4/18/00 -0700, you wrote:
> >I tried CfgConduit. Nothing happened when I chose my conduit name and
> >clicked Change in Cutom menu. A change action dialog box suppose to show
> up.
> >I think CfgConduit didn't get called for some reason.
> >
> >Here is the code stub if someone would help me figure out what's wrong.
> >Thanks.
> >
> >_declspec(dllexport) long CfgConduit(CSyncPreference& pref) {
> 
> You're right, it's not being called.  Mainly because the prototype is
> supposed to be:
> 
> extern "C" long COND_API CfgConduit(ConduitCfgEnum cfgType, void *pArgs,
> DWORD *pdwArgsSize)
> 
> You can add the _declspec(dllexport) if you want (or maybe COND_API does
> that, I forget).
> 
> 
> 
> -- 
> For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palm.com/devzone/mailinglists.html

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to