I cannot get the dialog box to pop up for anything. I have implemented both
functions and even tried each without the other. My code with CfgConduit is
below (and you can see it is taken from the samples) with my comments in it
of what happens when I step through the code. It seems to me that CDialog or
CBaseDialog or CHotSyncActionDlg isn't instantiating for some reason. The
CHotSyncActionDlg actDlg is at address 0x0 and the DoModal returns a
negative 1 which means it could not create window. Which stands to reason if
I have no dialog object instantiated. Why doesn't it? It happens in the
ConfigureConduit in the same way. See below (My comments are in parans and I
did little indenting so that there would be less wrapping)
Thanks,
Daniel A. Schultz
Symmetry Software, Inc.
mailto:[EMAIL PROTECTED]
ExportFunc long CfgConduit( ConduitCfgEnum cfgType, void *pArgs, DWORD
*pdwArgsSize)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
long nRtn = -1;
TCHAR szName[256];
DWORD dwNamesize;
CHotSyncActionDlg actDlg(CWnd::GetActiveWindow()); (Debug window shows this
at address 0)
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); (Name comes back just find)
if (nRtn)
return nRtn;
actDlg.m_csGroupText = szName; (In debug I get an access violation in
release it just skips this portion)
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){ //(Returns a -1 - could not create
window)
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;
}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/