Changeset 74 for branches/v2.9_Lars/common_functions
- Timestamp:
- Sep 30, 2023, 11:06:42 PM (23 months ago)
- Location:
- branches/v2.9_Lars
- Files:
-
- 5 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/v2.9_Lars/common_functions/helper.c
r4 r74 19 19 /* 20 20 * If you need another license for your prject/product contact me at 21 * 21 * 22 22 * http://www.os2world.com/cdwriting 23 23 * http://www.geocities.com/SiliconValley/Sector/5785/ … … 40 40 //#define INSTALLDIR 1 41 41 42 #define INI_BGCLR_KEY "bg"43 #define INI_FGCLR_KEY "fg"44 #define INI_BTNBGCLR_KEY "btnbg"45 #define INI_BTNFGCLR_KEY "btnfg"46 #define INI_ACTIVETBBGCLR_KEY 47 #define INI_INACTIVETBBGCLR_KEY 48 #define INI_ACTIVETBFGCLR_KEY 49 #define INI_INACTIVETBFGCLR_KEY 42 #define INI_BGCLR_KEY (PSZ)"bg" 43 #define INI_FGCLR_KEY (PSZ)"fg" 44 #define INI_BTNBGCLR_KEY (PSZ)"btnbg" 45 #define INI_BTNFGCLR_KEY (PSZ)"btnfg" 46 #define INI_ACTIVETBBGCLR_KEY (PSZ)"activetbbg" 47 #define INI_INACTIVETBBGCLR_KEY (PSZ)"inactivetbbg" 48 #define INI_ACTIVETBFGCLR_KEY (PSZ)"activetbfg" 49 #define INI_INACTIVETBFGCLR_KEY (PSZ)"inactivetbfg" 50 50 51 51 /* The subdirectory in the installation directory where to put the log files */ … … 56 56 #define DEFRESDLLNAME "\\mmres_en.dll" 57 57 58 extern char*params[];58 extern PSZ params[]; 59 59 extern HMODULE RESSOURCEHANDLE; 60 60 extern char logName[]; … … 65 65 66 66 HMODULE _queryResModuleHandle2(char *installDir); 67 BOOL IniSaveData( char * iniFile, char* chrApp, char *chrKey, void*theData, ULONG ulSize);68 BOOL IniRestoreData( char * iniFile, char* chrApp, char *chrKey, void * theData, ULONG*ulMaxSize);69 void writeLog( char*logText);67 BOOL IniSaveData(PSZ iniFile, PSZ chrApp, PSZ chrKey, PVOID theData, ULONG ulSize); 68 BOOL IniRestoreData(PSZ iniFile, PSZ chrApp, PSZ chrKey, PVOID theData, PULONG ulMaxSize); 69 void writeLog(PSZ logText); 70 70 void HlpWriteToTrapLog(const char* chrFormat, ...); 71 71 … … 74 74 { 75 75 char logNameLocal[CCHMAXPATH]; 76 76 77 77 sprintf(logNameLocal,"%s\\%s\\%s",params[1],LOGFILE_SUBDIR,logName); 78 78 … … 88 88 } 89 89 90 void writeLog( char*logText)90 void writeLog(PSZ logText) 91 91 { 92 92 char logNameLocal[CCHMAXPATH]; … … 117 117 { 118 118 STARTDATA startData={0}; 119 APIRET rc;120 119 PID pid; 121 120 ULONG ulSessionID=0; 122 charchrLoadError[CCHMAXPATH];123 charstartParams[CCHMAXPATH*4];124 charexename[CCHMAXPATH]={0};125 charchrFolderPath[CCHMAXPATH+10];126 121 UCHAR chrLoadError[CCHMAXPATH]; 122 UCHAR startParams[CCHMAXPATH*4]; 123 UCHAR exename[CCHMAXPATH]={0}; 124 UCHAR chrFolderPath[CCHMAXPATH+10]; 125 127 126 memset(&startData,0,sizeof(startData)); 128 127 startData.Length=sizeof(startData); … … 131 130 startData.TraceOpt=SSF_TRACEOPT_NONE; 132 131 startData.PgmTitle=pszTitle; 133 132 134 133 /* sprintf(exename,"%s",buildWrapName(wrapperExe));*/ 135 sprintf( exename,"%s\\bin\\%s",params[1],wrapperExe);134 sprintf((PCHAR)exename,"%s\\bin\\%s",params[1],wrapperExe); 136 135 /* 137 136 if(!checkHelper(exename)) … … 151 150 152 151 /* Put the exe-path between " " to make sure, spaces are handled correctly */ 153 strcpy( chrFolderPath,folderPath);154 sprintf( startParams,"\"%s\" \"%s\" %s",155 chrInstallDir,chrFolderPath,parameter);152 strcpy((PCHAR)chrFolderPath,(PCHAR)folderPath); 153 sprintf((PCHAR)startParams,"\"%s\" \"%s\" %s", 154 (PCHAR)chrInstallDir,(PCHAR)chrFolderPath, (PCHAR)parameter); 156 155 startData.PgmInputs=startParams; 157 156 158 rc=DosStartSession(&startData,&ulSessionID,&pid);159 return 0; 160 } 161 162 163 BOOL IniRestoreWindowPos(char * iniFile, char* chrApp, char *chrKey, HWND hwnd)157 DosStartSession(&startData,&ulSessionID,&pid); 158 return 0; 159 } 160 161 162 BOOL IniRestoreWindowPos(char * iniFile, PSZ chrApp, PSZ chrKey, HWND hwnd) 164 163 { 165 164 HINI hini=0; … … 183 182 }/* end of if(!hini) */ 184 183 185 ulSize=sizeof(swp); 184 ulSize=sizeof(swp); 186 185 if(!PrfQueryProfileData(hini, chrApp, chrKey, &swp, &ulSize)) 187 186 bError=TRUE; … … 189 188 if(hini) 190 189 PrfCloseProfile(hini); 191 190 192 191 if(bError) 193 192 break; … … 199 198 } 200 199 201 BOOL IniSaveWindowPos( char * iniFile, char* chrApp, char *chrKey, HWND hwnd)200 BOOL IniSaveWindowPos(PSZ iniFile, PSZ chrApp, PSZ chrKey, HWND hwnd) 202 201 { 203 202 HINI hini=0; … … 206 205 207 206 /* Open ini-file */ 208 hini=PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP), (unsigned char *)iniFile);207 hini=PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP),iniFile); 209 208 do{ 210 209 … … 227 226 if(hini) 228 227 PrfCloseProfile(hini); 229 228 230 229 if(bError) 231 230 break; … … 235 234 } 236 235 237 BOOL IniSaveWindowClrs( char * chrIniFile, char*chrApp , HWND hwnd)236 BOOL IniSaveWindowClrs(PSZ chrIniFile, PSZ chrApp , HWND hwnd) 238 237 { 239 238 RGB rgb; … … 283 282 } 284 283 285 BOOL IniRestoreWindowClrs( char * chrIniFile, char*chrApp , HWND hwnd)284 BOOL IniRestoreWindowClrs(PSZ chrIniFile, PSZ chrApp , HWND hwnd) 286 285 { 287 286 RGB rgb; 288 287 ULONG ulSize; 289 288 290 289 ulSize=sizeof(RGB); 291 290 if(IniRestoreData(chrIniFile, chrApp, INI_BGCLR_KEY, &rgb, &ulSize)) … … 295 294 PP_BACKGROUNDCOLOR,(ULONG)sizeof(rgb), &rgb); 296 295 } 297 ulSize=sizeof(RGB); 296 ulSize=sizeof(RGB); 298 297 if(IniRestoreData(chrIniFile, chrApp, INI_FGCLR_KEY, &rgb, &ulSize)) 299 298 { … … 306 305 if(IniRestoreData(chrIniFile, chrApp, INI_ACTIVETBBGCLR_KEY, &rgb, &ulSize)) 307 306 { 308 307 309 308 WinSetPresParam(WinWindowFromID(hwnd, FID_TITLEBAR), 310 309 PP_ACTIVECOLOR,(ULONG)sizeof(rgb), &rgb); … … 324 323 if(IniRestoreData(chrIniFile, chrApp, INI_ACTIVETBFGCLR_KEY, &rgb, &ulSize)) 325 324 { 326 325 327 326 // WinSetPresParam(WinWindowFromID(hwnd, FID_TITLEBAR), 328 327 // PP_ACTIVECOLOR,(ULONG)sizeof(rgb), &rgb); … … 341 340 } 342 341 343 BOOL IniSaveInt( char * iniFile, char* chrApp, char *chrKey, int theInt)342 BOOL IniSaveInt(PSZ iniFile, PSZ chrApp, PSZ chrKey, int theInt) 344 343 { 345 344 HINI hini=0; 346 345 BOOL bError=FALSE; 347 charchrIntString[50];346 UCHAR chrIntString[50]; 348 347 349 348 /* Open ini-file */ … … 363 362 }/* end of if(!hini) */ 364 363 365 sprintf( chrIntString, "%d", theInt);364 sprintf((PCHAR)chrIntString, "%d", theInt); 366 365 if(!PrfWriteProfileString(hini, chrApp, chrKey, chrIntString)) 367 366 bError=TRUE; … … 369 368 if(hini) 370 369 PrfCloseProfile(hini); 371 370 372 371 if(bError) 373 372 break; … … 377 376 } 378 377 379 BOOL IniSaveData( char * iniFile, char* chrApp, char *chrKey, void*theData, ULONG ulSize)378 BOOL IniSaveData(PSZ iniFile, PSZ chrApp, PSZ chrKey, PVOID theData, ULONG ulSize) 380 379 { 381 380 HINI hini=0; … … 383 382 384 383 /* Open ini-file */ 385 hini=PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP), (unsigned char *)iniFile);384 hini=PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP),iniFile); 386 385 do{ 387 386 … … 403 402 if(hini) 404 403 PrfCloseProfile(hini); 405 404 406 405 if(bError) 407 406 break; … … 411 410 } 412 411 413 BOOL IniRestoreData( char * iniFile, char* chrApp, char *chrKey, void * theData, ULONG*ulMaxSize)412 BOOL IniRestoreData(PSZ iniFile, PSZ chrApp, PSZ chrKey, PVOID theData, PULONG ulMaxSize) 414 413 { 415 414 HINI hini=0; … … 417 416 418 417 /* Open ini-file */ 419 hini=PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP), (unsigned char *)iniFile);418 hini=PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP),iniFile); 420 419 do{ 421 420 … … 433 432 434 433 bError=PrfQueryProfileData(hini, chrApp, chrKey, theData, ulMaxSize); 435 434 436 435 if(hini) 437 436 PrfCloseProfile(hini); 438 437 439 438 return bError; 440 439 } while(TRUE); … … 443 442 444 443 445 int IniRestoreInt( char * iniFile, char* chrApp, char *chrKey, int defaultInt)444 int IniRestoreInt(PSZ iniFile, PSZ chrApp, PSZ chrKey, int defaultInt) 446 445 { 447 446 HINI hini=0; … … 449 448 450 449 /* Open ini-file */ 451 hini=PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP), (unsigned char *)iniFile);450 hini=PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP),iniFile); 452 451 do{ 453 452 … … 465 464 466 465 theInt=PrfQueryProfileInt(hini, chrApp, chrKey, defaultInt); 467 466 468 467 if(hini) 469 468 PrfCloseProfile(hini); 470 469 471 470 return theInt; 472 471 } while(TRUE); … … 475 474 476 475 477 BOOL readIni2(char * installDir) 478 { 479 HWND hwnd; 480 481 hwnd=HWND_DESKTOP; 476 BOOL readIni2(PSZ installDir) 477 { 482 478 #if 0 483 479 strncpy(chrInstallDir, installDir,sizeof(chrInstallDir)); 484 480 /* Build full path for cdrecord.ini file */ 485 sprintf(profileName,"%s\\cdrecord.ini", installDir); 481 sprintf(profileName,"%s\\cdrecord.ini", installDir); 486 482 /* Insert message in Logfile */ 487 483 writeLog("Reading values from "); … … 490 486 491 487 /* Open ini-file */ 492 hini=PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP), (unsigned char *)profileName);488 hini=PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP),profileName); 493 489 do{ 494 490 if(!hini) { … … 522 518 { 523 519 /* Build full path for cdrecord.ini file */ 524 snprintf(chrBuffer, iBufferSize, "%s\\cdrecord.ini", chrInstallDir); 520 snprintf(chrBuffer, iBufferSize, "%s\\cdrecord.ini", chrInstallDir); 525 521 chrBuffer[iBufferSize-1]=0; /* Always terminate with zero */ 526 522 } … … 529 525 HINI HlpOpenIni() 530 526 { 531 charprofileName[CCHMAXPATH];527 UCHAR profileName[CCHMAXPATH]; 532 528 533 529 /* Build full path for cdrecord.ini file */ … … 535 531 536 532 /* Open ini-file */ 537 return PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP), (unsigned char *)profileName);533 return PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP),profileName); 538 534 } 539 535 … … 568 564 BOOL HlpBuildMMProgIniFileName(char* chrProgname, char * chrBuffer, ULONG ulBufferSize) 569 565 { 570 char * chrPtr; 566 char * chrPtr; 571 567 572 568 /* Default is INI file in users home dir */ … … 591 587 #if 0 592 588 /* This function returns the module handle of our ressource dll */ 593 HMODULE queryResModuleHandle( char *chrExePath)589 HMODULE queryResModuleHandle(PSZ chrExePath) 594 590 { 595 591 COUNTRYCODE country= {0}; 596 592 COUNTRYINFO countryInfo= {0}; 597 char path[CCHMAXPATH];598 charbuf[CCHMAXPATH];599 char*found;593 UCHAR path[CCHMAXPATH]; 594 UCHAR buf[CCHMAXPATH]; 595 PUCHAR found; 600 596 APIRET rc; 601 597 ULONG ulInfoLen; 602 598 603 599 if(!RESSOURCEHANDLE) { 604 600 605 601 //writeLog("Trying to load ressource DLL.\n"); 606 602 607 /* Get the country code of our system and load the 603 /* Get the country code of our system and load the 608 604 resource DLL with the right language */ 609 605 do { … … 632 628 /* Insert message in Logfile */ 633 629 // writeLog("Ressource-DLL for the current countrycode not found. Trying to load default one (CDFLD001.DLL).\n"); 634 630 635 631 /* NLS DLL not found. Try to load default */ 636 632 found=strrchr(path,'\\'); … … 644 640 //HlpWriteToTrapLog(path); 645 641 //HlpWriteToTrapLog("\n"); 646 642 647 643 648 644 rc=DosLoadModule(buf,sizeof(buf),path, &RESSOURCEHANDLE); … … 662 658 663 659 /* This function returns the module handle of our ressource dll */ 664 HMODULE queryResModuleHandle( char *chrExePath)665 { 666 char path[CCHMAXPATH];667 charbuf[CCHMAXPATH];668 char*found;660 HMODULE queryResModuleHandle(PSZ chrExePath) 661 { 662 UCHAR path[CCHMAXPATH]; 663 UCHAR buf[CCHMAXPATH]; 664 PCHAR found; 669 665 APIRET rc; 670 666 671 667 if(!RESSOURCEHANDLE) { 672 668 673 669 //writeLog("Trying to load ressource DLL.\n"); 674 675 /* Get the language code of our system and load the 670 671 /* Get the language code of our system and load the 676 672 resource DLL with the right language */ 677 do 673 do 678 674 { 679 static charchrLang[]="en_EN";680 PSZ pszLang= "";681 char *chrPtr;682 675 static UCHAR chrLang[]="en_EN"; 676 PSZ pszLang=NULL; 677 PUCHAR chrPtr; 678 683 679 /* Get Language var */ 684 if(NO_ERROR!=DosScanEnv( "LANG", &pszLang)) {680 if(NO_ERROR!=DosScanEnv((PSZ)"LANG", &pszLang)) { 685 681 pszLang=chrLang; 686 } 682 } 687 683 /* Skip leading spaces */ 688 684 chrPtr=pszLang; 689 685 while(*chrPtr==' ') 690 686 chrPtr++; 691 687 692 688 /* Check if value seems to be valid. The var must be something like xx_XX thus length is 5 */ 693 if(strlen( chrPtr)<5)689 if(strlen((PCHAR)chrPtr)<5) 694 690 break; 695 696 sprintf( path,"%s", chrExePath);691 692 sprintf((PCHAR)path,"%s", chrExePath); 697 693 // SysWriteToTrapLog(path); 698 if((found=strrchr( path, '\\'))!=NULLHANDLE)694 if((found=strrchr((PCHAR)path, '\\'))!=NULLHANDLE) 699 695 *found=0; 700 696 701 /* Extract the first two chars */ 702 sprintf( buf, RESDLLNAME, chrPtr[0], chrPtr[1]);703 strcat( path,buf);697 /* Extract the first two chars */ 698 sprintf((PCHAR)buf, RESDLLNAME, chrPtr[0], chrPtr[1]); 699 strcat((PCHAR)path,(const PCHAR)buf); 704 700 /* Insert message in Logfile */ 705 701 // SysWriteToTrapLog("Using the following DLL path: %s\n", path); 706 702 707 703 rc=DosLoadModule(buf,sizeof(buf),path, &RESSOURCEHANDLE); 708 704 if(rc==NO_ERROR) 709 705 break; 710 706 711 707 /* Insert message in Logfile */ 712 708 SysWriteToTrapLog("Ressource-DLL for the current country not found. Trying to load default one.\n"); 713 709 714 710 /* NLS DLL not found. Try to load default */ 715 found=strrchr( path,'\\');711 found=strrchr((PCHAR)path,(int)'\\'); 716 712 if(!found) 717 713 break; 718 714 719 715 *found=0; 720 sprintf( buf, DEFRESDLLNAME);721 strcat( path,buf);716 sprintf((PCHAR)buf, DEFRESDLLNAME); 717 strcat((PCHAR)path,(const PCHAR)buf); 722 718 //HlpWriteToTrapLog("Using the following DLL path: "); 723 719 //HlpWriteToTrapLog(path); 724 720 //HlpWriteToTrapLog("\n"); 725 726 721 722 727 723 rc=DosLoadModule(buf,sizeof(buf),path, &RESSOURCEHANDLE); 728 724 if(rc!=NO_ERROR) { … … 745 741 } 746 742 747 void HlpSendCommandToObject( char* chrObject, char*command)743 void HlpSendCommandToObject(PSZ chrObject, PSZ command) 748 744 { 749 745 HOBJECT hObject; 750 charchrCommand[CCHMAXPATH];746 UCHAR chrCommand[CCHMAXPATH]; 751 747 752 748 hObject=WinQueryObject(chrObject); 753 sprintf( chrCommand,"Querying object pointer for: %s\n", chrObject);749 sprintf((PCHAR)chrCommand,"Querying object pointer for: %s\n", chrObject); 754 750 writeLog(chrCommand); 755 751 if(hObject!=NULLHANDLE) { 756 strcpy( chrCommand,command);752 strcpy((PCHAR)chrCommand,(const PCHAR)command); 757 753 WinSetObjectData(hObject,chrCommand); 758 writeLog( "Sending command to object: ");754 writeLog((PSZ)"Sending command to object: "); 759 755 writeLog(command); 760 writeLog( "\n");756 writeLog((PSZ)"\n"); 761 757 } 762 758 else { 763 sprintf( chrCommand,"Can't query object pointer for: %s\n", chrObject);759 sprintf((PCHAR)chrCommand,"Can't query object pointer for: %s\n", chrObject); 764 760 writeLog(chrCommand); 765 761 } 766 762 } 767 763 768 -
branches/v2.9_Lars/common_functions/img_funcs.c
r4 r74 1 1 /* 2 This file conatins functions for loading image files. 2 This file conatins functions for loading image files. 3 3 */ 4 4 … … 64 64 SIZEL ImageSize; 65 65 ULONG dwHeight, dwWidth; 66 SHORT 66 SHORT wBitCount; 67 67 FOURCC fccStorageSystem; 68 68 ULONG dwPadBytes; 69 69 ULONG dwRowBits; 70 70 ULONG ulReturnCode; 71 ULONG dwReturnCode;72 HBITMAP hbReturnCode;73 LONG lReturnCode;74 71 FOURCC fccIOProc; 75 72 HDC hdc; … … 129 126 130 127 131 dwReturnCode = mmioQueryHeaderLength ( hmmio,128 ulReturnCode = mmioQueryHeaderLength ( hmmio, 132 129 (PLONG)&ulImageHeaderLength, 133 130 0L, … … 203 200 return(0L); 204 201 } 205 202 206 203 /* 207 204 // *************************************************** … … 226 223 (ULONG) MB_OK | MB_MOVEABLE | 227 224 MB_ERROR ); 228 #endif 225 #endif 229 226 DevCloseDC(hdc); 230 227 DosFreeMem(pRowBuffer); … … 265 262 Select the bitmap into the memory device context. 266 263 ***************************************************/ 267 hbReturnCode = GpiSetBitmap ( hps,264 ulReturnCode = GpiSetBitmap ( hps, 268 265 hbm ); 269 266 /*************************************************************** … … 285 282 * it to work. Perhaps will get to it when time is available... 286 283 */ 287 lReturnCode = GpiSetBitmapBits ( hps,284 ulReturnCode = GpiSetBitmapBits ( hps, 288 285 (LONG) dwRowCount, 289 286 (LONG) 1, … … 293 290 294 291 /* Clean up */ 295 hbReturnCode = GpiSetBitmap ( hps,292 ulReturnCode = GpiSetBitmap ( hps, 296 293 NULLHANDLE ); 297 294 ulReturnCode = mmioClose (hmmio, 0L); … … 368 365 ULONG ulReturnCode; 369 366 ULONG ulBytesRead; 370 367 371 368 /* Check file size */ 372 369 if(SysQueryFileSize(pszFileName)==0) 373 370 return FALSE; /* File is empty at the moment, so return without reading. */ 374 371 375 372 ulReturnCode = mmioIdentifyFile ( pszFileName, 376 373 0L, … … 436 433 &mmioinfo, 437 434 MMIO_READ | MMIO_DENYWRITE | MMIO_NOIDENTIFY ); 438 435 439 436 if ( ! hmmio ) 440 437 { -
branches/v2.9_Lars/common_functions/ini_funcs.c
r4 r74 55 55 if(hiniPriv && !hini) 56 56 PrfCloseProfile(hiniPriv); 57 57 58 58 if(bError) 59 59 break; … … 103 103 }/* end of if(!hini) */ 104 104 105 ulSize=sizeof(swp); 105 ulSize=sizeof(swp); 106 106 if(!PrfQueryProfileData(hiniPriv, chrApp, chrKey, &swp, &ulSize)) 107 107 bError=TRUE; … … 109 109 if(hiniPriv && !hini) 110 110 PrfCloseProfile(hiniPriv); 111 111 112 112 if(bError) 113 113 break; … … 166 166 if(hiniPriv && !hini) 167 167 PrfCloseProfile(hiniPriv); 168 168 169 169 if(bError) 170 170 break; … … 214 214 ulRC=PrfQueryProfileString(hiniPriv, chrApp, chrKey, chrDefault, chrBuffer, ulSize); 215 215 216 if(hiniPriv && !hini) 217 PrfCloseProfile(hiniPriv); 218 219 216 if(hiniPriv && !hini) { 217 PrfCloseProfile(hiniPriv); 218 } 219 break; 220 220 } while(TRUE); 221 221 return ulRC; -
branches/v2.9_Lars/common_functions/makefile
r53 r74 4 4 5 5 CC = gcc 6 LIB_DIR = U:/usr/lib6 LIB_DIR = D:/usr/lib 7 7 #CPPFLAGS = -Ge- /Gm+ -G4 -Gl /O+ -Oc+ -Ol 8 8 CPPFLAGS = -O -Zomf -Zcrtdll -s 9 9 INC = ../include 10 DEFS = 11 PROGS = 10 DEFS = 11 PROGS = 12 12 ODIR = . 13 13 CPPDIR = . -
branches/v2.9_Lars/common_functions/message.c
r4 r74 10 10 { 11 11 WinMessageBox(HWND_DESKTOP,0, 12 "The resource DLL which contains all the dialogs, graphics and messages cannot be loaded. \13 Please check your installation.",14 "Problem with class installation",12345,12 (PSZ)"The resource DLL which contains all the dialogs, graphics and messages cannot be loaded. \ 13 Please check your installation.", 14 (PSZ)"Problem with class installation",12345, 15 15 MB_OK|MB_MOVEABLE|MB_ERROR); 16 16 } … … 23 23 At least I suspect this happens on system where the MM classes don't work. 24 24 Instead there's a new function errorResourceVerbose() which may be called when we 25 know, the WPS is up and running. 25 know, the WPS is up and running. 26 26 */ 27 27 WinMessageBox(HWND_DESKTOP,0, … … 51 51 /* */ 52 52 /*!!*************************************************/ 53 ULONG messageBox( char*text, ULONG ulTextID , LONG lSizeText,54 char*title, ULONG ulTitleID, LONG lSizeTitle,53 ULONG messageBox( PSZ text, ULONG ulTextID , LONG lSizeText, 54 PSZ title, ULONG ulTitleID, LONG lSizeTitle, 55 55 HMODULE hResource, HWND hwnd, ULONG ulFlags) 56 56 { … … 67 67 } 68 68 69 static ULONG mBox( char*text, ULONG ulTextID , LONG lSizeText,70 char*title, ULONG ulTitleID, LONG lSizeTitle,69 static ULONG mBox( PSZ text, ULONG ulTextID , LONG lSizeText, 70 PSZ title, ULONG ulTitleID, LONG lSizeTitle, 71 71 HMODULE hResource, HWND hwnd, ULONG ulFlags) 72 72 { … … 183 183 ULONG MsgShowMessageBox(HWND hwnd, ULONG ulIDTitle, ULONG ulIDText, HMODULE hModule, ULONG ulFlag) 184 184 { 185 char*pText;186 char*pTitle;185 PSZ pText; 186 PSZ pTitle; 187 187 ULONG rc; 188 188 … … 223 223 /* */ 224 224 /*!!*************************************************/ 225 BOOL getMessage( char*text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd)225 BOOL getMessage(PSZ text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd) 226 226 { 227 227 if(!WinLoadString(WinQueryAnchorBlock(hwnd),hResource,ulID,lSizeText,text)) { 228 strcpy( text,"");228 strcpy((PCHAR)text,""); 229 229 return FALSE; 230 230 } … … 250 250 /* */ 251 251 /*!!**********************************************************/ 252 BOOL MsgGetMessage( char*text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd)252 BOOL MsgGetMessage(PSZ text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd) 253 253 { 254 254 return getMessage( text, ulID, lSizeText, hResource, hwnd); … … 258 258 { 259 259 WinMessageBox(HWND_DESKTOP,0, 260 "This helper shouldn't be started by hand. It is called by the multimedia classes. \261 If you didn't launch the helper by hand you may have found a bug. Please contact the author.",262 "Problem with multimedia classes",12345,260 (PSZ)"This helper shouldn't be started by hand. It is called by the multimedia classes. \ 261 If you didn't launch the helper by hand you may have found a bug. Please contact the author.", 262 (PSZ)"Problem with multimedia classes",12345, 263 263 MB_OK|MB_MOVEABLE|MB_ERROR); 264 264
Note:
See TracChangeset
for help on using the changeset viewer.