1
我想用orca api將我的powerbuilder項目部署到EAServer。但我gettiing錯誤-21 PBORCA_CBBUILDERROR(部署失敗,錯誤)。此外,回調函數(BuildErrProc)沒有被調用。我怎樣才能克服這個問題? BTW我正在使用WindowsXP-32bit,Powerbuilder 11.2,EAServer 5.5,QT-4.8.0開源vs2010。Powerbuilder ORCA API部署
void __stdcall BuildErrProc(LPVOID lpUserData) {
PPBORCA_BLDERR blderr = (PPBORCA_BLDERR)lpUserData;
QString s;
s = QString::fromStdWString(blderr->lpszMessageText);
QMessageBox::information(0,"",s);
}
int WINAPI BuildProject(QString currentApplLibName,QString currentApplName,QString projectLibName,QString projectName,QStringList libraryNames)
{
PBORCA_BLDPROC fpBuildErrProc;
PPBORCA_BLDERR pBldErrData;
fpBuildErrProc = (PBORCA_BLDPROC) BuildErrProc;
pBldErrData = (PPBORCA_BLDERR) new PBORCA_BLDERR;
memset(pBldErrData, 0x00, sizeof(PBORCA_BLDERR));
HPBORCA hORCASession;
hORCASession = SessionOpen();
printf("Setting library list..\n");
LPTSTR* pLibNames = new LPTSTR[libraryNames.size()];
for(int i=0;i<libraryNames.size();i++) {
pLibNames[i]=(LPTSTR)libraryNames.at(i).utf16();
}
int r = PBORCA_SessionSetLibraryList(hORCASession, pLibNames, libraryNames.size());
if(r==0) {
printf("Library list OK.\n");
QMessageBox::information(0,"",currentApplName);
r = PBORCA_SessionSetCurrentAppl(hORCASession,(LPTSTR)currentApplLibName.utf16(),(LPTSTR)currentApplName.utf16());
if(r==0) {
printf("Setting current appl OK.\n");
r = PBORCA_BuildProject(hORCASession,(LPTSTR)projectLibName.utf16(),(LPTSTR)projectName.utf16(),fpBuildErrProc,pBldErrData);
if (r==0) {
printf("Building current prj OK.\n");
} else {
printf("Build FAILURE:%d\n",r);
}
} else {
printf("Current appl FAILURE.\n");
}
} else {
printf("Library list FAILURE:%d\n",r);
}
SessionClose(hORCASession);
return r;
}
我解決了它。圖書館清單是錯誤的。當我設置正確的lib列表時,它成功地構建了項目。 – misa 2012-01-12 16:17:55
您可能想將其作爲下面的答案,以便您的問題顯示爲已回答。 – Slapout 2012-01-31 17:44:33