Changeset 104 for trunk/classes/c/c_common/helper.c
- Timestamp:
- Oct 2, 2023, 11:34:35 PM (23 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to
/branches/v2.9 merged eligible /branches/v2.9_Lars merged eligible
-
Property svn:mergeinfo
set to
-
trunk/classes/c/c_common/helper.c
r57 r104 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/ 24 24 */ 25 #define INCL_BASE 25 26 #define INCL_WIN 26 27 #define INCL_DOS … … 41 42 42 43 #ifndef BS_NOTEBOOKBUTTON 43 #define BS_NOTEBOOKBUTTON 8L /* Warp 4 notebook style */ 44 #define BS_NOTEBOOKBUTTON 8L /* Warp 4 notebook style */ 44 45 #endif 45 46 … … 66 67 67 68 68 memset(&pDetails, 0, sizeof(pDetails)); 69 memset(&pDetails, 0, sizeof(pDetails)); 69 70 pDetails.Length = sizeof(PROGDETAILS); 70 71 pDetails.progt.progc = PROG_DEFAULT; … … 81 82 } 82 83 pDetails.pszExecutable = wrapperExe; 83 84 84 85 pDetails.pszEnvironment = NULLHANDLE; 85 86 pDetails.swpInitial.fl = SWP_ACTIVATE|SWP_ZORDER; /* window positioning */ … … 92 93 // pDetails.swpInitial.ulReserved1 = 0; 93 94 // pDetails.swpInitial.ulReserved2 = 0; 94 95 95 96 /* Create an object window which will process the WM_APPTERMINATE message. While processing of this 96 97 message the view item (see below) will be removed from the inuse list thus removing the inuse emphasis. */ … … 150 151 if(!hModule) 151 152 { 152 153 153 154 if(queryModuleHandle()) 154 155 { … … 170 171 if(NO_ERROR!=DosScanEnv("LANG", &pszLang)) 171 172 break; 172 173 173 174 /* Skip leading spaces */ 174 175 chrPtr=pszLang; 175 176 while(*chrPtr==' ') 176 177 chrPtr++; 177 178 178 179 /* Check if value seems to be valid. The var must be something like xx_XX thus length is 5 */ 179 180 if(strlen(chrPtr)<5) 180 181 break; 181 182 /* Extract the first two chars */ 182 183 /* Extract the first two chars */ 183 184 sprintf(buf, RESDLLNAME, chrPtr[0], chrPtr[1]); 184 185 strcat(resDLLPath,buf); … … 187 188 // HlpWriteToTrapLog(resDLLPath); 188 189 // HlpWriteToTrapLog("\n"); 189 190 190 191 rc=DosLoadModule(buf,sizeof(buf), resDLLPath, &hModule); 191 192 if(rc==NO_ERROR) 192 193 break; 193 194 194 195 /* Insert message in Logfile */ 195 196 // writeLog("Ressource-DLL for the current countrycode not found. Trying to load default one (CDFLD001.DLL).\n"); 196 197 197 198 /* NLS DLL not found. Try to load default */ 198 199 found=strrchr(resDLLPath,'\\'); 199 200 if(!found) 200 201 break; 201 202 202 203 *found=0; 203 204 … … 206 207 // HlpWriteToTrapLog(resDLLPath); 207 208 // HlpWriteToTrapLog("\n"); 208 209 209 210 rc=DosLoadModule(buf,sizeof(buf), resDLLPath, &hModule); 210 211 if(rc!=NO_ERROR) { … … 215 216 //writeLog("Ressource DLL loaded.\n"); 216 217 } 217 218 218 219 break; 219 220 }while(TRUE); … … 223 224 } 224 225 225 /*APIRET APIENTRY DosQueryModFromEIP( HMODULE *phMod,226 ULONG *pObjNum,227 ULONG BuffLen,228 PCHAR pBuff,229 ULONG *pOffset,230 PVOID Address );*/231 232 226 /* Get the HMODULE of the MM class DLL */ 233 227 HMODULE queryModuleHandle(void) … … 242 236 ULONG ulObj, ulBufLen, ulOffset; 243 237 char thePath[CCHMAXPATH]; 244 238 245 239 if(DosQueryModFromEIP( &hModule, 246 240 &ulObj, … … 248 242 thePath, 249 243 &ulOffset, 250 ( PVOID)queryModuleHandle )!=NO_ERROR) {244 (ULONG)queryModuleHandle )!=NO_ERROR) { 251 245 SysWriteToTrapLog("Can't get module handle for CWMM class DLL!\n"); 252 246 hModule=0; … … 291 285 strncpy(classDLLPath,moduleName, sizeof(classDLLPath)); 292 286 classDLLPath[sizeof(classDLLPath)-1]=0; 293 287 294 288 /* Get install dir */ 295 289 strncpy(chrInstallDir,moduleName, sizeof(chrInstallDir)); … … 303 297 strncpy(classDLLPath,chrInstallDir, sizeof(classDLLPath)); 304 298 classDLLPath[sizeof(classDLLPath)-1]=0; 305 299 306 300 /* Get install dir */ 307 301 if((chrPtr=strrchr(chrInstallDir,'\\'))!=NULLHANDLE) … … 352 346 HENUM henum; 353 347 HWND hwnd; 354 348 355 349 /* Move the default notebook buttons */ 356 350 if((henum=WinBeginEnumWindows(hwndDlg))!=NULLHANDLE) { … … 396 390 { 397 391 snprintf(setup, sizeof(setup), "LOCATOR=%s;%s", chrUrl, "OPEN=DEFAULT"); 398 WinCreateObject("WPUrl","tempUrl", setup, tempDir, 392 WinCreateObject("WPUrl","tempUrl", setup, tempDir, 399 393 CO_UPDATEIFEXISTS); 400 394 /* WinDestroyObject(hObject); Don't use it, blocks PM */ … … 402 396 } 403 397 404 /* This function checks if the given file exists */ 398 /* This function checks if the given file exists */ 405 399 ULONG checkFileSize(char* chrFileName) 406 400 { … … 410 404 if(stat(chrFileName , &statBuf)==-1) 411 405 return 0; 412 406 413 407 return statBuf.st_size; 414 408 }
Note:
See TracChangeset
for help on using the changeset viewer.