Here's my c++ code to install a conduit for plucker if it helps.  I'm using
the CDK4.02

Bill


err = CmSetCreatorPriority("Plkr", 2);
err = CmSetCreatorName("Plkr", "PluckerCond.dll");
err = CmSetCreatorDirectory("Plkr", "Plucker");
err = CmSetCreatorTitle("Plkr", "TP Mobile");
err= CmSetCreatorInfo("Plkr", "Conflict");
err = CmSetCreatorFile("Plkr", "TPMobile");

std::string lob_ini_file = "tpmobile.ini";
std::string lob_home_file = "tpmobile.html";
err = CmSetCreatorValueString("Plkr", "StartURL",
"http://world.towers.com/tpworld_rlob_retlob/palm/default.htm";);
lob_ini_file = "rlobmobile.ini";
err = CmSetCreatorRemote("Plkr", "TP Mobile DB");

char url[1024];
strcpy(url,
"http://world.towers.com/tpworld_rlob_retlob/palm/default.htm";);
err = CmSetCreatorValueString("Plkr", "StartURL", url);

err = CmSetCreatorValueDword("Plkr", "DefaultDepth", 2);

// copy dll file to correct location
char buffer[1024];
int size = 1024;
err = CmGetCorePath(buffer, &size);
char buffer2[1050];
strcpy(buffer2, buffer);
strcat(buffer2, "\\PluckerCond.dll");
BOOL err2 = CopyFile("PluckerCond.dll", buffer2, FALSE);
if (!err2)
     MessageBox(hDlg, "Could not copy PluckerCond.dll", "TP Mobile", 0);

short rootSize = 1024;
char rootDir[1024];
UmGetRootDirectory(rootDir, &rootSize);
int numUsers = UmGetUserCount();
unsigned long creatorID;
CmConvertStringToCreatorID("Plkr", &creatorID);
for (int i = 0; i < numUsers; i++) {
     unsigned long userID;
     UmGetUserID(i, &userID);

     short size = 1024;
     char userDir[1024];
     err = UmGetUserDirectory(userID, userDir, &size);

     UmSetUserPermSyncPreferences(userID, creatorID, PCToHH);
     UmSetUserTempSyncPreferences(userID, creatorID, PCToHH);

     char copyDir[1024];
     strcpy(copyDir, rootDir);
     strcat(copyDir, userDir);
     strcat(copyDir, "\\Plucker\\");
     err2 = CreateDirectory(copyDir, NULL);

     char copyFile[1024];
     strcpy(copyFile, copyDir);
     strcat(copyFile, "\\plucker.ini");
     err2 = CopyFile("plucker.ini", copyFile, FALSE);
     if (!err2)
          MessageBox(hDlg, "Could not copy ini file", "TP Mobile", 0);

     strcat(copyDir, "\\TPMobile\\");
     CreateDirectory(copyDir, NULL);

     strcpy(copyFile, copyDir);
     strcat(copyFile, "\\plucker.ini");
     if (!CopyFile(lob_ini_file.c_str(), copyFile, FALSE))
          MessageBox(hDlg, "Unable to copy lob ini file", "TP Mobile", 0);

     strcpy(copyFile, copyDir);
     strcat(copyFile, "\\home.html");
     if (!CopyFile(lob_home_file.c_str(), copyFile, FALSE))
          MessageBox(hDlg, "Unable to copy lob home file", "TP Mobile", 0);

     // need to install zlib.prc & tpmobile.prc
     char userName[1024];
     size = 1024;
     if (UmGetUserName(userID, userName, &size) == 0)
          MessageBox(hDlg, "Unable to get Palm user name", "TP Mobile", 0);
     else {
          PltInstallFile(userName, "TPMobile.prc");
          PltInstallFile(userName, "SysZLib.prc");
     }

}


Reply via email to