comparison src/video/windib/SDL_dibevents.c @ 421:195dd37b3d86

Bugfix from Corona688: don't reference a string before we've initialized it. Fixes crashbug on WinCE (PocketPC).
author Ryan C. Gordon <icculus@icculus.org>
date Tue, 02 Jul 2002 04:07:01 +0000
parents 13fc64213765
children a6fa62b1be09
comparison
equal deleted inserted replaced
420:93dcc7c0fafd 421:195dd37b3d86
333 333
334 int DIB_CreateWindow(_THIS) 334 int DIB_CreateWindow(_THIS)
335 { 335 {
336 #ifdef _WIN32_WCE 336 #ifdef _WIN32_WCE
337 /* WinCE uses the UNICODE version */ 337 /* WinCE uses the UNICODE version */
338 int nLen = strlen(SDL_Appname)+1; 338 int nLen;
339 LPWSTR lpszW = alloca(nLen*2); 339 LPWSTR lpszW;
340 MultiByteToWideChar(CP_ACP, 0, SDL_Appname, -1, lpszW, nLen); 340
341 341 if ( SDL_RegisterApp("SDL_app", 0, 0) != 0 ) {
342 SDL_RegisterApp("SDL_app", 0, 0); 342 return -1;
343 }
344
345 nLen = strlen(SDL_Appname) + 1;
346 lpszW = alloca(nLen * 2);
347
348 MultiByteToWideChar(CP_ACP, 0, "SDL_App", -1, lpszW, nLen);
349
343 SDL_Window = CreateWindow(lpszW, lpszW, WS_VISIBLE, 350 SDL_Window = CreateWindow(lpszW, lpszW, WS_VISIBLE,
344 0, 0, 0, 0, NULL, NULL, SDL_Instance, NULL); 351 0, 0, 0, 0, NULL, NULL, SDL_Instance, NULL);
345 if ( SDL_Window == NULL ) { 352 if ( SDL_Window == NULL ) {
346 SDL_SetError("Couldn't create window"); 353 SDL_SetError("Couldn't create window");
347 return(-1); 354 return(-1);