void ORiffPlay::playWave(ORiffPlay::PlayType playType) { APIRET rc = 0; stop(); if (!waveFile) rc = ORiffPlay::mci_pr(NULLHANDLE, waveLibrary.getLibHandle(), waveType, waveID, playType, NULL, NULLHANDLE); else rc = ORiffPlay::mci_pf(NULLHANDLE, waveFile, playType, 0, 0); if (rc != 0) { OString Buffer(CCHMAXPATH); ORiffPlay::mci_err(rc, Buffer, CCHMAXPATH); throw OPMException(OMessage(252, OCL::MSGFILE, Buffer), rc, OException::recoverable); } }
OMessage OMessage::fromDataBuff(QByteArray *databuf,bool autoRemove) { if(!databuf) return OMessage(); OMessage msg; if(databuf->size()>=P_HEADLEN) { int len=QBtoint(databuf->mid(4,4)); if(databuf->size()>=len) { msg=OMessage(databuf->left(P_HEADLEN+len)); if(autoRemove) { databuf->remove(0,P_HEADLEN+len); } } } return msg; }
void OPMException::viewError() { OString err; PERRINFO pErrInfoBlk; PSZ pszOffset; CHAR ErrBuffer[512]; err << OMessage(190, OCL::MSGFILE); err + "\n"; err + OMessage(191, OCL::MSGFILE, Source); sprintf(ErrBuffer, "%d", Line); err + OMessage(192, OCL::MSGFILE, ErrBuffer); err + OMessage(193, OCL::MSGFILE, isOfType()); sprintf(ErrBuffer, "%d", rc); err + OMessage(194, OCL::MSGFILE, ErrBuffer); sprintf(ErrBuffer, "%d", WinGetLastError(OApp::current().anchor())); err + OMessage(197, OCL::MSGFILE, ErrBuffer); strcpy(ErrBuffer, ""); while((pErrInfoBlk = WinGetErrorInfo(OApp::current().anchor())) != (PERRINFO)NULL) { pszOffset = ((PSZ)pErrInfoBlk) + pErrInfoBlk->offaoffszMsg; strcat(ErrBuffer, (((PSZ)pErrInfoBlk) + *((PSHORT)pszOffset))); WinFreeErrorInfo(pErrInfoBlk); } err + OMessage(198, OCL::MSGFILE, ErrBuffer); if (!description) description << OMessage(190, OCL::MSGFILE); err + OMessage(195, OCL::MSGFILE, "\n", description); exMsg.error("Note!", err); }
OString& OCL::Version(OString& str) { OMessage copyright(OCL_COPYRIGHT, OCL::MSGFILE); #ifdef __BCPLUSPLUS__ OMessage compiler(OCL_BORLAND, OCL::MSGFILE); #elif __WATCOM_CPLUSPLUS__ OMessage compiler(OCL_WATCOM, OCL::MSGFILE); #elif ((__IBMCPP__) && (__IBMCPP__ == 300)) OMessage compiler(OCL_VA, OCL::MSGFILE); #elif __IBMCPP__ OMessage compiler(OCL_CSET, OCL::MSGFILE); #elif __HIGHC__ OMessage compiler(OCL_METAWARE, OCL::MSGFILE); #elif __EMX__ OMessage compiler(OCL_EMX, OCL::MSGFILE); #endif str << OMessage(OCL_VER_MSG, OCL::MSGFILE, compiler, copyright).getText(); return(str); }
void main(void) { Language l; try { l.selectLang().showDialog(); } catch(OPMException ex) { ex.viewError(); } catch(OVioException ex) { ex.description + "\n"; ex.description + OMessage(ex.rc); OMsgs().error(ex.description); } _exit(0); }
OString& OCL::apierror(ULONG x, APIRET rc) { OString apimessage(OMessage((ULONG)rc).getText()); return(OCL::transport << OMessage(x, OCL::MSGFILE, apimessage.getText()).getText()); }
OString& OCL::error(ULONG x) { return(OCL::transport << OMessage(x, OCL::MSGFILE).getText()); }