Problems with resource files

This is a discussion on Problems with resource files within the C++ Programming forums, part of the General Programming Boards category; I got the error when I tried compiling through VIDE. I got the same error before when I was compiling ...

  1. #16
    Unregistered
    Guest
    I got the error when I tried compiling through VIDE. I got the same error before when I was compiling with just the command line. With your exact code in fact.

  2. #17
    zoo
    Guest
    Here's what I've got. I only have two files. I am not using your header file (.h).

    example1.cpp
    d1.rc

    First I use brc32 to compile the resource: brc32 d1.rc
    Second, I run the following batch file z.bat by typing z at the command prompt:

    bcc32 -c -W example1.cpp
    ilink32/Tpe c0w32 example1.obj,example1.exe,,cw32.lib import32.lib,,d1.res

    Code:
    //Here is my example1.cpp:
    #include <windows.h> 
    #include <tchar.h> 
    
    BOOL CALLBACK MainDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
    
    int WINAPI WinMain( HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpszCmdLine,int nCmdShow ) { 
    
       DialogBoxParam(hInstance, "DIALOG1", NULL, (DLGPROC)MainDialogProc, 0);
       return 0;
    }
    
    BOOL CALLBACK MainDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
    {
       switch( uMsg ) {
          case WM_INITDIALOG:
             return TRUE;
          case WM_COMMAND:
             switch( wParam ) {
                //case IDOK:
                //   EndDialog( hDlg, TRUE );
                //   return TRUE;
                case 106:
                   EndDialog( hDlg, TRUE );
                   return TRUE;
                case 107:
                   EndDialog( hDlg, TRUE );
                   return TRUE;
                case IDCANCEL:
                   EndDialog( hDlg, TRUE );
                   return TRUE;
             }
          break;
       }
    
       return FALSE;
    }
    My d1.rc is the same as yours.
    Mine compiles and links to an .exe. When I run, a dialog box appears with two buttons. If it still doesn't work, try compiling a simple c++ program with a main(), and see if you can compile it.

  3. #18
    Unregistered
    Guest

    Arrow

    I still get the error in CW32.lib.

  4. #19
    Unregistered
    Guest
    Well, I think something's wrong with my version of cw32.lib. I tried cw32mt.lib and it worked just fine and I got the desired response. Thanks for your help. I'll get the cw32 file from somebody who has a different version. My guess is that in some windows corruption a couple bits got switched or something, I've had it happen in other places.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How do you work with resource files???
    By Finchie_88 in forum Windows Programming
    Replies: 4
    Last Post: 10-23-2004, 02:39 PM
  2. Replies: 6
    Last Post: 08-13-2003, 04:35 AM
  3. Problems openning huge files
    By acoelho74 in forum C Programming
    Replies: 4
    Last Post: 02-11-2003, 06:02 PM
  4. Resource Files
    By Unregistered in forum Windows Programming
    Replies: 11
    Last Post: 09-11-2001, 10:52 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21