Re: [Dev-C++] (no subject)andre_barros
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: Gerson L. <ja...@ya...> - 2005-01-05 17:00:24
|
Estimado Andre: Now that you show the code, I noticed I'm not actualized about resource files, but i can tell you this: 1) Since I use an old version of Dev (dev 4.0 and 4.01) i don know about makefiles, i don't use them, i just click the compile or the compile an run icon in my toolbar. May be there is the error, may be ther is a litle thing in that file. It looks fine to me but... 2) I never use IDC_STATIC, I put the plain ' -1 ' in there, because if I'm not wrong, that number is only used to identify the controls whithin a window or dialog box and be able to proccess the messages from 'em and send/post messages to them, so, if I dont want to process messages o send msg, ... 3) Here is an example of MY USAGE of the resource file, i've learned this an modifiing conform to my programming needs. I dont know pretty much about the sintax youre using, but i see it requires less typing ;) #include <windows.h> #include "IDs.h" TomaDatos DIALOG 0,0,270, 140 STYLE WS_VISIBLE | WS_POPUP | WS_CAPTION | DS_MODALFRAME CAPTION "Toma de Datos" FONT 8,"Courier" BEGIN CONTROL "Campos", -1, "BUTTON", WS_CHILD | WS_VISIBLE | BS_GROUPBOX, 5, 10, 205, 128 CONTROL "Aceptar", IDOK , "BUTTON", WS_CHILD | WS_VISIBLE , 215, 15, 50, 15 CONTROL "Cancelar", IDCANCEL, "BUTTON", WS_CHILD | WS_VISIBLE , 215, 35, 50, 15 END the IDs.h file is almost the same thing as your resource.h. If I do the same dialog box as you, I'll probably do something like this: ABOUTBOX DIALOG DISCARDABLE 32, 32, 180, 102 STYLE DS_MODALFRAME | WS_POPUP FONT 8, "MS Sans Serif" BEGIN CONTROL "OK",IDOK, "BUTTON", WS_CHILD | WS_VISIBLE, 66,81,50,14 /* ICON "ABOUT1", -1,7,7,21,20 // I won't touch this , i don't know about it */ ICON "ABOUT1",-1,7,7,21,20 // I won't touch this , i don't know about it CONTROL "About1", -1, "STATIC", WS_CHILD | WS_VISIBLE, 40,12,100,8 CONTROL "About Box Demo Program",-1, "STATIC" , WS_CHILD | WS_VISIBLE ,7,40,166,8 CONTROL "(c) Charles Petzold, 1998",-1, "STATIC" , WS_CHILD | WS_VISIBLE ,7,52,166,8 END It should be the same thing, exept than as I use the word "CONTROL" it is necesary to tell what kind of control you want, using EDIT, STATIC, LISTBOX, COMBOBOX, and so on... and it is necesary to explicitly choose the styles : WS_CHILD, WS_BORDER... things like that ... these are automatically set when you use CTEXT, DEFPUSHBUTTON and so on. Make the try and tell me what happens... I hope this to be useful PD: Excuse me if my english is not too good, my natural language is the spanish español, castellano, Hondureño :) Andre Macario Barros <ab...@cp...> wrote: ************ about1.rc ************************************ #include #include "resource.h" ABOUTBOX DIALOG DISCARDABLE 32, 32, 180, 102 STYLE DS_MODALFRAME | WS_POPUP FONT 8, "MS Sans Serif" BEGIN DEFPUSHBUTTON "OK",IDOK,66,81,50,14 /* ICON "ABOUT1",IDC_STATIC,7,7,21,20 */ ICON "ABOUT1",-1,7,7,21,20 CTEXT "About1",IDC_STATIC,40,12,100,8 CTEXT "About Box Demo Program",IDC_STATIC,7,40,166,8 CTEXT "(c) Charles Petzold, 1998",IDC_STATIC,7,52,166,8 END ABOUT1 MENU DISCARDABLE BEGIN POPUP "&Help" BEGIN MENUITEM "&About About1...", IDM_APP_ABOUT END END ABOUT1 ICON DISCARDABLE "about1.ico" GUIDELINES DESIGNINFO DISCARDABLE BEGIN "ABOUTBOX", DIALOG BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 173 TOPMARGIN, 7 BOTTOMMARGIN, 95 END END *************************************************************** ************** resource.h ******************************* #include #define IDM_APP_ABOUT 40001 ********************************************************* --------------------------------- |