Thread: [Dev-C++] NEED HELP ASAP WITH RESOURCE SCRIPTING AND USE OF IDE TO DEVELOP PROJECTS
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Akua A. <ek...@sb...> - 2007-06-11 06:13:30
|
Hello, Does anyone know how to create resource script files and link these to source programs? I created a Resource (.rc) file using WinAPI. I then created a header file and my c-source code. I put my header file, which contained definitions into the header region of my .rc file. I also put the header file in my c-source code file. Next, I pressed compile and tried to link all of it together. However, I got an error, it said that the resource file could not be found. It opened up a separate file which actually contained no information at all. Can someone with experience usin the DEV C++ IDE teach me how to create a project with these component files? Thanks. dev...@li... wrote: Send Dev-cpp-users mailing list submissions to dev...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/dev-cpp-users or, via email, send a message with subject or body 'help' to dev...@li... You can reach the person managing the list at dev...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of Dev-cpp-users digest..." Today's Topics: 1. What is wrong (Jan Mura) 2. Re: What is wrong (Per Westermark) 3. Re: What is wrong (Jan Mura) 4. Formula question (Philip Bennefall) 5. Re: Formula question (Jonathan Winterflood) 6. Re: Formula question (Per Westermark) 7. Re: Formula question (Per Westermark) 8. Linked list (Jan Mura) ---------------------------------------------------------------------- Message: 1 Date: Wed, 6 Jun 2007 19:08:24 +0200 From: "Jan Mura" Subject: [Dev-C++] What is wrong To: Message-ID: <000701c7a85d$4c763a70$e6e218ac@TERASUS2> Content-Type: text/plain; charset="iso-8859-2" Hello, I would like to ask what is wrong on the following: ... int *i; *i = 1; printf ("%d", *i); ... As I read in Brian W. Kernighan, Denis M. Ritchie it should work. But anyway in my program it prints nothing. If I delete the line *i = 1; it works properly. I am on XP Professional with Dev-Cpp. Thanks Jan Mura jan...@vo... ------------------------------ Message: 2 Date: Wed, 6 Jun 2007 19:13:43 +0200 (CEST) From: Per Westermark Subject: Re: [Dev-C++] What is wrong To: Jan Mura Cc: dev...@li... Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII i is a pointer, i'e an address to a separate memory for storing the integer value. You must first assign an address to i, before you may assign an integer to the memory area pointed to by i. int main() { int *i; i = (int*)malloc(sizeof(int)); *i = 1; printf("%d\n",*i); free(i); // release the memory allocated with the malloc() call. return 0; } /pwm On Wed, 6 Jun 2007, Jan Mura wrote: > Hello, > > I would like to ask what is wrong on the following: > > ... > int *i; > *i = 1; > printf ("%d", *i); > > ... > > As I read in > Brian W. Kernighan, Denis M. Ritchie it should work. > > But anyway in my program it prints nothing. > > If I delete the line > > *i = 1; > > it works properly. > > > > I am on XP Professional with Dev-Cpp. > > > > Thanks > > > > Jan Mura > > jan...@vo... > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > ------------------------------ Message: 3 Date: Thu, 7 Jun 2007 08:39:45 +0200 From: "Jan Mura" Subject: Re: [Dev-C++] What is wrong To: Message-ID: <001401c7a8ce$a48a12b0$720c18ac@TERASUS2> Content-Type: text/plain; charset="iso-8859-2" Well, of course. Maybe I am a little bit out of order because of dealing with C and its pointers now quite intensively. Thank you anyway Jan Mura ----- Original Message ----- From: "Per Westermark" To: "Jan Mura" Cc: Sent: Wednesday, June 06, 2007 7:13 PM Subject: Re: [Dev-C++] What is wrong > i is a pointer, i'e an address to a separate memory for storing the > integer value. > > You must first assign an address to i, before you may assign an integer to > the memory area pointed to by i. > > int main() { > int *i; > i = (int*)malloc(sizeof(int)); > *i = 1; > printf("%d\n",*i); > free(i); // release the memory allocated with the malloc() call. > return 0; > } > > /pwm > > On Wed, 6 Jun 2007, Jan Mura wrote: > > > Hello, > > > > I would like to ask what is wrong on the following: > > > > ... > > int *i; > > *i = 1; > > printf ("%d", *i); > > > > ... > > > > As I read in > > Brian W. Kernighan, Denis M. Ritchie it should work. > > > > But anyway in my program it prints nothing. > > > > If I delete the line > > > > *i = 1; > > > > it works properly. > > > > > > > > I am on XP Professional with Dev-Cpp. > > > > > > > > Thanks > > > > > > > > Jan Mura > > > > jan...@vo... > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 express and take > > control of your XML. No limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > __________ Informace od NOD32 2313 (20070606) __________ > > Tato zprava byla proverena antivirovym systemem NOD32. > http://www.nod32.cz > > ------------------------------ Message: 4 Date: Thu, 7 Jun 2007 18:03:30 +0200 From: "Philip Bennefall" Subject: [Dev-C++] Formula question To: Message-ID: <008b01c7a91d$64efc790$4800a8c0@Pbgames> Content-Type: text/plain; charset="iso-8859-1" Hi, Could anyone tell me the formula which is used to calculate the min and max values for a numerical data type of x bytes? Say for instance that I use the sizeof(datatype) function and get the answer 4, which is usually an integer, how do I then programatically calculate the min and max values for a signed and unsigned version of the data type respectively. Thanks in advance. Regards Philip Bennefall -------------- next part -------------- An HTML attachment was scrubbed... ------------------------------ Message: 5 Date: Thu, 7 Jun 2007 18:55:32 +0200 From: "Jonathan Winterflood" Subject: Re: [Dev-C++] Formula question To: "Philip Bennefall" Cc: dev...@li... Message-ID: Content-Type: text/plain; charset="iso-8859-1" On 6/7/07, Philip Bennefall wrote: > > Hi, > Could anyone tell me the formula which is used to calculate the min and > max values for a numerical data type of x bytes? Say for instance that I use > the > sizeof(datatype) function and get the answer 4, which is usually an > integer, how do I then programatically calculate the min and max values for > a signed > and unsigned version of the data type respectively. > Thanks in advance. > Regards > Philip Bennefall > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > Hi, Usually there are constants defined for this use, which might be more useful. However, this is how to calculate the values, supposing the encoding for negative number is 2's complement (machines that don't use this are rather rare, I believe, and won't be running windows...) Also supposing your data type is some kind of binary integer (floats and double are encoded differently) nb_bytes = sizeof(...) nb_bits = 8*nb_bytes max_unsigned = 2^nb_bits - 1 min_unsigned = 0 //no kidding ! max_signed = 2^(nb_bits-1) - 1 min_unsigned = -( 2^(nb_bits-1) ) Jonathan -- linux, c'est une question de VI ou de MORE -------------- next part -------------- An HTML attachment was scrubbed... ------------------------------ Message: 6 Date: Thu, 7 Jun 2007 19:09:10 +0200 (CEST) From: Per Westermark Subject: Re: [Dev-C++] Formula question To: Philip Bennefall Cc: dev...@li... Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII There are no formula for that. This is the normal way of doing it in C (available in the standard header files) #define MAX(a,b) ((a) >= (b) ? (a) : (b)) #define MIN(a,b) ((a) <= (b) ? (a) : (b)) Note that the above two constructs have problems if the parameters have side effects, i.e. for something like: max = MAX(*a++,*b--); For c++, there is a algorithm std::max() available in the standard template library. /pwm On Thu, 7 Jun 2007, Philip Bennefall wrote: > Hi, > Could anyone tell me the formula which is used to calculate the min and max values for a numerical data type of x bytes? Say for instance that I use the > sizeof(datatype) function and get the answer 4, which is usually an integer, how do I then programatically calculate the min and max values for a signed > and unsigned version of the data type respectively. > > Thanks in advance. > > Regards > Philip Bennefall ------------------------------ Message: 7 Date: Thu, 7 Jun 2007 19:10:58 +0200 (CEST) From: Per Westermark Subject: Re: [Dev-C++] Formula question To: Philip Bennefall Cc: dev...@li... Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII Oops, missed the meaning of your question. Look at the file - it contains a lot of defines for numeric ranges for different data types (char, short, int, long, ...) /pwm On Thu, 7 Jun 2007, Philip Bennefall wrote: > Hi, > Could anyone tell me the formula which is used to calculate the min and max values for a numerical data type of x bytes? Say for instance that I use the > sizeof(datatype) function and get the answer 4, which is usually an integer, how do I then programatically calculate the min and max values for a signed > and unsigned version of the data type respectively. > > Thanks in advance. > > Regards > Philip Bennefall ------------------------------ Message: 8 Date: Fri, 8 Jun 2007 16:46:05 +0200 From: "Jan Mura" Subject: [Dev-C++] Linked list To: Message-ID: <000601c7a9db$bff90b10$8ce118ac@TERASUS2> Content-Type: text/plain; charset="iso-8859-2" Hello, I would like to ask about some things in linked list I try to write. It looks like: struct s { int id; char *name; struct s *next; }; int main () { struct s *front = NULL; /*the front of a list */ int i = 1; char *name; while (1) { gets (name); if (strlen(name) == 0) break; in_list (&front, i, name); i++; } return 0; } void in_list (struct s **q, int in_id, const char *in_name) { struct s*member, *temp; member = malloc (sizeof (struct s)); member -> name = malloc (strlen (in_name) +1); member-> id = in_id; strcpy (member -> name, in_name); member -> next = NULL; /* it will be the last member in the list */ if (q == NULL) /* empty list */ { q = member; q -> next = NULL; } else { temp = q; temp -> next = q -> next; while (temp -> next != NULL) temp = temp -> next; /* looking for the last member in the list */ temp ->next = member; /* the last member is no more the last one */ } } Should I allocate the space for temp and temp -> next when I am putting an adress from member to temp? So should it looks like: temp = malloc ...; temp = member; ??? Thanks for your answer. Jan Mura jan...@vo... ------------------------------ ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ------------------------------ _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users End of Dev-cpp-users Digest, Vol 13, Issue 2 ******************************************** |
|
From: Akua A. <ek...@sb...> - 2007-06-11 07:43:39
|
Hello, Does anyone know how to create resource script files and link these to source programs? I created a Resource (.rc) file using WinAPI. I then created a header file and my c-source code. I put my header file, which contained definitions into the header region of my .rc file. I also put the header file in my c-source code file. Next, I pressed compile and tried to link all of it together. However, I got an error, it said that the resource file could not be found. It opened up a separate file which actually contained no information at all. Can someone with experience usin the DEV C++ IDE teach me how to create a project with these component files? Thanks. dev...@li... wrote: Send Dev-cpp-users mailing list submissions to dev...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/dev-cpp-users or, via email, send a message with subject or body 'help' to dev...@li... You can reach the person managing the list at dev...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of Dev-cpp-users digest..." Today's Topics: 1. What is wrong (Jan Mura) 2. Re: What is wrong (Per Westermark) 3. Re: What is wrong (Jan Mura) 4. Formula question (Philip Bennefall) 5. Re: Formula question (Jonathan Winterflood) 6. Re: Formula question (Per Westermark) 7. Re: Formula question (Per Westermark) 8. Linked list (Jan Mura) ---------------------------------------------------------------------- Message: 1 Date: Wed, 6 Jun 2007 19:08:24 +0200 From: "Jan Mura" Subject: [Dev-C++] What is wrong To: Message-ID: <000701c7a85d$4c763a70$e6e218ac@TERASUS2> Content-Type: text/plain; charset="iso-8859-2" Hello, I would like to ask what is wrong on the following: ... int *i; *i = 1; printf ("%d", *i); ... As I read in Brian W. Kernighan, Denis M. Ritchie it should work. But anyway in my program it prints nothing. If I delete the line *i = 1; it works properly. I am on XP Professional with Dev-Cpp. Thanks Jan Mura jan...@vo... ------------------------------ Message: 2 Date: Wed, 6 Jun 2007 19:13:43 +0200 (CEST) From: Per Westermark Subject: Re: [Dev-C++] What is wrong To: Jan Mura Cc: dev...@li... Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII i is a pointer, i'e an address to a separate memory for storing the integer value. You must first assign an address to i, before you may assign an integer to the memory area pointed to by i. int main() { int *i; i = (int*)malloc(sizeof(int)); *i = 1; printf("%d\n",*i); free(i); // release the memory allocated with the malloc() call. return 0; } /pwm On Wed, 6 Jun 2007, Jan Mura wrote: > Hello, > > I would like to ask what is wrong on the following: > > ... > int *i; > *i = 1; > printf ("%d", *i); > > ... > > As I read in > Brian W. Kernighan, Denis M. Ritchie it should work. > > But anyway in my program it prints nothing. > > If I delete the line > > *i = 1; > > it works properly. > > > > I am on XP Professional with Dev-Cpp. > > > > Thanks > > > > Jan Mura > > jan...@vo... > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > ------------------------------ Message: 3 Date: Thu, 7 Jun 2007 08:39:45 +0200 From: "Jan Mura" Subject: Re: [Dev-C++] What is wrong To: Message-ID: <001401c7a8ce$a48a12b0$720c18ac@TERASUS2> Content-Type: text/plain; charset="iso-8859-2" Well, of course. Maybe I am a little bit out of order because of dealing with C and its pointers now quite intensively. Thank you anyway Jan Mura ----- Original Message ----- From: "Per Westermark" To: "Jan Mura" Cc: Sent: Wednesday, June 06, 2007 7:13 PM Subject: Re: [Dev-C++] What is wrong > i is a pointer, i'e an address to a separate memory for storing the > integer value. > > You must first assign an address to i, before you may assign an integer to > the memory area pointed to by i. > > int main() { > int *i; > i = (int*)malloc(sizeof(int)); > *i = 1; > printf("%d\n",*i); > free(i); // release the memory allocated with the malloc() call. > return 0; > } > > /pwm > > On Wed, 6 Jun 2007, Jan Mura wrote: > > > Hello, > > > > I would like to ask what is wrong on the following: > > > > ... > > int *i; > > *i = 1; > > printf ("%d", *i); > > > > ... > > > > As I read in > > Brian W. Kernighan, Denis M. Ritchie it should work. > > > > But anyway in my program it prints nothing. > > > > If I delete the line > > > > *i = 1; > > > > it works properly. > > > > > > > > I am on XP Professional with Dev-Cpp. > > > > > > > > Thanks > > > > > > > > Jan Mura > > > > jan...@vo... > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 express and take > > control of your XML. No limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > __________ Informace od NOD32 2313 (20070606) __________ > > Tato zprava byla proverena antivirovym systemem NOD32. > http://www.nod32.cz > > ------------------------------ Message: 4 Date: Thu, 7 Jun 2007 18:03:30 +0200 From: "Philip Bennefall" Subject: [Dev-C++] Formula question To: Message-ID: <008b01c7a91d$64efc790$4800a8c0@Pbgames> Content-Type: text/plain; charset="iso-8859-1" Hi, Could anyone tell me the formula which is used to calculate the min and max values for a numerical data type of x bytes? Say for instance that I use the sizeof(datatype) function and get the answer 4, which is usually an integer, how do I then programatically calculate the min and max values for a signed and unsigned version of the data type respectively. Thanks in advance. Regards Philip Bennefall -------------- next part -------------- An HTML attachment was scrubbed... ------------------------------ Message: 5 Date: Thu, 7 Jun 2007 18:55:32 +0200 From: "Jonathan Winterflood" Subject: Re: [Dev-C++] Formula question To: "Philip Bennefall" Cc: dev...@li... Message-ID: Content-Type: text/plain; charset="iso-8859-1" On 6/7/07, Philip Bennefall wrote: > > Hi, > Could anyone tell me the formula which is used to calculate the min and > max values for a numerical data type of x bytes? Say for instance that I use > the > sizeof(datatype) function and get the answer 4, which is usually an > integer, how do I then programatically calculate the min and max values for > a signed > and unsigned version of the data type respectively. > Thanks in advance. > Regards > Philip Bennefall > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > Hi, Usually there are constants defined for this use, which might be more useful. However, this is how to calculate the values, supposing the encoding for negative number is 2's complement (machines that don't use this are rather rare, I believe, and won't be running windows...) Also supposing your data type is some kind of binary integer (floats and double are encoded differently) nb_bytes = sizeof(...) nb_bits = 8*nb_bytes max_unsigned = 2^nb_bits - 1 min_unsigned = 0 //no kidding ! max_signed = 2^(nb_bits-1) - 1 min_unsigned = -( 2^(nb_bits-1) ) Jonathan -- linux, c'est une question de VI ou de MORE -------------- next part -------------- An HTML attachment was scrubbed... ------------------------------ Message: 6 Date: Thu, 7 Jun 2007 19:09:10 +0200 (CEST) From: Per Westermark Subject: Re: [Dev-C++] Formula question To: Philip Bennefall Cc: dev...@li... Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII There are no formula for that. This is the normal way of doing it in C (available in the standard header files) #define MAX(a,b) ((a) >= (b) ? (a) : (b)) #define MIN(a,b) ((a) <= (b) ? (a) : (b)) Note that the above two constructs have problems if the parameters have side effects, i.e. for something like: max = MAX(*a++,*b--); For c++, there is a algorithm std::max() available in the standard template library. /pwm On Thu, 7 Jun 2007, Philip Bennefall wrote: > Hi, > Could anyone tell me the formula which is used to calculate the min and max values for a numerical data type of x bytes? Say for instance that I use the > sizeof(datatype) function and get the answer 4, which is usually an integer, how do I then programatically calculate the min and max values for a signed > and unsigned version of the data type respectively. > > Thanks in advance. > > Regards > Philip Bennefall ------------------------------ Message: 7 Date: Thu, 7 Jun 2007 19:10:58 +0200 (CEST) From: Per Westermark Subject: Re: [Dev-C++] Formula question To: Philip Bennefall Cc: dev...@li... Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII Oops, missed the meaning of your question. Look at the file - it contains a lot of defines for numeric ranges for different data types (char, short, int, long, ...) /pwm On Thu, 7 Jun 2007, Philip Bennefall wrote: > Hi, > Could anyone tell me the formula which is used to calculate the min and max values for a numerical data type of x bytes? Say for instance that I use the > sizeof(datatype) function and get the answer 4, which is usually an integer, how do I then programatically calculate the min and max values for a signed > and unsigned version of the data type respectively. > > Thanks in advance. > > Regards > Philip Bennefall ------------------------------ Message: 8 Date: Fri, 8 Jun 2007 16:46:05 +0200 From: "Jan Mura" Subject: [Dev-C++] Linked list To: Message-ID: <000601c7a9db$bff90b10$8ce118ac@TERASUS2> Content-Type: text/plain; charset="iso-8859-2" Hello, I would like to ask about some things in linked list I try to write. It looks like: struct s { int id; char *name; struct s *next; }; int main () { struct s *front = NULL; /*the front of a list */ int i = 1; char *name; while (1) { gets (name); if (strlen(name) == 0) break; in_list (&front, i, name); i++; } return 0; } void in_list (struct s **q, int in_id, const char *in_name) { struct s*member, *temp; member = malloc (sizeof (struct s)); member -> name = malloc (strlen (in_name) +1); member-> id = in_id; strcpy (member -> name, in_name); member -> next = NULL; /* it will be the last member in the list */ if (q == NULL) /* empty list */ { q = member; q -> next = NULL; } else { temp = q; temp -> next = q -> next; while (temp -> next != NULL) temp = temp -> next; /* looking for the last member in the list */ temp ->next = member; /* the last member is no more the last one */ } } Should I allocate the space for temp and temp -> next when I am putting an adress from member to temp? So should it looks like: temp = malloc ...; temp = member; ??? Thanks for your answer. Jan Mura jan...@vo... ------------------------------ ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ------------------------------ _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users End of Dev-cpp-users Digest, Vol 13, Issue 2 ******************************************** |
|
From: Per W. <pw...@ia...> - 2007-06-11 08:14:58
|
Why do you reply to a daily digest, without even removing all mails from the digest? This means that a large part of the list readers gets that days mails twice, and makes the people who know the answer to your question quite a lot less inclined to help you... /pwm |