dev-cpp-users Mailing List for Dev-C++ (Page 3)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(15) |
Oct
(115) |
Nov
(154) |
Dec
(258) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(377) |
Feb
(260) |
Mar
(249) |
Apr
(188) |
May
(152) |
Jun
(150) |
Jul
(195) |
Aug
(202) |
Sep
(200) |
Oct
(286) |
Nov
(242) |
Dec
(165) |
2002 |
Jan
(245) |
Feb
(241) |
Mar
(239) |
Apr
(346) |
May
(406) |
Jun
(369) |
Jul
(418) |
Aug
(357) |
Sep
(362) |
Oct
(597) |
Nov
(455) |
Dec
(344) |
2003 |
Jan
(446) |
Feb
(397) |
Mar
(515) |
Apr
(524) |
May
(377) |
Jun
(387) |
Jul
(532) |
Aug
(364) |
Sep
(294) |
Oct
(352) |
Nov
(295) |
Dec
(327) |
2004 |
Jan
(416) |
Feb
(318) |
Mar
(324) |
Apr
(249) |
May
(259) |
Jun
(218) |
Jul
(212) |
Aug
(259) |
Sep
(158) |
Oct
(162) |
Nov
(214) |
Dec
(169) |
2005 |
Jan
(111) |
Feb
(165) |
Mar
(199) |
Apr
(147) |
May
(131) |
Jun
(163) |
Jul
(235) |
Aug
(136) |
Sep
(84) |
Oct
(88) |
Nov
(113) |
Dec
(100) |
2006 |
Jan
(85) |
Feb
(119) |
Mar
(33) |
Apr
(31) |
May
(56) |
Jun
(68) |
Jul
(18) |
Aug
(62) |
Sep
(33) |
Oct
(55) |
Nov
(19) |
Dec
(40) |
2007 |
Jan
(22) |
Feb
(49) |
Mar
(34) |
Apr
(51) |
May
(66) |
Jun
(43) |
Jul
(116) |
Aug
(57) |
Sep
(70) |
Oct
(69) |
Nov
(97) |
Dec
(86) |
2008 |
Jan
(32) |
Feb
(47) |
Mar
(106) |
Apr
(67) |
May
(28) |
Jun
(39) |
Jul
(31) |
Aug
(25) |
Sep
(18) |
Oct
(25) |
Nov
(5) |
Dec
(21) |
2009 |
Jan
(33) |
Feb
(27) |
Mar
(27) |
Apr
(22) |
May
(22) |
Jun
(10) |
Jul
(17) |
Aug
(9) |
Sep
(21) |
Oct
(13) |
Nov
(4) |
Dec
(11) |
2010 |
Jan
(10) |
Feb
(8) |
Mar
(4) |
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(8) |
Oct
(26) |
Nov
(9) |
Dec
(1) |
2011 |
Jan
(21) |
Feb
(16) |
Mar
(4) |
Apr
(19) |
May
(26) |
Jun
(9) |
Jul
(6) |
Aug
|
Sep
(4) |
Oct
(3) |
Nov
(2) |
Dec
(1) |
2012 |
Jan
(4) |
Feb
(7) |
Mar
(4) |
Apr
|
May
(1) |
Jun
(10) |
Jul
(1) |
Aug
(1) |
Sep
(18) |
Oct
(3) |
Nov
(1) |
Dec
(1) |
2013 |
Jan
(4) |
Feb
(2) |
Mar
(15) |
Apr
(6) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
(9) |
Dec
|
2014 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(4) |
2015 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(9) |
Nov
(35) |
Dec
(6) |
2016 |
Jan
(7) |
Feb
(10) |
Mar
(10) |
Apr
(9) |
May
(13) |
Jun
(9) |
Jul
(1) |
Aug
(3) |
Sep
(3) |
Oct
(1) |
Nov
(1) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1
(18) |
2
(3) |
3
(5) |
4
(10) |
5
(2) |
6
(15) |
7
(10) |
8
(17) |
9
(28) |
10
(9) |
11
(20) |
12
(27) |
13
(16) |
14
(2) |
15
(5) |
16
(11) |
17
(6) |
18
(10) |
19
(21) |
20
(24) |
21
(15) |
22
(13) |
23
(26) |
24
(8) |
25
(9) |
26
(11) |
27
(13) |
28
(3) |
29
(4) |
30
(26) |
|
|
|
|
|
From: Per W. <pw...@ia...> - 2003-06-26 13:37:34
|
1 - a program on one machine can't easily start a program on another machine, even if that machine shares out a drive. You need a program or service on the other machine with a network api for starting other programs - as suggested before BackOrific or similar... 2 - Ever thought about the system("pause") calls you probably have done a lot? "pause" is an external command. Other alternatives are a number of execXX() calls. /Per W On Thu, 26 Jun 2003, Daniel Glenfield wrote: > Like a virus? > > You need the right access rights, but if the second machine had a shared > drive (you know, right click on C: and select share as... that sort of > thing) then you could have your program find the location of the program on > it, then launch it. > > What's the code to launch an exe inside a c++ program anyway? > > >From: "Jorge" <jor...@fa...> > >To: <dev...@li...> > >Subject: [Dev-C++] Remote. > >Date: Wed, 25 Jun 2003 14:19:46 -0400 > > > >Hi. > > > >I want to do a program that could connect to another machine and execute a > >program inside this machine...the first part I do it , but I don't know how > >execute the program in the remote machine... > > > >If anyone know how do that please write me... > > > > > > _________________________________________________________________ > Hotmail messages direct to your mobile phone http://www.msn.co.uk/msnmobile > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU Hosting Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > _______________________________________________ > 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 > |
From: Daniel G. <sp...@ho...> - 2003-06-26 11:47:26
|
Like a virus? You need the right access rights, but if the second machine had a shared drive (you know, right click on C: and select share as... that sort of thing) then you could have your program find the location of the program on it, then launch it. What's the code to launch an exe inside a c++ program anyway? >From: "Jorge" <jor...@fa...> >To: <dev...@li...> >Subject: [Dev-C++] Remote. >Date: Wed, 25 Jun 2003 14:19:46 -0400 > >Hi. > >I want to do a program that could connect to another machine and execute a >program inside this machine...the first part I do it , but I don't know how >execute the program in the remote machine... > >If anyone know how do that please write me... > > _________________________________________________________________ Hotmail messages direct to your mobile phone http://www.msn.co.uk/msnmobile |
From: <lx...@fr...> - 2003-06-26 08:13:49
|
Hi All, When I change the keyboard shortcuts as I want, and I exit from the IDE, in= next start my shortcut changes lost. I mean: I clear ctrl+alt+, and ctrl+alt+. but next time, when I start the I= DE, these changes are lost. Can I turn it to permanent, or I have to clear shortcuts in every start? Thnx, Istv=E1n |
From: CARLSON, J. M. <CA...@st...> - 2003-06-26 06:37:55
|
// Search and Replace Function // Praise God for His Goodness and Mercy // 22 June 2003 // Jay A Carlson // Search and Replace Implementation and Testing // // Takes an input text and replacement text and makes it happen // In the future I will have an input text file and a change file // to end up with a new converted file. // // The specifications take the form of // start delimiter, stop delimiter // start and stop delimiters must be different although not check (yet) // search and replace words inside of the start and stop delimiters // search - can be any text, number, word, or a phrase // replace - can be any text, number, word, or phrase // examples are as below: // <> <search for this> <replace with this>; // [] [search] [replace] // <> <myArray[9]> <thisArray[10]> // ^* ^std::cout<<test[5];* ^printf("test[3]");* // // Notice by being able to specify the start and stop delimiters for each // search and replace you don't have to worry about nesting problems. // // abbreviations // srt -- search and replace text // // personal notes: I did this for two reasons, // 1. To learn how to manipulate C++ std::strings, and I am now just getting // the hang of it. // 2. I actually need this for a specific purpose // // It could be used to replace >>>>>>> on email with ' ' or "". // // I am posting this on the internet for new people so they won't have to // try and figure this all out from scratch. It took me a long time and // in general I know how to program but the std::library stuff is taking // me longer than I thought to learn. // // A REAL programmer probably wouldn't comment any of this because it is // probably obvious. I am going to comment the heck out of it to help // new people and maybe myself. // // Because there are so many comments you might have to save two copies, // one with the comments, and one with a lot of the comments stripped out. #include <iostream> // for std::cout #include <string> // for std::string #include <vector> // guess what - for vectors // this is a function whose sole purpose in life is to get the word, or words // between the delimiters represented by the variables start and stop // srt -- search and replace text // debug -- a way of showing more or less information in a hurry std::string getword_s(char start, char stop, std::string &srt, const bool debug) { // \n - means put in a new line // srt - same as above if (debug) std::cout << "\nsrt = " << srt; // I used unsigned int for first, last and len, // I may have been able to use std::string::iterator instead // but why would I want to type even more than I am now. // I am sure for sorting iterators would be the way to go. unsigned int first = srt.find_first_of(start) + 1; unsigned int last = srt.find_first_of(stop) - 1; unsigned int len = last - first + 1; // length of word(s) between delimiters // get the substring of srt, starting at position first (delimeter +1) and // go for len charachers. If len is larger than the string srt it will // just stop at the end. std::string word = srt.substr(first, len); // now that we got the word(s) we wanted out between the delimiters, it is // time to remove that section so that we can work with the next part, if // any. Once again the substring will stop at the end of the string, // regaurdless of where length() tells it to stop. srt = srt.substr(last + 2, srt.length()); // just so we can monitor to see that everything is working ok if (debug) std::cout << "\nword(s) = " << word; return word; } // the name says it all void search_and_replace(std::string &text, std::string &srt, const bool debug) { // I didn't want an accidental space to cause the program to glitch // so in the next few lines I remove all spaces before delimiters. // This also simplfied getting the delimiters unsigned int eatwhite = srt.find_first_not_of(' '); srt = srt.substr(eatwhite,srt.length()); char start = srt[0]; // the starting delimiter is now the first char in srt srt = srt.substr(1,srt.length()); eatwhite = srt.find_first_not_of(' '); srt = srt.substr(eatwhite,srt.length()); char stop = srt[0]; // the ending delimiter is now the first char in srt // C++ uses 0 to start arrays and strings. It makes it easy to make FOR // loops for(int i = 0; i < length; i++) {code here} // You never want to end a loop on an i == length there are two many times // when they don't match perfectly and you run the risk of going into // an infinite loop. (Okay maybe not so much for an integer, but a float // or double has a good chance that won't match perfectly. So it is good // programming practice to just use '<' instead of '==' . // Knowing that if you started the array at 1 you would // have for(int i=1; i < length+1; i++) { code here } doesn't look to bad, // but when you get into multidimensional arrays, it gets harder to get // the index number if you don't start at zero. // Just learn to be standard... if (debug) { // Once again, if we need to see if the output is correct. std::cout << "\nStart Delimiter = " << start; std::cout << "\nStop Delimiter = " << stop; } // remove the delimiter specifiers so we can look for the search // and replace words srt = srt.substr(2, srt.length()-1); if (debug) std::cout << "\nsrt = " << srt << "\n"; // call the function getword_s to get the word(s) for the search part std::string search = getword_s(start, stop, srt, debug); if (debug) std::cout << "\n"; // call the function getword_s to get the word(s) for the replace part std::string replace = getword_s(start, stop, srt, debug); if (debug) { std::cout << "\n\nText: \n" << text; std::cout << "\n\nThe word(s) to search for is/are : \"" << search << "\""; std::cout << "\nThe word(s) to replace with is/are: \"" << replace << "\""; std::cout << "\n"; } // You better check to see that what your searching for is there before // you try to replace it. If it is not there you can't replace it, and // your program will terminate before you can view any std::cout data. if (text.length() > text.find(search)) { //THIS IS IT - THE WHOLE PROGRAM IS MADE FOR THIS LINE TO DO ITS WORK // Find the search word(s) in the text, and replace it with the word(s) // stored in the variable replace, (not to be confused with the call of the // function text.replace()) for a length of the original word(s). // Note the string will be expanded as necessary for the replacement to fit. // If the search word is not found, it cannot be replaced!! text = text.replace(text.find(search), search.length(), replace); } std::cout << "\n"; } int main(void) { bool debug = false; // toggle to see more details std::string original = "I will be 40 next year."; std::string new_text = original; // Oh yeah - here I am experimenting with vectors of strings // Vectors are almost like arrays, but better std::vector<std::string>srt(4); // srt - search and replace text // Test no match condition srt[0] = " < > <35> <34>"; // Test replace with same size srt[1] = " ( ) (40) (38)"; // Test replace with smaller size srt[2] = "[ ] [ 38] []"; // Test replace with a bigger text srt[3] = "[] [next] [a very old man next]"; for(int i = 0; i < 4; i++) { std::cout << "\nsrt = " << srt[i]; search_and_replace(new_text, srt[i], debug); std::cout << "\nOriginal text: " << original; std::cout << "\nNew text: " << new_text; if (debug) { std::cout << "\n\n\n\n"; system("pause"); } else std::cout << "\n\n"; original = new_text; } if (!(debug)) system("pause"); return 0; } // I hoped you like the way I use debug to show whats going on // I am finally getting the hang of the STL .. well a little bit anyway. // It took me forever to get some of the syntax right, but now learning can // happen. And if its too late to learn there is alway cut and paste. // Praise God for His Goodness and Mercy // Jay A. Carlson |
From: <Man...@ao...> - 2003-06-26 05:52:15
|
You can get more by running the auto updater. I think 6 showed up last tiem I ran it. |
From: Per W. <pw...@ia...> - 2003-06-26 05:47:55
|
It's the result of your mail program configured to sending MIME Quoted Printable format. Please turn off before posting code. Some mail readers really hates this format... /Per W On Wed, 25 Jun 2003, CARLSON, JAY MM1 wrote: > To the new people especially, > all the =20 and =3D are not part of the program I submitted > > Search and Replace Functions - Learning how to manipulate strings > and some simple string vectors (CARLSON, JAY MM1) > > > They may maybe space and tabs let see: > Here are some spaces > > > Here are some tabs > > > Here are some spaces and tabs > > > Maybe the =20 and =3D is a way to prevent straight code copying. Either way > you will have to strip out all the =20 and =3D to make the program work. > God Bless > Jay > > > > > Message: 6 > From: "CARLSON, JAY MM1" <CA...@st...> > To: "'dev...@li...'" > <dev...@li...> > Date: Wed, 25 Jun 2003 12:56:39 -0800 > Subject: [Dev-C++] Search and Replace Functions - Learning how to manipulate > strings > and some simple string vectors > > // Search and Replace Function // Praise God for His Goodness and Mercy > // 22 June 2003 // Jay A Carlson > > // Search and Replace Implementation and Testing > // > // Takes an input text and replacement text and makes it happen > // In the future I will have an input text file and a change file > // to end up with a new converted file. > // > // The specifications take the form of=20 > // start delimiter, stop delimiter > // start and stop delimiters must be different although not check (yet)=20 > // search and replace words inside of the start and stop delimiter= > s=20 > // search - can be any text, number, word, or a phrase > // replace - can be any text, number, word, or phrase > // examples are as below: > // <> <search for this> <replace with this>; > // [] [search] [replace] > // <> <myArray[9]> <thisArray[10]> > // ^* ^std::cout<<test[5];* ^printf("test[3]");* > // > // Notice by being able to specify the start and stop delimiters for each= > =20 > // search and replace you don't have to worry about nesting problems = > or=20 > // escape sequence problems. > // > // abbreviations > // srt -- search and replace text > // > // personal notes: I did this for two reasons, > // 1. To learn how to manipulate C++ std::strings, and I am now just > getting > // the hang of it. > // 2. I actually need this for a specific purpose > // > // It could be used to replace >>>>>>> on email with ' ' or "". > // > // I am posting this on the internet for new people so they won't have = > to=20 > // try and figure this all out from scratch. It took me a long time > and > // in general I know how to program but the std::library stuff is > taking > // me longer than I thought to learn. > //=20 > // A REAL programmer probably wouldn't comment any of this because it i= > s > // probably obvious. I am going to comment the heck out of it to he= > lp > // new people and maybe myself. > // > // Because there are so many comments you might have to save two copies= > , > // one with the comments, and one with a lot of the comments stripped > out. > > #include <iostream> // for std::cout > #include <string> // for std::string > #include <vector> // guess what - for vectors > > // this is a function whose sole purpose in life is to get the word, or > words > // between the delimiters represented by the variables start and stop > // srt -- search and replace text > // debug -- a way of showing more or less information in a hurry > std::string getword_s(char start, char stop, std::string &srt, const bool > debug)=20 > { > // \n - means put in a new line > // srt - same as above > if (debug) std::cout << "\nsrt =3D " << srt;=20 > // I used unsigned int for first, last and len, > // I may have been able to use std::string::iterator instead > // but why would I want to type even more than I am now. > // I am sure for sorting iterators would be the way to go. > unsigned int first =3D srt.find_first_of(start) + 1; > unsigned int last =3D srt.find_first_of(stop) - 1; > unsigned int len =3D last - first + 1; // length of word(s) between > delimiters > // get the substring of srt, starting at position first (delimeter +1) > and > // go for len charachers. If len is larger than the string srt it > will > // just stop at the end. > std::string word =3D srt.substr(first, len);=20 > // now that we got the word(s) we wanted out between the delimiters, i= > t > is=20 > // time to remove that section so that we can work with the next part,= > if > > // any. Once again the substring will stop at the end of the string,=20 > // regaurdless of where length() tells it to stop. > srt =3D srt.substr(last + 2, srt.length()); > // just so we can monitor to see that everything is working ok > if (debug) std::cout << "\nword(s) =3D " << word; > return word; > } > =20 > // the name says it all =20 > void search_and_replace(std::string &text, std::string &srt, const bool > debug) { > // I didn't want an accidental space to cause the program to glitch > // so in the next few lines I remove all spaces before delimiters. > // This also simplfied getting the delimiters > unsigned int eatwhite =3D srt.find_first_not_of(' '); > srt =3D srt.substr(eatwhite,srt.length()); > char start =3D srt[0]; // the starting delimiter is now the first cha= > r in > srt =20 > srt =3D srt.substr(1,srt.length()); > eatwhite =3D srt.find_first_not_of(' '); > srt =3D srt.substr(eatwhite,srt.length()); > char stop =3D srt[0]; // the ending delimiter is now the first char = > in > srt=20 > // C++ uses 0 to start arrays and strings. It makes it easy to make F= > OR=20 > // loops for(int i =3D 0; i < length; i++) {code here} > // You never want to end a loop on an i =3D=3D length there are two = > many > times=20 > // when they don't match perfectly and you run the risk of going int= > o=20 > // an infinite loop. (Okay maybe not so much for an integer, but a > float > // or double has a good chance that won't match perfectly. So it is > good > // programming practice to just use '<' instead of '=3D=3D' . > // Knowing that if you started the array at 1 you would > // have for(int i=3D1; i < length+1; i++) { code here } doesn't look= > to > bad, > // but when you get into multidimensional arrays, it gets harder to = > get > > // the index number if you don't start at zero.=20 > // Just learn to be standard... > =20 > if (debug) { =20 > // Once again, if we need to see if the output is correct. > std::cout << "\nStart Delimiter =3D " << start; > std::cout << "\nStop Delimiter =3D " << stop; > } > // remove the delimiter specifiers so we can look for the search=20 > // and replace words > srt =3D srt.substr(2, srt.length()-1);=20 > if (debug) std::cout << "\nsrt =3D " << srt << "\n"; > // call the function getword_s to get the word(s) for the search part > std::string search =3D getword_s(start, stop, srt, debug); > if (debug) std::cout << "\n"; > // call the function getword_s to get the word(s) for the replace part > std::string replace =3D getword_s(start, stop, srt, debug); > =20 > if (debug) { > std::cout << "\n\nText: \n" << text; > std::cout << "\n\nThe word(s) to search for is/are : \"" << search= > << > "\""; > std::cout << "\nThe word(s) to replace with is/are: \"" << replace = > << > "\""; > std::cout << "\n"; > } > // You better check to see that what your searching for is there befor= > e > // you try to replace it. If it is not there you can't replace it, > and > // your program will terminate before you can view any std::cout da= > ta. > if (text.length() > text.find(search)) { > //THIS IS IT - THE WHOLE PROGRAM IS MADE FOR THIS LINE TO DO ITS WORK > // Find the search word(s) in the text, and replace it with the word(= > s) > // stored in the variable replace, (not to be confused with the call = > of > the=20 > // function text.replace()) for a length of the original word(s). =20 > // Note the string will be expanded as necessary for the replacement = > to > fit. =20 > // If the search word is not found, it cannot be replaced!! > text =3D text.replace(text.find(search), search.length(), replace)= > ; > } > std::cout << "\n"; > } > > int main(void) { > bool debug =3D false; // toggle to see more details > std::string original =3D "I will be 40 next year."; > std::string new_text =3D original; > // Oh yeah - here I am experimenting with vectors of strings > // Vectors are almost like arrays, but better > std::vector<std::string>srt(4); // srt - search and replace text > // Test no match condition > srt[0] =3D " < > <35> <34>"; > // Test replace with same size > srt[1] =3D " ( ) (40) (38)"; > // Test replace with smaller size > srt[2] =3D "[ ] [ 38] []"; > // Test replace with a bigger text > srt[3] =3D "[] [next] [a very old man next]"; > =20 > for(int i =3D 0; i < 4; i++) { > std::cout << "\nsrt =3D " << srt[i]; > search_and_replace(new_text, srt[i], debug); =20 > std::cout << "\nOriginal text: " << original; > std::cout << "\nNew text: " << new_text; > if (debug) { > std::cout << "\n\n\n\n"; > system("pause"); > } > else std::cout << "\n\n"; > original =3D new_text; > } > if (!(debug)) system("pause"); > return 0; =20 > } > > // I hoped you like the way I use debug to show whats going on > > // I am finally getting the hang of the STL .. well a little bit anyway. > // It took me forever to get some of the syntax right, but now learning c= > an=20 > // happen. And if its too late to learn there is alway cut and paste. > // Praise God for His Goodness and Mercy > // Jay A. Carlson > > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] > Sent: Monday, June 23, 2003 9:30 AM > To: dev...@li... > Subject: Dev-cpp-users digest, Vol 1 #1511 - 6 msgs > > > 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. Re: Comment Delimiters (Damien .) > 2. RE: Comment Delimiters (Per Westermark) > 3. Re: Comment Delimiters (Per Westermark) > 4. Re: Comment Delimiters (Daniel Glenfield) > 5. Re: WRITING TO SERIAL PORT (Daniel Glenfield) > 6. Re: FREE download: a HOW-TO use wxWindows with Dev-C++ (Brian > Ackermann) > > -- __--__-- > > Message: 1 > From: "Damien ." <g_...@ho...> > To: dev...@li... > Subject: Re: [Dev-C++] Comment Delimiters > Date: Mon, 23 Jun 2003 06:41:24 -0400 > > Guys, How exactly does '#if 0' ...#endif work? I assumed that the=20 > preprocessor would skip the statements until it reached the #endif. =20 > However, when I tried to compile the code(with gcc 3.2.2) below , i get = > a=20 > "missing terminator character ' error" . It seems as though the code ins= > ide > > of an #if 0...#endif statement must be C/C++ accurate. It is easy fixed=20 > with a /*... */ .Care to elaborate....? > /* IfZero.c */ > #include <stdio.h> > int main(void) > { > #if 0 > This line should not be worried about. I'm quite sure it will *not* be =20 > included. > #endif > printf("..."); > return 0; > } > > ----Original Message Follows---- > From: "Daniel Glenfield" <sp...@ho...> > To: or...@vp..., dev...@li... > Subject: Re: [Dev-C++] Comment Delimiters > Date: Mon, 23 Jun 2003 09:16:30 +0100 > > Agreed. #if 0 ..#endif is a great way of doing it. > > > >From: OROSZI Bal=E1zs <or...@vp...> > >To: dev...@li... > >Subject: Re: [Dev-C++] Comment Delimiters > >Date: Mon, 23 Jun 2003 10:01:54 +0200 > > > >Andr=E9 Mac=E1rio Barros wrote: > >>Dear Users, > >> > >> Suppose you can=B4t use the /* and */ comment delimiters to put in > comments > >>an area of a code in C++. > >> If I use the // command, must I put them in each line of this piece > of > >>code? > >> Is there another way? > > > >There is a quick way: > > > >#if 0 > >... > >#endif > > > >Because "0" is "false", #if 0 can be considered like if (false){...}, wh= > ich > > >will in fact, never execute. So all code, with or without comments, will= > =20 > >not be parsed by the C preprocessor there. > > > >This approach is also better, because /* */ comments cannot be nested. > > > >-- > >Greetings, > > Bal=E1zs > > > > > > > >------------------------------------------------------- > >This SF.Net email is sponsored by: INetU > >Attention Web Developers & Consultants: Become An INetU Hosting Partner. > >Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! > >INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > >_______________________________________________ > >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 > > _________________________________________________________________ > On the move? Get Hotmail on your mobile phone http://www.msn.co.uk/msnmob= > ile > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU Hosting Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > _______________________________________________ > 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 > > _________________________________________________________________ > The new MSN 8: advanced junk mail protection and 2 months FREE*=20 > http://join.msn.com/?page=3Dfeatures/junkmail > > > > -- __--__-- > > Message: 2 > Date: Mon, 23 Jun 2003 13:45:45 +0200 (CEST) > From: Per Westermark <pw...@ia...> > To: Ioannis Vranos <iv...@em...> > cc: Dev-C++ Mailing List <dev...@li...> > Subject: RE: [Dev-C++] Comment Delimiters > > Yes, it is always good to have definned coding rules for new projects, > but: > 1 - /* */ doesn't support nesting except for some compilers. > 2 - it is not uncommon for a project to inherrit code, and that code migh= > t > use /* */ or might even be in C. > > The only two safe methods of deactivating a large block of code is to > either delete the lines, or to #ifdef them. With good source control, the > code delete is preferable since it's WYSIWYG. However, a lot of people > doesn't use CVS or SourceSafe et. al at home, and then it is very easy to > permanently loose deleted code lines. > > /Per W > > On Mon, 23 Jun 2003, Ioannis Vranos wrote: > > > > -----Original Message----- > > > From: Per Westermark [mailto:pw...@ia...] On Behalf > > > Of Per Westermark > > > Sent: Monday, June 23, 2003 11:56 AM > > > To: Ioannis Vranos > > > Cc: 'Dev-Cpp-Users' > > > Subject: RE: [Dev-C++] Comment Delimiters > > > > > > > > > Often the one asking a question don't really know exactly > > > what they want - > > > or at least doesn't specify it clearly enough. > > > > > > Yes, multiline comments should of course use /* ... */ but > > > very often when > > > someone gets bothered about commenting away a large number of > > > lines, they > > > are not thinking about a big block-comment, but a large block > > > of unwanted > > > code. > > > > > > I did not understand what you mean but a very good commenting style is > this: > > > > > > For comments use only //. > > > > Use /* */ only for debugging purposes. > > > > > > > > > > Ioannis Vranos > > > > * Programming pages: http://www.noicys.freeurl.com > > * Alternative URL 1: http://run.to/noicys > > * Alternative URL 2: http://www.noicys.cjb.net > > > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: INetU > > Attention Web Developers & Consultants: Become An INetU Hosting Partner. > > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission= > ! > > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > > _______________________________________________ > > 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 > > > > > > -- __--__-- > > Message: 3 > Date: Mon, 23 Jun 2003 13:57:42 +0200 (CEST) > From: Per Westermark <pw...@ia...> > To: "Damien ." <g_...@ho...> > cc: dev...@li... > Subject: Re: [Dev-C++] Comment Delimiters > > Normally you can put just about anything within the #ifdef/#endif or > #if/#endif block - except that you should be a bit carefull about lines > that ends with a \ or lines that start with #. > > Even in a undefined block, the preprocessor will expect \ at the end of > the line to mean a line-continuation with, if the next source line > contains the #endif will spell trouble. > > Since the compiler supports nested #ifdef constructs, any #ifdef, #if, > #else, #endif etc. might seriously affect the size of the deactivated > block. > > /Per W > > On Mon, 23 Jun 2003, Damien . wrote: > > > Guys, How exactly does '#if 0' ...#endif work? I assumed that the > > preprocessor would skip the statements until it reached the #endif. > > However, when I tried to compile the code(with gcc 3.2.2) below , i ge= > t =3D > a > > "missing terminator character ' error" . It seems as though the code i= > ns=3D > ide > > of an #if 0...#endif statement must be C/C++ accurate. It is easy fixe= > d > > with a /*... */ .Care to elaborate....? > > /* IfZero.c */ > > #include <stdio.h> > > int main(void) > > { > > #if 0 > > This line should not be worried about. I'm quite sure it will *not* be > > included. > > #endif > > printf("..."); > > return 0; > > } > > > > ----Original Message Follows---- > > From: "Daniel Glenfield" <sp...@ho...> > > To: or...@vp..., dev...@li... > > Subject: Re: [Dev-C++] Comment Delimiters > > Date: Mon, 23 Jun 2003 09:16:30 +0100 > > > > Agreed. #if 0 ..#endif is a great way of doing it. > > > > > > >From: OROSZI Bal=3DE1zs <or...@vp...> > > >To: dev...@li... > > >Subject: Re: [Dev-C++] Comment Delimiters > > >Date: Mon, 23 Jun 2003 10:01:54 +0200 > > > > > >Andr=3DE9 Mac=3DE1rio Barros wrote: > > >>Dear Users, > > >> > > >>=3D09Suppose you can=3DB4t use the /* and */ comment delimiters to pu= > t in c=3D > omments > > >>an area of a code in C++. > > >>=3D09If I use the // command, must I put them in each line of this pi= > ece =3D > of > > >>code? > > >> Is there another way? > > > > > >There is a quick way: > > > > > >#if 0 > > >... > > >#endif > > > > > >Because "0" is "false", #if 0 can be considered like if (false){...}, = > wh=3D > ich > > >will in fact, never execute. So all code, with or without comments, wi= > ll > > >not be parsed by the C preprocessor there. > > > > > >This approach is also better, because /* */ comments cannot be nested. > > > > > >-- > > >Greetings, > > > Bal=3DE1zs > > > > > > > > > > > >------------------------------------------------------- > > >This SF.Net email is sponsored by: INetU > > >Attention Web Developers & Consultants: Become An INetU Hosting Partne= > r. > > >Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commissio= > n! > > >INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > > >_______________________________________________ > > >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 > > > > _________________________________________________________________ > > On the move? Get Hotmail on your mobile phone http://www.msn.co.uk/msnm= > ob=3D > ile > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: INetU > > Attention Web Developers & Consultants: Become An INetU Hosting Partner. > > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission= > ! > > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > > _______________________________________________ > > 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 > > > > _________________________________________________________________ > > The new MSN 8: advanced junk mail protection and 2 months FREE* > > http://join.msn.com/?page=3D3Dfeatures/junkmail > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: INetU > > Attention Web Developers & Consultants: Become An INetU Hosting Partner. > > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission= > ! > > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > > _______________________________________________ > > 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 > > > > > > -- __--__-- > > Message: 4 > From: "Daniel Glenfield" <sp...@ho...> > To: g_...@ho..., dev...@li... > Subject: Re: [Dev-C++] Comment Delimiters > Date: Mon, 23 Jun 2003 13:21:14 +0100 > > #if 0 > cout << "This code will not be compiled, but I don't know if it needs to = > be=20 > syntactically correct or not. Probably does" << endl; > #endif > > Yes I know I've forgotten to #include the iostream header. > > > >From: "Damien ." <g_...@ho...> > >To: dev...@li... > >Subject: Re: [Dev-C++] Comment Delimiters > >Date: Mon, 23 Jun 2003 06:41:24 -0400 > > > >Guys, How exactly does '#if 0' ...#endif work? I assumed that the=20 > >preprocessor would skip the statements until it reached the #endif. =20 > >However, when I tried to compile the code(with gcc 3.2.2) below , i get= > a=20 > >"missing terminator character ' error" . It seems as though the code=20 > >inside of an #if 0...#endif statement must be C/C++ accurate. It is eas= > y=20 > >fixed with a /*... */ .Care to elaborate....? > >/* IfZero.c */ > >#include <stdio.h> > >int main(void) > >{ > >#if 0 > >This line should not be worried about. I'm quite sure it will *not* be =20 > >included. > >#endif > >printf("..."); > >return 0; > >} > > > >----Original Message Follows---- > >From: "Daniel Glenfield" <sp...@ho...> > >To: or...@vp..., dev...@li... > >Subject: Re: [Dev-C++] Comment Delimiters > >Date: Mon, 23 Jun 2003 09:16:30 +0100 > > > >Agreed. #if 0 ..#endif is a great way of doing it. > > > > > >>From: OROSZI Bal=E1zs <or...@vp...> > >>To: dev...@li... > >>Subject: Re: [Dev-C++] Comment Delimiters > >>Date: Mon, 23 Jun 2003 10:01:54 +0200 > >> > >>Andr=E9 Mac=E1rio Barros wrote: > >>>Dear Users, > >>> > >>> Suppose you can=B4t use the /* and */ comment delimiters to put > in=20 > >>>comments > >>>an area of a code in C++. > >>> If I use the // command, must I put them in each line of this piece > of > >>>code? > >>> Is there another way? > >> > >>There is a quick way: > >> > >>#if 0 > >>... > >>#endif > >> > >>Because "0" is "false", #if 0 can be considered like if (false){...},=20 > >>which will in fact, never execute. So all code, with or without comment= > s,=20 > >>will not be parsed by the C preprocessor there. > >> > >>This approach is also better, because /* */ comments cannot be nested. > >> > >>-- > >>Greetings, > >> Bal=E1zs > >> > >> > >> > >>------------------------------------------------------- > >>This SF.Net email is sponsored by: INetU > >>Attention Web Developers & Consultants: Become An INetU Hosting Partner. > >>Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission= > ! > >>INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > >>_______________________________________________ > >>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 > > > >_________________________________________________________________ > >On the move? Get Hotmail on your mobile phone=20 > >http://www.msn.co.uk/msnmobile > > > > > > > >------------------------------------------------------- > >This SF.Net email is sponsored by: INetU > >Attention Web Developers & Consultants: Become An INetU Hosting Partner. > >Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! > >INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > >_______________________________________________ > >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 > > > >_________________________________________________________________ > >The new MSN 8: advanced junk mail protection and 2 months FREE*=20 > >http://join.msn.com/?page=3Dfeatures/junkmail > > > > > > > >------------------------------------------------------- > >This SF.Net email is sponsored by: INetU > >Attention Web Developers & Consultants: Become An INetU Hosting Partner. > >Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! > >INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > >_______________________________________________ > >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 > > _________________________________________________________________ > Find a cheaper internet access deal - choose one to suit you.=20 > http://www.msn.co.uk/internetaccess > > > > -- __--__-- > > Message: 5 > From: "Daniel Glenfield" <sp...@ho...> > To: MDo...@OL..., dev...@li... > Subject: Re: [Dev-C++] WRITING TO SERIAL PORT > Date: Mon, 23 Jun 2003 13:28:07 +0100 > > I'm not entirely sure of the syntax but... > > In DOS (command prompt) you can do > nmake DebugBuild > LPT1 > > to send output of the DebugBuild "build" to the printer attached to LPT1.= > =20 > I'm not sure about how you could tie this in with your project though... > > > >From: Dondolo Mpho <MDo...@OL...> > >To: dev...@li... > >Subject: [Dev-C++] WRITING TO SERIAL PORT > >Date: Mon, 23 Jun 2003 10:23:36 +0200 > > > >Hi all, > > > >I have been playing around with streams and need the following help. > >I am able to print my files to our network printer and also write them t= > o > >specific network drives. > >How do I write a device in one of my ports...eg, serial port > >consider this code as an example. > > > > > > > >ofstream create(" \\omcwca054\\HPLJ5000 <file://\\omcwca054\\HPLJ5000> "= > ) > >cout<<"The following will be printed to on lazer jet printer"; > >create<<" Mpho Dondolo\n" > > <<" 45 Durban Ridge\n" > > <<"Tyger Valley\n"; > >create.close(); > > > >I want to write to my matrix display board that is connected to my seria= > l > >port. > > > >NB!!!! Please do not flip if have not supplied sufficient info. ( last i= > =20 > >did > >that, some guy almost had a heart attack) I am still new at this game > > > > > > _________________________________________________________________ > Get Hotmail on your mobile phone http://www.msn.co.uk/msnmobile > > > > -- __--__-- > > Message: 6 > Date: Mon, 23 Jun 2003 12:26:20 -0500 > From: Brian Ackermann <bri...@gm...> > CC: dev...@li... > Subject: Re: [Dev-C++] FREE download: a HOW-TO use wxWindows with Dev-C++ > > This is a multi-part message in MIME format. > --------------000300010007070605010009 > Content-Type: text/plain; charset=3Dus-ascii; format=3Dflowed > Content-Transfer-Encoding: 7bit > > Well, here's the part that works... > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D > bja3622@ANN /c/wx/samples/minimal > $ make -f makefile.unx c++ -c `wx-config --cxxflags` -o minimal.o=20 > minimal.cpp > c++ -o minimal minimal.o `wx-config --libs` > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D > and my flags look like this :: > > bja3622@ANN /c/wx/samples/minimal > $ wx-config --cxxflags > -I/usr/local/lib/wx/include/mswd-2.5 -D__WXDEBUG__ -D__WXMSW__ -mthreads=20 > -fno-pcc-struct-return > > bja3622@ANN /c/wx/samples/minimal > $ wx-config --libs > -L/usr/local/lib -Wl,--subsystem,windows -mwindows -mthreads =20 > /usr/local/lib/libwxmsw250d.a -ltiff -lrpcrt4 -loleaut32 -lole32 -luuid=20 > -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lwsock32 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D > And this is the make output from Dev-Cpp > $ make -f makefile.win > g++.exe -c minimal.cpp -o minimal.o -I"C:/Dev-Cpp/include/c++" =20 > -I"C:/Dev-Cpp/include/c++/mingw32" -I"C:/Dev-Cpp/include/c++/backward" =20 > -I"C:/Dev-Cpp/include" -I"C:/msys/1.0/local/include" =20 > -I"C:/msys/1.0/local/lib/wx/include/mswd-2.5" -D__WXDEBUG__ =20 > -D__WXMSW__ -D__GNUWIN32__ -mthreads -fno-pcc-struct-return=20 > windres.exe -i Project2_private.rc -I rc -o Project2_private.res -O=20 > coff --include-dir C:/msys/1.0/local/include > g++.exe minimal.o Project2_private.res -o "Project2.exe"=20 > -L"C:/Dev-Cpp/lib" -L"C:/msys/1.0/local/lib/wx" -mwindows=20 > -Wl,--subsystem,windows -mwindows -mthreads =20 > C:/wx/mswd/lib/libwxmsw250d.a -ltiff -lrpcrt4 -loleaut32 -lole32 =20 > -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 =20 > -ladvapi32 -lwsock32 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D > Aside from the inclusion of -D__GNUWIN32__ the compiler options are the=20 > same (plus a bunch of include directories, maybe relevant, maybe not...I=20 > don't know how to tell) > > Same story with the libs too...the only difference is the -L"..." flags..= > .. > > I guess the culprit must be right here.... > > Brian Ackermann > > > > > Yeoh HS wrote: > > >----- Original Message ----- > >From: "Brian Ackermann" <bri...@gm...> > >To: <dev...@li...> > >Sent: Friday, June 20, 2003 10:14 PM > >Subject: Re: [Dev-C++] FREE download: a HOW-TO use wxWindows with Dev-C+= > + > > > > > > =20 > > > >>Yeoh, and others > >> > >>I've done according to the instructions in this document, and, > >>unfortunately I get the same problem I had gotten before. The > >>application compiles (but Dev-Cpp cannot run it, I must go through the > >>explorer for that...) but when it executes, immediately it generates an > >>error > >> > >>The exception unknown software exception (0xc00000fd) occurred in the > >>application at location 0x0040d40d. > >> > >>However, the application will compile if I do a "make -f makefile.unx" > >>the application compiles AND RUNS just fine.... > >> > >>Where am I going wrong? > >> > >>Brian Ackermann > >> > >> > >> =20 > >> > >Hi Brian, > > > >I see from your compile log that you've built the debug version of versi= > on > >2.5.0. When you created your Dev-C++ project, where did you get the > compiler > >defines and linker flags? Is it from the wx-config file? > > > >When you do "make -f makefile.unx", the wx-config file is used in the bu= > ild > >process. > >Since this works, you might want to take a look at wx-config file to see > the > >compiler defines and linker flags and compare them with your Dev-C++ > project > >settings. > > > >Best Regards, > >Yeoh > >-- > >P.S. I'm off on a trip, so will be away from the pc for a week or so. :-= > ) > > > > > > > > > >------------------------------------------------------- > >This SF.Net email is sponsored by: INetU > >Attention Web Developers & Consultants: Become An INetU Hosting Partner. > >Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! > >INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > >_______________________________________________ > >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 > > > > > > =20 > > > > --------------000300010007070605010009 > Content-Type: text/html; charset=3Dus-ascii > Content-Transfer-Encoding: 7bit > > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> > <html> > <head> > <meta http-equiv=3D"Content-Type" content=3D"text/html;charset=3DISO-88= > 59-1"> > <title></title> > </head> > <body text=3D"#000000" bgcolor=3D"#ffffff"> > Well, here's the part that works... <br> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D <br> > bja3622@ANN /c/wx/samples/minimal <br> > $ make -f makefile.unx c++ -c `wx-config --cxxfla= > gs` > -o minimal.o > minimal.cpp <br> > c++ -o minimal minimal.o `wx-config --libs` <br> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D <br> > and my flags look like this :: <br> > <br> > bja3622@ANN /c/wx/samples/minimal <br> > $ wx-config --cxxflags <br> > -I/usr/local/lib/wx/include/mswd-2.5 -D__WXDEBUG__ -D__WXMSW__ > -mthreads -fno-pcc-struct-return <br> > <br> > bja3622@ANN /c/wx/samples/minimal <br> > $ wx-config --libs <br> > -L/usr/local/lib -Wl,--subsystem,windows -mwindows > -mthreads > /usr/local/lib/libwxmsw250d.a -ltiff -lrpcrt4 -loleaut32 -lole32 -luuid > -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lwsock32 <b= > r> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D <br> > And this is the make output from Dev-Cpp <br> > $ make -f makefile.win <br> > g++.exe -c minimal.cpp -o minimal.o -I"C:/Dev-Cpp/include/c++" > -I"C:/Dev-Cpp/include/c++/mingw32" > -I"C:/Dev-Cpp/include/c++/backward" > -I"C:/Dev-Cpp/include" -I"C:/msys/1.0/local/include" > -I"C:/msys/1.0/local/lib/wx/include/mswd-2.5" -D__WXDEBUG__ > -D__WXMSW__ -D__GNUWIN32__ -mthreads > -fno-pcc-struct-return > windres.exe -i Project2_private.rc -I rc -o Project2_private.res -O > coff --include-dir C:/msys/1.0/local/include <br> > g++.exe minimal.o Project2_private.res -o "Project2.exe" > -L"C:/Dev-Cpp/lib" -L"C:/msys/1.0/local/lib/wx" -mwindows > -Wl,--subsystem,windows -mwindows -mthreads > C:/wx/mswd/lib/libwxmsw250d.a -ltiff -lrpcrt4 > -loleaut32 -lole32 > -luuid -lwinspool -lwinmm -lshell32 -lcomctl32&nb= > sp; > -lctl3d32 > -ladvapi32 -lwsock32 <br> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D <br> > Aside from the inclusion of -D__GNUWIN32__ the compiler options are the > same (plus a bunch of include directories, maybe relevant, maybe > not...I don't know how to tell) <br> > <br> > Same story with the libs too...the only difference is the -L"..." > flags.... <br> > <br> > I guess the culprit must be right here.... <br> > <br> > Brian Ackermann <br> > <br> > <br> > <br> > <br> > Yeoh HS wrote:<br> > <blockquote type=3D"cite" cite=3D"mid00a601c33795$086caae0$c96a8ea1@local= > pc"> > <pre wrap=3D"">----- Original Message ----- > From: "Brian Ackermann" <a class=3D"moz-txt-link-rfc2396E" > href=3D"mailto:bri...@gm..."><bri...@gm...></a> > To: <a class=3D"moz-txt-link-rfc2396E" > href=3D"mailto:dev...@li..."><dev-cpp-users@lis= > ts.so > urceforge.net></a> > Sent: Friday, June 20, 2003 10:14 PM > Subject: Re: [Dev-C++] FREE download: a HOW-TO use wxWindows with Dev-C++ > > > </pre> > <blockquote type=3D"cite"> > <pre wrap=3D"">Yeoh, and others > > I've done according to the instructions in this document, and, > unfortunately I get the same problem I had gotten before. The > application compiles (but Dev-Cpp cannot run it, I must go through the > explorer for that...) but when it executes, immediately it generates an > error > > The exception unknown software exception (0xc00000fd) occurred in the > application at location 0x0040d40d. > > However, the application will compile if I do a "make -f makefile.unx" > the application compiles AND RUNS just fine.... > > Where am I going wrong? > > Brian Ackermann > > > </pre> > </blockquote> > <pre wrap=3D""><!---->Hi Brian, > > I see from your compile log that you've built the debug version of versio= > n > 2.5.0. When you created your Dev-C++ project, where did you get the compi= > ler > defines and linker flags? Is it from the wx-config file? > > When you do "make -f makefile.unx", the wx-config file is used in the bui= > ld > process. > Since this works, you might want to take a look at wx-config file to see = > the > compiler defines and linker flags and compare them with your Dev-C++ proj= > ect > settings. > > Best Regards, > Yeoh > -- > P.S. I'm off on a trip, so will be away from the pc for a week or so. :-) > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU Hosting Partn= > er. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! > INetU Dedicated Managed Hosting <a class=3D"moz-txt-link-freetext" > href=3D"http://www.inetu.net/partner/index.php">http://www.inetu.net/part= > ner/i > ndex.php</a> > _______________________________________________ > Dev-cpp-users mailing list > <a class=3D"moz-txt-link-abbreviated" > href=3D"mailto:Dev...@li...">Dev-cpp-users@lists.s= > ource > forge.net</a> > TO UNSUBSCRIBE: <a class=3D"moz-txt-link-freetext" > href=3D"http://www.noicys.cjb.net/devcpp/ub.htm">http://www.noicys.cjb.ne= > t/dev > cpp/ub.htm</a> > <a class=3D"moz-txt-link-freetext" > href=3D"https://lists.sourceforge.net/lists/listinfo/dev-cpp-users">https= > ://li > sts.sourceforge.net/lists/listinfo/dev-cpp-users</a> > > > </pre> > </blockquote> > </body> > </html> > > --------------000300010007070605010009-- > > > > > -- __--__-- > > _______________________________________________ > 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 > > > > --__--__-- > > _______________________________________________ > 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 > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU Hosting Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > _______________________________________________ > 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 > |
From: CARLSON, J. M. <CA...@st...> - 2003-06-26 05:27:32
|
To the new people especially, all the =20 and =3D are not part of the program I submitted Search and Replace Functions - Learning how to manipulate strings and some simple string vectors (CARLSON, JAY MM1) They may maybe space and tabs let see: Here are some spaces Here are some tabs Here are some spaces and tabs Maybe the =20 and =3D is a way to prevent straight code copying. Either way you will have to strip out all the =20 and =3D to make the program work. God Bless Jay Message: 6 From: "CARLSON, JAY MM1" <CA...@st...> To: "'dev...@li...'" <dev...@li...> Date: Wed, 25 Jun 2003 12:56:39 -0800 Subject: [Dev-C++] Search and Replace Functions - Learning how to manipulate strings and some simple string vectors // Search and Replace Function // Praise God for His Goodness and Mercy // 22 June 2003 // Jay A Carlson // Search and Replace Implementation and Testing // // Takes an input text and replacement text and makes it happen // In the future I will have an input text file and a change file // to end up with a new converted file. // // The specifications take the form of=20 // start delimiter, stop delimiter // start and stop delimiters must be different although not check (yet)=20 // search and replace words inside of the start and stop delimiter= s=20 // search - can be any text, number, word, or a phrase // replace - can be any text, number, word, or phrase // examples are as below: // <> <search for this> <replace with this>; // [] [search] [replace] // <> <myArray[9]> <thisArray[10]> // ^* ^std::cout<<test[5];* ^printf("test[3]");* // // Notice by being able to specify the start and stop delimiters for each= =20 // search and replace you don't have to worry about nesting problems = or=20 // escape sequence problems. // // abbreviations // srt -- search and replace text // // personal notes: I did this for two reasons, // 1. To learn how to manipulate C++ std::strings, and I am now just getting // the hang of it. // 2. I actually need this for a specific purpose // // It could be used to replace >>>>>>> on email with ' ' or "". // // I am posting this on the internet for new people so they won't have = to=20 // try and figure this all out from scratch. It took me a long time and // in general I know how to program but the std::library stuff is taking // me longer than I thought to learn. //=20 // A REAL programmer probably wouldn't comment any of this because it i= s // probably obvious. I am going to comment the heck out of it to he= lp // new people and maybe myself. // // Because there are so many comments you might have to save two copies= , // one with the comments, and one with a lot of the comments stripped out. #include <iostream> // for std::cout #include <string> // for std::string #include <vector> // guess what - for vectors // this is a function whose sole purpose in life is to get the word, or words // between the delimiters represented by the variables start and stop // srt -- search and replace text // debug -- a way of showing more or less information in a hurry std::string getword_s(char start, char stop, std::string &srt, const bool debug)=20 { // \n - means put in a new line // srt - same as above if (debug) std::cout << "\nsrt =3D " << srt;=20 // I used unsigned int for first, last and len, // I may have been able to use std::string::iterator instead // but why would I want to type even more than I am now. // I am sure for sorting iterators would be the way to go. unsigned int first =3D srt.find_first_of(start) + 1; unsigned int last =3D srt.find_first_of(stop) - 1; unsigned int len =3D last - first + 1; // length of word(s) between delimiters // get the substring of srt, starting at position first (delimeter +1) and // go for len charachers. If len is larger than the string srt it will // just stop at the end. std::string word =3D srt.substr(first, len);=20 // now that we got the word(s) we wanted out between the delimiters, i= t is=20 // time to remove that section so that we can work with the next part,= if // any. Once again the substring will stop at the end of the string,=20 // regaurdless of where length() tells it to stop. srt =3D srt.substr(last + 2, srt.length()); // just so we can monitor to see that everything is working ok if (debug) std::cout << "\nword(s) =3D " << word; return word; } =20 // the name says it all =20 void search_and_replace(std::string &text, std::string &srt, const bool debug) { // I didn't want an accidental space to cause the program to glitch // so in the next few lines I remove all spaces before delimiters. // This also simplfied getting the delimiters unsigned int eatwhite =3D srt.find_first_not_of(' '); srt =3D srt.substr(eatwhite,srt.length()); char start =3D srt[0]; // the starting delimiter is now the first cha= r in srt =20 srt =3D srt.substr(1,srt.length()); eatwhite =3D srt.find_first_not_of(' '); srt =3D srt.substr(eatwhite,srt.length()); char stop =3D srt[0]; // the ending delimiter is now the first char = in srt=20 // C++ uses 0 to start arrays and strings. It makes it easy to make F= OR=20 // loops for(int i =3D 0; i < length; i++) {code here} // You never want to end a loop on an i =3D=3D length there are two = many times=20 // when they don't match perfectly and you run the risk of going int= o=20 // an infinite loop. (Okay maybe not so much for an integer, but a float // or double has a good chance that won't match perfectly. So it is good // programming practice to just use '<' instead of '=3D=3D' . // Knowing that if you started the array at 1 you would // have for(int i=3D1; i < length+1; i++) { code here } doesn't look= to bad, // but when you get into multidimensional arrays, it gets harder to = get // the index number if you don't start at zero.=20 // Just learn to be standard... =20 if (debug) { =20 // Once again, if we need to see if the output is correct. std::cout << "\nStart Delimiter =3D " << start; std::cout << "\nStop Delimiter =3D " << stop; } // remove the delimiter specifiers so we can look for the search=20 // and replace words srt =3D srt.substr(2, srt.length()-1);=20 if (debug) std::cout << "\nsrt =3D " << srt << "\n"; // call the function getword_s to get the word(s) for the search part std::string search =3D getword_s(start, stop, srt, debug); if (debug) std::cout << "\n"; // call the function getword_s to get the word(s) for the replace part std::string replace =3D getword_s(start, stop, srt, debug); =20 if (debug) { std::cout << "\n\nText: \n" << text; std::cout << "\n\nThe word(s) to search for is/are : \"" << search= << "\""; std::cout << "\nThe word(s) to replace with is/are: \"" << replace = << "\""; std::cout << "\n"; } // You better check to see that what your searching for is there befor= e // you try to replace it. If it is not there you can't replace it, and // your program will terminate before you can view any std::cout da= ta. if (text.length() > text.find(search)) { //THIS IS IT - THE WHOLE PROGRAM IS MADE FOR THIS LINE TO DO ITS WORK // Find the search word(s) in the text, and replace it with the word(= s) // stored in the variable replace, (not to be confused with the call = of the=20 // function text.replace()) for a length of the original word(s). =20 // Note the string will be expanded as necessary for the replacement = to fit. =20 // If the search word is not found, it cannot be replaced!! text =3D text.replace(text.find(search), search.length(), replace)= ; } std::cout << "\n"; } int main(void) { bool debug =3D false; // toggle to see more details std::string original =3D "I will be 40 next year."; std::string new_text =3D original; // Oh yeah - here I am experimenting with vectors of strings // Vectors are almost like arrays, but better std::vector<std::string>srt(4); // srt - search and replace text // Test no match condition srt[0] =3D " < > <35> <34>"; // Test replace with same size srt[1] =3D " ( ) (40) (38)"; // Test replace with smaller size srt[2] =3D "[ ] [ 38] []"; // Test replace with a bigger text srt[3] =3D "[] [next] [a very old man next]"; =20 for(int i =3D 0; i < 4; i++) { std::cout << "\nsrt =3D " << srt[i]; search_and_replace(new_text, srt[i], debug); =20 std::cout << "\nOriginal text: " << original; std::cout << "\nNew text: " << new_text; if (debug) { std::cout << "\n\n\n\n"; system("pause"); } else std::cout << "\n\n"; original =3D new_text; } if (!(debug)) system("pause"); return 0; =20 } // I hoped you like the way I use debug to show whats going on // I am finally getting the hang of the STL .. well a little bit anyway. // It took me forever to get some of the syntax right, but now learning c= an=20 // happen. And if its too late to learn there is alway cut and paste. // Praise God for His Goodness and Mercy // Jay A. Carlson -----Original Message----- From: dev...@li... [mailto:dev...@li...] Sent: Monday, June 23, 2003 9:30 AM To: dev...@li... Subject: Dev-cpp-users digest, Vol 1 #1511 - 6 msgs 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. Re: Comment Delimiters (Damien .) 2. RE: Comment Delimiters (Per Westermark) 3. Re: Comment Delimiters (Per Westermark) 4. Re: Comment Delimiters (Daniel Glenfield) 5. Re: WRITING TO SERIAL PORT (Daniel Glenfield) 6. Re: FREE download: a HOW-TO use wxWindows with Dev-C++ (Brian Ackermann) -- __--__-- Message: 1 From: "Damien ." <g_...@ho...> To: dev...@li... Subject: Re: [Dev-C++] Comment Delimiters Date: Mon, 23 Jun 2003 06:41:24 -0400 Guys, How exactly does '#if 0' ...#endif work? I assumed that the=20 preprocessor would skip the statements until it reached the #endif. =20 However, when I tried to compile the code(with gcc 3.2.2) below , i get = a=20 "missing terminator character ' error" . It seems as though the code ins= ide of an #if 0...#endif statement must be C/C++ accurate. It is easy fixed=20 with a /*... */ .Care to elaborate....? /* IfZero.c */ #include <stdio.h> int main(void) { #if 0 This line should not be worried about. I'm quite sure it will *not* be =20 included. #endif printf("..."); return 0; } ----Original Message Follows---- From: "Daniel Glenfield" <sp...@ho...> To: or...@vp..., dev...@li... Subject: Re: [Dev-C++] Comment Delimiters Date: Mon, 23 Jun 2003 09:16:30 +0100 Agreed. #if 0 ..#endif is a great way of doing it. >From: OROSZI Bal=E1zs <or...@vp...> >To: dev...@li... >Subject: Re: [Dev-C++] Comment Delimiters >Date: Mon, 23 Jun 2003 10:01:54 +0200 > >Andr=E9 Mac=E1rio Barros wrote: >>Dear Users, >> >> Suppose you can=B4t use the /* and */ comment delimiters to put in comments >>an area of a code in C++. >> If I use the // command, must I put them in each line of this piece of >>code? >> Is there another way? > >There is a quick way: > >#if 0 >... >#endif > >Because "0" is "false", #if 0 can be considered like if (false){...}, wh= ich >will in fact, never execute. So all code, with or without comments, will= =20 >not be parsed by the C preprocessor there. > >This approach is also better, because /* */ comments cannot be nested. > >-- >Greetings, > Bal=E1zs > > > >------------------------------------------------------- >This SF.Net email is sponsored by: INetU >Attention Web Developers & Consultants: Become An INetU Hosting Partner. >Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! >INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php >_______________________________________________ >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 _________________________________________________________________ On the move? Get Hotmail on your mobile phone http://www.msn.co.uk/msnmob= ile ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php _______________________________________________ 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 _________________________________________________________________ The new MSN 8: advanced junk mail protection and 2 months FREE*=20 http://join.msn.com/?page=3Dfeatures/junkmail -- __--__-- Message: 2 Date: Mon, 23 Jun 2003 13:45:45 +0200 (CEST) From: Per Westermark <pw...@ia...> To: Ioannis Vranos <iv...@em...> cc: Dev-C++ Mailing List <dev...@li...> Subject: RE: [Dev-C++] Comment Delimiters Yes, it is always good to have definned coding rules for new projects, but: 1 - /* */ doesn't support nesting except for some compilers. 2 - it is not uncommon for a project to inherrit code, and that code migh= t use /* */ or might even be in C. The only two safe methods of deactivating a large block of code is to either delete the lines, or to #ifdef them. With good source control, the code delete is preferable since it's WYSIWYG. However, a lot of people doesn't use CVS or SourceSafe et. al at home, and then it is very easy to permanently loose deleted code lines. /Per W On Mon, 23 Jun 2003, Ioannis Vranos wrote: > > -----Original Message----- > > From: Per Westermark [mailto:pw...@ia...] On Behalf > > Of Per Westermark > > Sent: Monday, June 23, 2003 11:56 AM > > To: Ioannis Vranos > > Cc: 'Dev-Cpp-Users' > > Subject: RE: [Dev-C++] Comment Delimiters > > > > > > Often the one asking a question don't really know exactly > > what they want - > > or at least doesn't specify it clearly enough. > > > > Yes, multiline comments should of course use /* ... */ but > > very often when > > someone gets bothered about commenting away a large number of > > lines, they > > are not thinking about a big block-comment, but a large block > > of unwanted > > code. > > > I did not understand what you mean but a very good commenting style is this: > > > For comments use only //. > > Use /* */ only for debugging purposes. > > > > > Ioannis Vranos > > * Programming pages: http://www.noicys.freeurl.com > * Alternative URL 1: http://run.to/noicys > * Alternative URL 2: http://www.noicys.cjb.net > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU Hosting Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission= ! > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > _______________________________________________ > 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 > -- __--__-- Message: 3 Date: Mon, 23 Jun 2003 13:57:42 +0200 (CEST) From: Per Westermark <pw...@ia...> To: "Damien ." <g_...@ho...> cc: dev...@li... Subject: Re: [Dev-C++] Comment Delimiters Normally you can put just about anything within the #ifdef/#endif or #if/#endif block - except that you should be a bit carefull about lines that ends with a \ or lines that start with #. Even in a undefined block, the preprocessor will expect \ at the end of the line to mean a line-continuation with, if the next source line contains the #endif will spell trouble. Since the compiler supports nested #ifdef constructs, any #ifdef, #if, #else, #endif etc. might seriously affect the size of the deactivated block. /Per W On Mon, 23 Jun 2003, Damien . wrote: > Guys, How exactly does '#if 0' ...#endif work? I assumed that the > preprocessor would skip the statements until it reached the #endif. > However, when I tried to compile the code(with gcc 3.2.2) below , i ge= t =3D a > "missing terminator character ' error" . It seems as though the code i= ns=3D ide > of an #if 0...#endif statement must be C/C++ accurate. It is easy fixe= d > with a /*... */ .Care to elaborate....? > /* IfZero.c */ > #include <stdio.h> > int main(void) > { > #if 0 > This line should not be worried about. I'm quite sure it will *not* be > included. > #endif > printf("..."); > return 0; > } > > ----Original Message Follows---- > From: "Daniel Glenfield" <sp...@ho...> > To: or...@vp..., dev...@li... > Subject: Re: [Dev-C++] Comment Delimiters > Date: Mon, 23 Jun 2003 09:16:30 +0100 > > Agreed. #if 0 ..#endif is a great way of doing it. > > > >From: OROSZI Bal=3DE1zs <or...@vp...> > >To: dev...@li... > >Subject: Re: [Dev-C++] Comment Delimiters > >Date: Mon, 23 Jun 2003 10:01:54 +0200 > > > >Andr=3DE9 Mac=3DE1rio Barros wrote: > >>Dear Users, > >> > >>=3D09Suppose you can=3DB4t use the /* and */ comment delimiters to pu= t in c=3D omments > >>an area of a code in C++. > >>=3D09If I use the // command, must I put them in each line of this pi= ece =3D of > >>code? > >> Is there another way? > > > >There is a quick way: > > > >#if 0 > >... > >#endif > > > >Because "0" is "false", #if 0 can be considered like if (false){...}, = wh=3D ich > >will in fact, never execute. So all code, with or without comments, wi= ll > >not be parsed by the C preprocessor there. > > > >This approach is also better, because /* */ comments cannot be nested. > > > >-- > >Greetings, > > Bal=3DE1zs > > > > > > > >------------------------------------------------------- > >This SF.Net email is sponsored by: INetU > >Attention Web Developers & Consultants: Become An INetU Hosting Partne= r. > >Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commissio= n! > >INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > >_______________________________________________ > >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 > > _________________________________________________________________ > On the move? Get Hotmail on your mobile phone http://www.msn.co.uk/msnm= ob=3D ile > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU Hosting Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission= ! > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > _______________________________________________ > 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 > > _________________________________________________________________ > The new MSN 8: advanced junk mail protection and 2 months FREE* > http://join.msn.com/?page=3D3Dfeatures/junkmail > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU Hosting Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission= ! > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > _______________________________________________ > 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 > -- __--__-- Message: 4 From: "Daniel Glenfield" <sp...@ho...> To: g_...@ho..., dev...@li... Subject: Re: [Dev-C++] Comment Delimiters Date: Mon, 23 Jun 2003 13:21:14 +0100 #if 0 cout << "This code will not be compiled, but I don't know if it needs to = be=20 syntactically correct or not. Probably does" << endl; #endif Yes I know I've forgotten to #include the iostream header. >From: "Damien ." <g_...@ho...> >To: dev...@li... >Subject: Re: [Dev-C++] Comment Delimiters >Date: Mon, 23 Jun 2003 06:41:24 -0400 > >Guys, How exactly does '#if 0' ...#endif work? I assumed that the=20 >preprocessor would skip the statements until it reached the #endif. =20 >However, when I tried to compile the code(with gcc 3.2.2) below , i get= a=20 >"missing terminator character ' error" . It seems as though the code=20 >inside of an #if 0...#endif statement must be C/C++ accurate. It is eas= y=20 >fixed with a /*... */ .Care to elaborate....? >/* IfZero.c */ >#include <stdio.h> >int main(void) >{ >#if 0 >This line should not be worried about. I'm quite sure it will *not* be =20 >included. >#endif >printf("..."); >return 0; >} > >----Original Message Follows---- >From: "Daniel Glenfield" <sp...@ho...> >To: or...@vp..., dev...@li... >Subject: Re: [Dev-C++] Comment Delimiters >Date: Mon, 23 Jun 2003 09:16:30 +0100 > >Agreed. #if 0 ..#endif is a great way of doing it. > > >>From: OROSZI Bal=E1zs <or...@vp...> >>To: dev...@li... >>Subject: Re: [Dev-C++] Comment Delimiters >>Date: Mon, 23 Jun 2003 10:01:54 +0200 >> >>Andr=E9 Mac=E1rio Barros wrote: >>>Dear Users, >>> >>> Suppose you can=B4t use the /* and */ comment delimiters to put in=20 >>>comments >>>an area of a code in C++. >>> If I use the // command, must I put them in each line of this piece of >>>code? >>> Is there another way? >> >>There is a quick way: >> >>#if 0 >>... >>#endif >> >>Because "0" is "false", #if 0 can be considered like if (false){...},=20 >>which will in fact, never execute. So all code, with or without comment= s,=20 >>will not be parsed by the C preprocessor there. >> >>This approach is also better, because /* */ comments cannot be nested. >> >>-- >>Greetings, >> Bal=E1zs >> >> >> >>------------------------------------------------------- >>This SF.Net email is sponsored by: INetU >>Attention Web Developers & Consultants: Become An INetU Hosting Partner. >>Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission= ! >>INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php >>_______________________________________________ >>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 > >_________________________________________________________________ >On the move? Get Hotmail on your mobile phone=20 >http://www.msn.co.uk/msnmobile > > > >------------------------------------------------------- >This SF.Net email is sponsored by: INetU >Attention Web Developers & Consultants: Become An INetU Hosting Partner. >Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! >INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php >_______________________________________________ >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 > >_________________________________________________________________ >The new MSN 8: advanced junk mail protection and 2 months FREE*=20 >http://join.msn.com/?page=3Dfeatures/junkmail > > > >------------------------------------------------------- >This SF.Net email is sponsored by: INetU >Attention Web Developers & Consultants: Become An INetU Hosting Partner. >Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! >INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php >_______________________________________________ >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 _________________________________________________________________ Find a cheaper internet access deal - choose one to suit you.=20 http://www.msn.co.uk/internetaccess -- __--__-- Message: 5 From: "Daniel Glenfield" <sp...@ho...> To: MDo...@OL..., dev...@li... Subject: Re: [Dev-C++] WRITING TO SERIAL PORT Date: Mon, 23 Jun 2003 13:28:07 +0100 I'm not entirely sure of the syntax but... In DOS (command prompt) you can do nmake DebugBuild > LPT1 to send output of the DebugBuild "build" to the printer attached to LPT1.= =20 I'm not sure about how you could tie this in with your project though... >From: Dondolo Mpho <MDo...@OL...> >To: dev...@li... >Subject: [Dev-C++] WRITING TO SERIAL PORT >Date: Mon, 23 Jun 2003 10:23:36 +0200 > >Hi all, > >I have been playing around with streams and need the following help. >I am able to print my files to our network printer and also write them t= o >specific network drives. >How do I write a device in one of my ports...eg, serial port >consider this code as an example. > > > >ofstream create(" \\omcwca054\\HPLJ5000 <file://\\omcwca054\\HPLJ5000> "= ) >cout<<"The following will be printed to on lazer jet printer"; >create<<" Mpho Dondolo\n" > <<" 45 Durban Ridge\n" > <<"Tyger Valley\n"; >create.close(); > >I want to write to my matrix display board that is connected to my seria= l >port. > >NB!!!! Please do not flip if have not supplied sufficient info. ( last i= =20 >did >that, some guy almost had a heart attack) I am still new at this game > > _________________________________________________________________ Get Hotmail on your mobile phone http://www.msn.co.uk/msnmobile -- __--__-- Message: 6 Date: Mon, 23 Jun 2003 12:26:20 -0500 From: Brian Ackermann <bri...@gm...> CC: dev...@li... Subject: Re: [Dev-C++] FREE download: a HOW-TO use wxWindows with Dev-C++ This is a multi-part message in MIME format. --------------000300010007070605010009 Content-Type: text/plain; charset=3Dus-ascii; format=3Dflowed Content-Transfer-Encoding: 7bit Well, here's the part that works... =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D bja3622@ANN /c/wx/samples/minimal $ make -f makefile.unx c++ -c `wx-config --cxxflags` -o minimal.o=20 minimal.cpp c++ -o minimal minimal.o `wx-config --libs` =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D and my flags look like this :: bja3622@ANN /c/wx/samples/minimal $ wx-config --cxxflags -I/usr/local/lib/wx/include/mswd-2.5 -D__WXDEBUG__ -D__WXMSW__ -mthreads=20 -fno-pcc-struct-return bja3622@ANN /c/wx/samples/minimal $ wx-config --libs -L/usr/local/lib -Wl,--subsystem,windows -mwindows -mthreads =20 /usr/local/lib/libwxmsw250d.a -ltiff -lrpcrt4 -loleaut32 -lole32 -luuid=20 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lwsock32 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D And this is the make output from Dev-Cpp $ make -f makefile.win g++.exe -c minimal.cpp -o minimal.o -I"C:/Dev-Cpp/include/c++" =20 -I"C:/Dev-Cpp/include/c++/mingw32" -I"C:/Dev-Cpp/include/c++/backward" =20 -I"C:/Dev-Cpp/include" -I"C:/msys/1.0/local/include" =20 -I"C:/msys/1.0/local/lib/wx/include/mswd-2.5" -D__WXDEBUG__ =20 -D__WXMSW__ -D__GNUWIN32__ -mthreads -fno-pcc-struct-return=20 windres.exe -i Project2_private.rc -I rc -o Project2_private.res -O=20 coff --include-dir C:/msys/1.0/local/include g++.exe minimal.o Project2_private.res -o "Project2.exe"=20 -L"C:/Dev-Cpp/lib" -L"C:/msys/1.0/local/lib/wx" -mwindows=20 -Wl,--subsystem,windows -mwindows -mthreads =20 C:/wx/mswd/lib/libwxmsw250d.a -ltiff -lrpcrt4 -loleaut32 -lole32 =20 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 =20 -ladvapi32 -lwsock32 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D Aside from the inclusion of -D__GNUWIN32__ the compiler options are the=20 same (plus a bunch of include directories, maybe relevant, maybe not...I=20 don't know how to tell) Same story with the libs too...the only difference is the -L"..." flags..= .. I guess the culprit must be right here.... Brian Ackermann Yeoh HS wrote: >----- Original Message ----- >From: "Brian Ackermann" <bri...@gm...> >To: <dev...@li...> >Sent: Friday, June 20, 2003 10:14 PM >Subject: Re: [Dev-C++] FREE download: a HOW-TO use wxWindows with Dev-C+= + > > > =20 > >>Yeoh, and others >> >>I've done according to the instructions in this document, and, >>unfortunately I get the same problem I had gotten before. The >>application compiles (but Dev-Cpp cannot run it, I must go through the >>explorer for that...) but when it executes, immediately it generates an >>error >> >>The exception unknown software exception (0xc00000fd) occurred in the >>application at location 0x0040d40d. >> >>However, the application will compile if I do a "make -f makefile.unx" >>the application compiles AND RUNS just fine.... >> >>Where am I going wrong? >> >>Brian Ackermann >> >> >> =20 >> >Hi Brian, > >I see from your compile log that you've built the debug version of versi= on >2.5.0. When you created your Dev-C++ project, where did you get the compiler >defines and linker flags? Is it from the wx-config file? > >When you do "make -f makefile.unx", the wx-config file is used in the bu= ild >process. >Since this works, you might want to take a look at wx-config file to see the >compiler defines and linker flags and compare them with your Dev-C++ project >settings. > >Best Regards, >Yeoh >-- >P.S. I'm off on a trip, so will be away from the pc for a week or so. :-= ) > > > > >------------------------------------------------------- >This SF.Net email is sponsored by: INetU >Attention Web Developers & Consultants: Become An INetU Hosting Partner. >Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! >INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php >_______________________________________________ >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 > > > =20 > --------------000300010007070605010009 Content-Type: text/html; charset=3Dus-ascii Content-Transfer-Encoding: 7bit <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv=3D"Content-Type" content=3D"text/html;charset=3DISO-88= 59-1"> <title></title> </head> <body text=3D"#000000" bgcolor=3D"#ffffff"> Well, here's the part that works... <br> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D <br> bja3622@ANN /c/wx/samples/minimal <br> $ make -f makefile.unx c++ -c `wx-config --cxxfla= gs` -o minimal.o minimal.cpp <br> c++ -o minimal minimal.o `wx-config --libs` <br> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D <br> and my flags look like this :: <br> <br> bja3622@ANN /c/wx/samples/minimal <br> $ wx-config --cxxflags <br> -I/usr/local/lib/wx/include/mswd-2.5 -D__WXDEBUG__ -D__WXMSW__ -mthreads -fno-pcc-struct-return <br> <br> bja3622@ANN /c/wx/samples/minimal <br> $ wx-config --libs <br> -L/usr/local/lib -Wl,--subsystem,windows -mwindows -mthreads /usr/local/lib/libwxmsw250d.a -ltiff -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lwsock32 <b= r> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D <br> And this is the make output from Dev-Cpp <br> $ make -f makefile.win <br> g++.exe -c minimal.cpp -o minimal.o -I"C:/Dev-Cpp/include/c++" -I"C:/Dev-Cpp/include/c++/mingw32" -I"C:/Dev-Cpp/include/c++/backward" -I"C:/Dev-Cpp/include" -I"C:/msys/1.0/local/include" -I"C:/msys/1.0/local/lib/wx/include/mswd-2.5" -D__WXDEBUG__ -D__WXMSW__ -D__GNUWIN32__ -mthreads -fno-pcc-struct-return windres.exe -i Project2_private.rc -I rc -o Project2_private.res -O coff --include-dir C:/msys/1.0/local/include <br> g++.exe minimal.o Project2_private.res -o "Project2.exe" -L"C:/Dev-Cpp/lib" -L"C:/msys/1.0/local/lib/wx" -mwindows -Wl,--subsystem,windows -mwindows -mthreads C:/wx/mswd/lib/libwxmsw250d.a -ltiff -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32&nb= sp; -lctl3d32 -ladvapi32 -lwsock32 <br> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D <br> Aside from the inclusion of -D__GNUWIN32__ the compiler options are the same (plus a bunch of include directories, maybe relevant, maybe not...I don't know how to tell) <br> <br> Same story with the libs too...the only difference is the -L"..." flags.... <br> <br> I guess the culprit must be right here.... <br> <br> Brian Ackermann <br> <br> <br> <br> <br> Yeoh HS wrote:<br> <blockquote type=3D"cite" cite=3D"mid00a601c33795$086caae0$c96a8ea1@local= pc"> <pre wrap=3D"">----- Original Message ----- From: "Brian Ackermann" <a class=3D"moz-txt-link-rfc2396E" href=3D"mailto:bri...@gm..."><bri...@gm...></a> To: <a class=3D"moz-txt-link-rfc2396E" href=3D"mailto:dev...@li..."><dev-cpp-users@lis= ts.so urceforge.net></a> Sent: Friday, June 20, 2003 10:14 PM Subject: Re: [Dev-C++] FREE download: a HOW-TO use wxWindows with Dev-C++ </pre> <blockquote type=3D"cite"> <pre wrap=3D"">Yeoh, and others I've done according to the instructions in this document, and, unfortunately I get the same problem I had gotten before. The application compiles (but Dev-Cpp cannot run it, I must go through the explorer for that...) but when it executes, immediately it generates an error The exception unknown software exception (0xc00000fd) occurred in the application at location 0x0040d40d. However, the application will compile if I do a "make -f makefile.unx" the application compiles AND RUNS just fine.... Where am I going wrong? Brian Ackermann </pre> </blockquote> <pre wrap=3D""><!---->Hi Brian, I see from your compile log that you've built the debug version of versio= n 2.5.0. When you created your Dev-C++ project, where did you get the compi= ler defines and linker flags? Is it from the wx-config file? When you do "make -f makefile.unx", the wx-config file is used in the bui= ld process. Since this works, you might want to take a look at wx-config file to see = the compiler defines and linker flags and compare them with your Dev-C++ proj= ect settings. Best Regards, Yeoh -- P.S. I'm off on a trip, so will be away from the pc for a week or so. :-) ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partn= er. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting <a class=3D"moz-txt-link-freetext" href=3D"http://www.inetu.net/partner/index.php">http://www.inetu.net/part= ner/i ndex.php</a> _______________________________________________ Dev-cpp-users mailing list <a class=3D"moz-txt-link-abbreviated" href=3D"mailto:Dev...@li...">Dev-cpp-users@lists.s= ource forge.net</a> TO UNSUBSCRIBE: <a class=3D"moz-txt-link-freetext" href=3D"http://www.noicys.cjb.net/devcpp/ub.htm">http://www.noicys.cjb.ne= t/dev cpp/ub.htm</a> <a class=3D"moz-txt-link-freetext" href=3D"https://lists.sourceforge.net/lists/listinfo/dev-cpp-users">https= ://li sts.sourceforge.net/lists/listinfo/dev-cpp-users</a> </pre> </blockquote> </body> </html> --------------000300010007070605010009-- -- __--__-- _______________________________________________ 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 --__--__-- _______________________________________________ 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 |
From: staale <st...@le...> - 2003-06-25 22:05:28
|
Hi all, Is there a DevPak repository where we can post (get..:o) DevPak's? Best Regards Staale |
From: CARLSON, J. M. <CA...@st...> - 2003-06-25 20:57:50
|
// Search and Replace Function // Praise God for His Goodness and Mercy // 22 June 2003 // Jay A Carlson // Search and Replace Implementation and Testing // // Takes an input text and replacement text and makes it happen // In the future I will have an input text file and a change file // to end up with a new converted file. // // The specifications take the form of=20 // start delimiter, stop delimiter // start and stop delimiters must be different although not check (yet)=20 // search and replace words inside of the start and stop delimiter= s=20 // search - can be any text, number, word, or a phrase // replace - can be any text, number, word, or phrase // examples are as below: // <> <search for this> <replace with this>; // [] [search] [replace] // <> <myArray[9]> <thisArray[10]> // ^* ^std::cout<<test[5];* ^printf("test[3]");* // // Notice by being able to specify the start and stop delimiters for each= =20 // search and replace you don't have to worry about nesting problems = or=20 // escape sequence problems. // // abbreviations // srt -- search and replace text // // personal notes: I did this for two reasons, // 1. To learn how to manipulate C++ std::strings, and I am now just getting // the hang of it. // 2. I actually need this for a specific purpose // // It could be used to replace >>>>>>> on email with ' ' or "". // // I am posting this on the internet for new people so they won't have = to=20 // try and figure this all out from scratch. It took me a long time and // in general I know how to program but the std::library stuff is taking // me longer than I thought to learn. //=20 // A REAL programmer probably wouldn't comment any of this because it i= s // probably obvious. I am going to comment the heck out of it to he= lp // new people and maybe myself. // // Because there are so many comments you might have to save two copies= , // one with the comments, and one with a lot of the comments stripped out. #include <iostream> // for std::cout #include <string> // for std::string #include <vector> // guess what - for vectors // this is a function whose sole purpose in life is to get the word, or words // between the delimiters represented by the variables start and stop // srt -- search and replace text // debug -- a way of showing more or less information in a hurry std::string getword_s(char start, char stop, std::string &srt, const bool debug)=20 { // \n - means put in a new line // srt - same as above if (debug) std::cout << "\nsrt =3D " << srt;=20 // I used unsigned int for first, last and len, // I may have been able to use std::string::iterator instead // but why would I want to type even more than I am now. // I am sure for sorting iterators would be the way to go. unsigned int first =3D srt.find_first_of(start) + 1; unsigned int last =3D srt.find_first_of(stop) - 1; unsigned int len =3D last - first + 1; // length of word(s) between delimiters // get the substring of srt, starting at position first (delimeter +1) and // go for len charachers. If len is larger than the string srt it will // just stop at the end. std::string word =3D srt.substr(first, len);=20 // now that we got the word(s) we wanted out between the delimiters, i= t is=20 // time to remove that section so that we can work with the next part,= if // any. Once again the substring will stop at the end of the string,=20 // regaurdless of where length() tells it to stop. srt =3D srt.substr(last + 2, srt.length()); // just so we can monitor to see that everything is working ok if (debug) std::cout << "\nword(s) =3D " << word; return word; } =20 // the name says it all =20 void search_and_replace(std::string &text, std::string &srt, const bool debug) { // I didn't want an accidental space to cause the program to glitch // so in the next few lines I remove all spaces before delimiters. // This also simplfied getting the delimiters unsigned int eatwhite =3D srt.find_first_not_of(' '); srt =3D srt.substr(eatwhite,srt.length()); char start =3D srt[0]; // the starting delimiter is now the first cha= r in srt =20 srt =3D srt.substr(1,srt.length()); eatwhite =3D srt.find_first_not_of(' '); srt =3D srt.substr(eatwhite,srt.length()); char stop =3D srt[0]; // the ending delimiter is now the first char = in srt=20 // C++ uses 0 to start arrays and strings. It makes it easy to make F= OR=20 // loops for(int i =3D 0; i < length; i++) {code here} // You never want to end a loop on an i =3D=3D length there are two = many times=20 // when they don't match perfectly and you run the risk of going int= o=20 // an infinite loop. (Okay maybe not so much for an integer, but a float // or double has a good chance that won't match perfectly. So it is good // programming practice to just use '<' instead of '=3D=3D' . // Knowing that if you started the array at 1 you would // have for(int i=3D1; i < length+1; i++) { code here } doesn't look= to bad, // but when you get into multidimensional arrays, it gets harder to = get // the index number if you don't start at zero.=20 // Just learn to be standard... =20 if (debug) { =20 // Once again, if we need to see if the output is correct. std::cout << "\nStart Delimiter =3D " << start; std::cout << "\nStop Delimiter =3D " << stop; } // remove the delimiter specifiers so we can look for the search=20 // and replace words srt =3D srt.substr(2, srt.length()-1);=20 if (debug) std::cout << "\nsrt =3D " << srt << "\n"; // call the function getword_s to get the word(s) for the search part std::string search =3D getword_s(start, stop, srt, debug); if (debug) std::cout << "\n"; // call the function getword_s to get the word(s) for the replace part std::string replace =3D getword_s(start, stop, srt, debug); =20 if (debug) { std::cout << "\n\nText: \n" << text; std::cout << "\n\nThe word(s) to search for is/are : \"" << search= << "\""; std::cout << "\nThe word(s) to replace with is/are: \"" << replace = << "\""; std::cout << "\n"; } // You better check to see that what your searching for is there befor= e // you try to replace it. If it is not there you can't replace it, and // your program will terminate before you can view any std::cout da= ta. if (text.length() > text.find(search)) { //THIS IS IT - THE WHOLE PROGRAM IS MADE FOR THIS LINE TO DO ITS WORK // Find the search word(s) in the text, and replace it with the word(= s) // stored in the variable replace, (not to be confused with the call = of the=20 // function text.replace()) for a length of the original word(s). =20 // Note the string will be expanded as necessary for the replacement = to fit. =20 // If the search word is not found, it cannot be replaced!! text =3D text.replace(text.find(search), search.length(), replace)= ; } std::cout << "\n"; } int main(void) { bool debug =3D false; // toggle to see more details std::string original =3D "I will be 40 next year."; std::string new_text =3D original; // Oh yeah - here I am experimenting with vectors of strings // Vectors are almost like arrays, but better std::vector<std::string>srt(4); // srt - search and replace text // Test no match condition srt[0] =3D " < > <35> <34>"; // Test replace with same size srt[1] =3D " ( ) (40) (38)"; // Test replace with smaller size srt[2] =3D "[ ] [ 38] []"; // Test replace with a bigger text srt[3] =3D "[] [next] [a very old man next]"; =20 for(int i =3D 0; i < 4; i++) { std::cout << "\nsrt =3D " << srt[i]; search_and_replace(new_text, srt[i], debug); =20 std::cout << "\nOriginal text: " << original; std::cout << "\nNew text: " << new_text; if (debug) { std::cout << "\n\n\n\n"; system("pause"); } else std::cout << "\n\n"; original =3D new_text; } if (!(debug)) system("pause"); return 0; =20 } // I hoped you like the way I use debug to show whats going on // I am finally getting the hang of the STL .. well a little bit anyway. // It took me forever to get some of the syntax right, but now learning c= an=20 // happen. And if its too late to learn there is alway cut and paste. // Praise God for His Goodness and Mercy // Jay A. Carlson -----Original Message----- From: dev...@li... [mailto:dev...@li...] Sent: Monday, June 23, 2003 9:30 AM To: dev...@li... Subject: Dev-cpp-users digest, Vol 1 #1511 - 6 msgs 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. Re: Comment Delimiters (Damien .) 2. RE: Comment Delimiters (Per Westermark) 3. Re: Comment Delimiters (Per Westermark) 4. Re: Comment Delimiters (Daniel Glenfield) 5. Re: WRITING TO SERIAL PORT (Daniel Glenfield) 6. Re: FREE download: a HOW-TO use wxWindows with Dev-C++ (Brian Ackermann) --__--__-- Message: 1 From: "Damien ." <g_...@ho...> To: dev...@li... Subject: Re: [Dev-C++] Comment Delimiters Date: Mon, 23 Jun 2003 06:41:24 -0400 Guys, How exactly does '#if 0' ...#endif work? I assumed that the=20 preprocessor would skip the statements until it reached the #endif. =20 However, when I tried to compile the code(with gcc 3.2.2) below , i get = a=20 "missing terminator character ' error" . It seems as though the code ins= ide of an #if 0...#endif statement must be C/C++ accurate. It is easy fixed=20 with a /*... */ .Care to elaborate....? /* IfZero.c */ #include <stdio.h> int main(void) { #if 0 This line should not be worried about. I'm quite sure it will *not* be =20 included. #endif printf("..."); return 0; } ----Original Message Follows---- From: "Daniel Glenfield" <sp...@ho...> To: or...@vp..., dev...@li... Subject: Re: [Dev-C++] Comment Delimiters Date: Mon, 23 Jun 2003 09:16:30 +0100 Agreed. #if 0 ..#endif is a great way of doing it. >From: OROSZI Bal=E1zs <or...@vp...> >To: dev...@li... >Subject: Re: [Dev-C++] Comment Delimiters >Date: Mon, 23 Jun 2003 10:01:54 +0200 > >Andr=E9 Mac=E1rio Barros wrote: >>Dear Users, >> >> Suppose you can=B4t use the /* and */ comment delimiters to put in comments >>an area of a code in C++. >> If I use the // command, must I put them in each line of this piece of >>code? >> Is there another way? > >There is a quick way: > >#if 0 >... >#endif > >Because "0" is "false", #if 0 can be considered like if (false){...}, wh= ich >will in fact, never execute. So all code, with or without comments, will= =20 >not be parsed by the C preprocessor there. > >This approach is also better, because /* */ comments cannot be nested. > >-- >Greetings, > Bal=E1zs > > > >------------------------------------------------------- >This SF.Net email is sponsored by: INetU >Attention Web Developers & Consultants: Become An INetU Hosting Partner. >Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! >INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php >_______________________________________________ >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 _________________________________________________________________ On the move? Get Hotmail on your mobile phone http://www.msn.co.uk/msnmob= ile ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php _______________________________________________ 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 _________________________________________________________________ The new MSN 8: advanced junk mail protection and 2 months FREE*=20 http://join.msn.com/?page=3Dfeatures/junkmail --__--__-- Message: 2 Date: Mon, 23 Jun 2003 13:45:45 +0200 (CEST) From: Per Westermark <pw...@ia...> To: Ioannis Vranos <iv...@em...> cc: Dev-C++ Mailing List <dev...@li...> Subject: RE: [Dev-C++] Comment Delimiters Yes, it is always good to have definned coding rules for new projects, but: 1 - /* */ doesn't support nesting except for some compilers. 2 - it is not uncommon for a project to inherrit code, and that code migh= t use /* */ or might even be in C. The only two safe methods of deactivating a large block of code is to either delete the lines, or to #ifdef them. With good source control, the code delete is preferable since it's WYSIWYG. However, a lot of people doesn't use CVS or SourceSafe et. al at home, and then it is very easy to permanently loose deleted code lines. /Per W On Mon, 23 Jun 2003, Ioannis Vranos wrote: > > -----Original Message----- > > From: Per Westermark [mailto:pw...@ia...] On Behalf > > Of Per Westermark > > Sent: Monday, June 23, 2003 11:56 AM > > To: Ioannis Vranos > > Cc: 'Dev-Cpp-Users' > > Subject: RE: [Dev-C++] Comment Delimiters > > > > > > Often the one asking a question don't really know exactly > > what they want - > > or at least doesn't specify it clearly enough. > > > > Yes, multiline comments should of course use /* ... */ but > > very often when > > someone gets bothered about commenting away a large number of > > lines, they > > are not thinking about a big block-comment, but a large block > > of unwanted > > code. > > > I did not understand what you mean but a very good commenting style is this: > > > For comments use only //. > > Use /* */ only for debugging purposes. > > > > > Ioannis Vranos > > * Programming pages: http://www.noicys.freeurl.com > * Alternative URL 1: http://run.to/noicys > * Alternative URL 2: http://www.noicys.cjb.net > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU Hosting Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission= ! > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > _______________________________________________ > 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 > --__--__-- Message: 3 Date: Mon, 23 Jun 2003 13:57:42 +0200 (CEST) From: Per Westermark <pw...@ia...> To: "Damien ." <g_...@ho...> cc: dev...@li... Subject: Re: [Dev-C++] Comment Delimiters Normally you can put just about anything within the #ifdef/#endif or #if/#endif block - except that you should be a bit carefull about lines that ends with a \ or lines that start with #. Even in a undefined block, the preprocessor will expect \ at the end of the line to mean a line-continuation with, if the next source line contains the #endif will spell trouble. Since the compiler supports nested #ifdef constructs, any #ifdef, #if, #else, #endif etc. might seriously affect the size of the deactivated block. /Per W On Mon, 23 Jun 2003, Damien . wrote: > Guys, How exactly does '#if 0' ...#endif work? I assumed that the > preprocessor would skip the statements until it reached the #endif. > However, when I tried to compile the code(with gcc 3.2.2) below , i ge= t =3D a > "missing terminator character ' error" . It seems as though the code i= ns=3D ide > of an #if 0...#endif statement must be C/C++ accurate. It is easy fixe= d > with a /*... */ .Care to elaborate....? > /* IfZero.c */ > #include <stdio.h> > int main(void) > { > #if 0 > This line should not be worried about. I'm quite sure it will *not* be > included. > #endif > printf("..."); > return 0; > } > > ----Original Message Follows---- > From: "Daniel Glenfield" <sp...@ho...> > To: or...@vp..., dev...@li... > Subject: Re: [Dev-C++] Comment Delimiters > Date: Mon, 23 Jun 2003 09:16:30 +0100 > > Agreed. #if 0 ..#endif is a great way of doing it. > > > >From: OROSZI Bal=3DE1zs <or...@vp...> > >To: dev...@li... > >Subject: Re: [Dev-C++] Comment Delimiters > >Date: Mon, 23 Jun 2003 10:01:54 +0200 > > > >Andr=3DE9 Mac=3DE1rio Barros wrote: > >>Dear Users, > >> > >>=3D09Suppose you can=3DB4t use the /* and */ comment delimiters to pu= t in c=3D omments > >>an area of a code in C++. > >>=3D09If I use the // command, must I put them in each line of this pi= ece =3D of > >>code? > >> Is there another way? > > > >There is a quick way: > > > >#if 0 > >... > >#endif > > > >Because "0" is "false", #if 0 can be considered like if (false){...}, = wh=3D ich > >will in fact, never execute. So all code, with or without comments, wi= ll > >not be parsed by the C preprocessor there. > > > >This approach is also better, because /* */ comments cannot be nested. > > > >-- > >Greetings, > > Bal=3DE1zs > > > > > > > >------------------------------------------------------- > >This SF.Net email is sponsored by: INetU > >Attention Web Developers & Consultants: Become An INetU Hosting Partne= r. > >Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commissio= n! > >INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > >_______________________________________________ > >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 > > _________________________________________________________________ > On the move? Get Hotmail on your mobile phone http://www.msn.co.uk/msnm= ob=3D ile > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU Hosting Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission= ! > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > _______________________________________________ > 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 > > _________________________________________________________________ > The new MSN 8: advanced junk mail protection and 2 months FREE* > http://join.msn.com/?page=3D3Dfeatures/junkmail > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU Hosting Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission= ! > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > _______________________________________________ > 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 > --__--__-- Message: 4 From: "Daniel Glenfield" <sp...@ho...> To: g_...@ho..., dev...@li... Subject: Re: [Dev-C++] Comment Delimiters Date: Mon, 23 Jun 2003 13:21:14 +0100 #if 0 cout << "This code will not be compiled, but I don't know if it needs to = be=20 syntactically correct or not. Probably does" << endl; #endif Yes I know I've forgotten to #include the iostream header. >From: "Damien ." <g_...@ho...> >To: dev...@li... >Subject: Re: [Dev-C++] Comment Delimiters >Date: Mon, 23 Jun 2003 06:41:24 -0400 > >Guys, How exactly does '#if 0' ...#endif work? I assumed that the=20 >preprocessor would skip the statements until it reached the #endif. =20 >However, when I tried to compile the code(with gcc 3.2.2) below , i get= a=20 >"missing terminator character ' error" . It seems as though the code=20 >inside of an #if 0...#endif statement must be C/C++ accurate. It is eas= y=20 >fixed with a /*... */ .Care to elaborate....? >/* IfZero.c */ >#include <stdio.h> >int main(void) >{ >#if 0 >This line should not be worried about. I'm quite sure it will *not* be =20 >included. >#endif >printf("..."); >return 0; >} > >----Original Message Follows---- >From: "Daniel Glenfield" <sp...@ho...> >To: or...@vp..., dev...@li... >Subject: Re: [Dev-C++] Comment Delimiters >Date: Mon, 23 Jun 2003 09:16:30 +0100 > >Agreed. #if 0 ..#endif is a great way of doing it. > > >>From: OROSZI Bal=E1zs <or...@vp...> >>To: dev...@li... >>Subject: Re: [Dev-C++] Comment Delimiters >>Date: Mon, 23 Jun 2003 10:01:54 +0200 >> >>Andr=E9 Mac=E1rio Barros wrote: >>>Dear Users, >>> >>> Suppose you can=B4t use the /* and */ comment delimiters to put in=20 >>>comments >>>an area of a code in C++. >>> If I use the // command, must I put them in each line of this piece of >>>code? >>> Is there another way? >> >>There is a quick way: >> >>#if 0 >>... >>#endif >> >>Because "0" is "false", #if 0 can be considered like if (false){...},=20 >>which will in fact, never execute. So all code, with or without comment= s,=20 >>will not be parsed by the C preprocessor there. >> >>This approach is also better, because /* */ comments cannot be nested. >> >>-- >>Greetings, >> Bal=E1zs >> >> >> >>------------------------------------------------------- >>This SF.Net email is sponsored by: INetU >>Attention Web Developers & Consultants: Become An INetU Hosting Partner. >>Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission= ! >>INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php >>_______________________________________________ >>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 > >_________________________________________________________________ >On the move? Get Hotmail on your mobile phone=20 >http://www.msn.co.uk/msnmobile > > > >------------------------------------------------------- >This SF.Net email is sponsored by: INetU >Attention Web Developers & Consultants: Become An INetU Hosting Partner. >Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! >INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php >_______________________________________________ >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 > >_________________________________________________________________ >The new MSN 8: advanced junk mail protection and 2 months FREE*=20 >http://join.msn.com/?page=3Dfeatures/junkmail > > > >------------------------------------------------------- >This SF.Net email is sponsored by: INetU >Attention Web Developers & Consultants: Become An INetU Hosting Partner. >Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! >INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php >_______________________________________________ >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 _________________________________________________________________ Find a cheaper internet access deal - choose one to suit you.=20 http://www.msn.co.uk/internetaccess --__--__-- Message: 5 From: "Daniel Glenfield" <sp...@ho...> To: MDo...@OL..., dev...@li... Subject: Re: [Dev-C++] WRITING TO SERIAL PORT Date: Mon, 23 Jun 2003 13:28:07 +0100 I'm not entirely sure of the syntax but... In DOS (command prompt) you can do nmake DebugBuild > LPT1 to send output of the DebugBuild "build" to the printer attached to LPT1.= =20 I'm not sure about how you could tie this in with your project though... >From: Dondolo Mpho <MDo...@OL...> >To: dev...@li... >Subject: [Dev-C++] WRITING TO SERIAL PORT >Date: Mon, 23 Jun 2003 10:23:36 +0200 > >Hi all, > >I have been playing around with streams and need the following help. >I am able to print my files to our network printer and also write them t= o >specific network drives. >How do I write a device in one of my ports...eg, serial port >consider this code as an example. > > > >ofstream create(" \\omcwca054\\HPLJ5000 <file://\\omcwca054\\HPLJ5000> "= ) >cout<<"The following will be printed to on lazer jet printer"; >create<<" Mpho Dondolo\n" > <<" 45 Durban Ridge\n" > <<"Tyger Valley\n"; >create.close(); > >I want to write to my matrix display board that is connected to my seria= l >port. > >NB!!!! Please do not flip if have not supplied sufficient info. ( last i= =20 >did >that, some guy almost had a heart attack) I am still new at this game > > _________________________________________________________________ Get Hotmail on your mobile phone http://www.msn.co.uk/msnmobile --__--__-- Message: 6 Date: Mon, 23 Jun 2003 12:26:20 -0500 From: Brian Ackermann <bri...@gm...> CC: dev...@li... Subject: Re: [Dev-C++] FREE download: a HOW-TO use wxWindows with Dev-C++ This is a multi-part message in MIME format. --------------000300010007070605010009 Content-Type: text/plain; charset=3Dus-ascii; format=3Dflowed Content-Transfer-Encoding: 7bit Well, here's the part that works... =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D bja3622@ANN /c/wx/samples/minimal $ make -f makefile.unx c++ -c `wx-config --cxxflags` -o minimal.o=20 minimal.cpp c++ -o minimal minimal.o `wx-config --libs` =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D and my flags look like this :: bja3622@ANN /c/wx/samples/minimal $ wx-config --cxxflags -I/usr/local/lib/wx/include/mswd-2.5 -D__WXDEBUG__ -D__WXMSW__ -mthreads=20 -fno-pcc-struct-return bja3622@ANN /c/wx/samples/minimal $ wx-config --libs -L/usr/local/lib -Wl,--subsystem,windows -mwindows -mthreads =20 /usr/local/lib/libwxmsw250d.a -ltiff -lrpcrt4 -loleaut32 -lole32 -luuid=20 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lwsock32 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D And this is the make output from Dev-Cpp $ make -f makefile.win g++.exe -c minimal.cpp -o minimal.o -I"C:/Dev-Cpp/include/c++" =20 -I"C:/Dev-Cpp/include/c++/mingw32" -I"C:/Dev-Cpp/include/c++/backward" =20 -I"C:/Dev-Cpp/include" -I"C:/msys/1.0/local/include" =20 -I"C:/msys/1.0/local/lib/wx/include/mswd-2.5" -D__WXDEBUG__ =20 -D__WXMSW__ -D__GNUWIN32__ -mthreads -fno-pcc-struct-return=20 windres.exe -i Project2_private.rc -I rc -o Project2_private.res -O=20 coff --include-dir C:/msys/1.0/local/include g++.exe minimal.o Project2_private.res -o "Project2.exe"=20 -L"C:/Dev-Cpp/lib" -L"C:/msys/1.0/local/lib/wx" -mwindows=20 -Wl,--subsystem,windows -mwindows -mthreads =20 C:/wx/mswd/lib/libwxmsw250d.a -ltiff -lrpcrt4 -loleaut32 -lole32 =20 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 =20 -ladvapi32 -lwsock32 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D Aside from the inclusion of -D__GNUWIN32__ the compiler options are the=20 same (plus a bunch of include directories, maybe relevant, maybe not...I=20 don't know how to tell) Same story with the libs too...the only difference is the -L"..." flags..= .. I guess the culprit must be right here.... Brian Ackermann Yeoh HS wrote: >----- Original Message ----- >From: "Brian Ackermann" <bri...@gm...> >To: <dev...@li...> >Sent: Friday, June 20, 2003 10:14 PM >Subject: Re: [Dev-C++] FREE download: a HOW-TO use wxWindows with Dev-C+= + > > > =20 > >>Yeoh, and others >> >>I've done according to the instructions in this document, and, >>unfortunately I get the same problem I had gotten before. The >>application compiles (but Dev-Cpp cannot run it, I must go through the >>explorer for that...) but when it executes, immediately it generates an >>error >> >>The exception unknown software exception (0xc00000fd) occurred in the >>application at location 0x0040d40d. >> >>However, the application will compile if I do a "make -f makefile.unx" >>the application compiles AND RUNS just fine.... >> >>Where am I going wrong? >> >>Brian Ackermann >> >> >> =20 >> >Hi Brian, > >I see from your compile log that you've built the debug version of versi= on >2.5.0. When you created your Dev-C++ project, where did you get the compiler >defines and linker flags? Is it from the wx-config file? > >When you do "make -f makefile.unx", the wx-config file is used in the bu= ild >process. >Since this works, you might want to take a look at wx-config file to see the >compiler defines and linker flags and compare them with your Dev-C++ project >settings. > >Best Regards, >Yeoh >-- >P.S. I'm off on a trip, so will be away from the pc for a week or so. :-= ) > > > > >------------------------------------------------------- >This SF.Net email is sponsored by: INetU >Attention Web Developers & Consultants: Become An INetU Hosting Partner. >Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! >INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php >_______________________________________________ >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 > > > =20 > --------------000300010007070605010009 Content-Type: text/html; charset=3Dus-ascii Content-Transfer-Encoding: 7bit <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv=3D"Content-Type" content=3D"text/html;charset=3DISO-88= 59-1"> <title></title> </head> <body text=3D"#000000" bgcolor=3D"#ffffff"> Well, here's the part that works... <br> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D <br> bja3622@ANN /c/wx/samples/minimal <br> $ make -f makefile.unx c++ -c `wx-config --cxxfla= gs` -o minimal.o minimal.cpp <br> c++ -o minimal minimal.o `wx-config --libs` <br> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D <br> and my flags look like this :: <br> <br> bja3622@ANN /c/wx/samples/minimal <br> $ wx-config --cxxflags <br> -I/usr/local/lib/wx/include/mswd-2.5 -D__WXDEBUG__ -D__WXMSW__ -mthreads -fno-pcc-struct-return <br> <br> bja3622@ANN /c/wx/samples/minimal <br> $ wx-config --libs <br> -L/usr/local/lib -Wl,--subsystem,windows -mwindows -mthreads /usr/local/lib/libwxmsw250d.a -ltiff -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lwsock32 <b= r> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D <br> And this is the make output from Dev-Cpp <br> $ make -f makefile.win <br> g++.exe -c minimal.cpp -o minimal.o -I"C:/Dev-Cpp/include/c++" -I"C:/Dev-Cpp/include/c++/mingw32" -I"C:/Dev-Cpp/include/c++/backward" -I"C:/Dev-Cpp/include" -I"C:/msys/1.0/local/include" -I"C:/msys/1.0/local/lib/wx/include/mswd-2.5" -D__WXDEBUG__ -D__WXMSW__ -D__GNUWIN32__ -mthreads -fno-pcc-struct-return windres.exe -i Project2_private.rc -I rc -o Project2_private.res -O coff --include-dir C:/msys/1.0/local/include <br> g++.exe minimal.o Project2_private.res -o "Project2.exe" -L"C:/Dev-Cpp/lib" -L"C:/msys/1.0/local/lib/wx" -mwindows -Wl,--subsystem,windows -mwindows -mthreads C:/wx/mswd/lib/libwxmsw250d.a -ltiff -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32&nb= sp; -lctl3d32 -ladvapi32 -lwsock32 <br> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D <br> Aside from the inclusion of -D__GNUWIN32__ the compiler options are the same (plus a bunch of include directories, maybe relevant, maybe not...I don't know how to tell) <br> <br> Same story with the libs too...the only difference is the -L"..." flags.... <br> <br> I guess the culprit must be right here.... <br> <br> Brian Ackermann <br> <br> <br> <br> <br> Yeoh HS wrote:<br> <blockquote type=3D"cite" cite=3D"mid00a601c33795$086caae0$c96a8ea1@local= pc"> <pre wrap=3D"">----- Original Message ----- From: "Brian Ackermann" <a class=3D"moz-txt-link-rfc2396E" href=3D"mailto:bri...@gm..."><bri...@gm...></a> To: <a class=3D"moz-txt-link-rfc2396E" href=3D"mailto:dev...@li..."><dev-cpp-users@lis= ts.so urceforge.net></a> Sent: Friday, June 20, 2003 10:14 PM Subject: Re: [Dev-C++] FREE download: a HOW-TO use wxWindows with Dev-C++ </pre> <blockquote type=3D"cite"> <pre wrap=3D"">Yeoh, and others I've done according to the instructions in this document, and, unfortunately I get the same problem I had gotten before. The application compiles (but Dev-Cpp cannot run it, I must go through the explorer for that...) but when it executes, immediately it generates an error The exception unknown software exception (0xc00000fd) occurred in the application at location 0x0040d40d. However, the application will compile if I do a "make -f makefile.unx" the application compiles AND RUNS just fine.... Where am I going wrong? Brian Ackermann </pre> </blockquote> <pre wrap=3D""><!---->Hi Brian, I see from your compile log that you've built the debug version of versio= n 2.5.0. When you created your Dev-C++ project, where did you get the compi= ler defines and linker flags? Is it from the wx-config file? When you do "make -f makefile.unx", the wx-config file is used in the bui= ld process. Since this works, you might want to take a look at wx-config file to see = the compiler defines and linker flags and compare them with your Dev-C++ proj= ect settings. Best Regards, Yeoh -- P.S. I'm off on a trip, so will be away from the pc for a week or so. :-) ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partn= er. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting <a class=3D"moz-txt-link-freetext" href=3D"http://www.inetu.net/partner/index.php">http://www.inetu.net/part= ner/i ndex.php</a> _______________________________________________ Dev-cpp-users mailing list <a class=3D"moz-txt-link-abbreviated" href=3D"mailto:Dev...@li...">Dev-cpp-users@lists.s= ource forge.net</a> TO UNSUBSCRIBE: <a class=3D"moz-txt-link-freetext" href=3D"http://www.noicys.cjb.net/devcpp/ub.htm">http://www.noicys.cjb.ne= t/dev cpp/ub.htm</a> <a class=3D"moz-txt-link-freetext" href=3D"https://lists.sourceforge.net/lists/listinfo/dev-cpp-users">https= ://li sts.sourceforge.net/lists/listinfo/dev-cpp-users</a> </pre> </blockquote> </body> </html> --------------000300010007070605010009-- --__--__-- _______________________________________________ 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 |
From: <or...@vp...> - 2003-06-25 20:24:01
|
Jorge wrote: > I want to do a program that could connect to another machine and execute > a program inside this machine...the first part I do it , but I don't > know how execute the program in the remote machine... > > If anyone know how do that please write me... Why would you need to do it? People have already written a lot of "administrative" programs like what you want, for example: "Back Orifice". Search on Google for it. -- Greetings, Balázs :) |
From: Shane B. <ast...@te...> - 2003-06-25 19:17:45
|
There are numerous ways this can be done. The simplest of which I can = think would be a simple TCP socket application that has some level of = authentication to prevent people from running it illegally. Then, = simply have the program running on the server machine make a call to = system(). The framework for the application, I believe you conveyed you can = accomplish yourself, so the call to run the application on the server = would be system("c:\\myapplication.exe"), which will run a new shell and = start the new process through the shell. There are other means as well, but I believe this is the simplest. -Shane ----- Original Message -----=20 From: Jorge=20 To: dev...@li...=20 Sent: Wednesday, June 25, 2003 12:19 PM Subject: [Dev-C++] Remote. Hi. I want to do a program that could connect to another machine and = execute a program inside this machine...the first part I do it , but I = don't know how execute the program in the remote machine... If anyone know how do that please write me... |
From: Jorge <jor...@fa...> - 2003-06-25 18:21:35
|
Hi. I want to do a program that could connect to another machine and execute = a program inside this machine...the first part I do it , but I don't = know how execute the program in the remote machine... If anyone know how do that please write me... |
From: Jorge <jor...@fa...> - 2003-06-25 17:52:12
|
Hi to everyone. I ask if it could be posible execute a program into a remote = machine???? |
From: Jorge <jor...@fa...> - 2003-06-25 17:50:51
|
Hi to everyone. I ask if it could be posible execute a program into a remote = machine???? |
From: Ioannis V. <iv...@em...> - 2003-06-25 02:50:54
|
Hey, glad to see you. Have you received my emails? Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Colin Laplace > Sent: Wednesday, June 25, 2003 2:18 AM > To: dev...@li... > Subject: [Dev-C++] [UPDATE] Version 4.9.8.1 is available > > > Hello ! > > Just to say that version 4.9.8.1 is available, and is mainly > a bug-fix update. > We recommend you download it using the Check for Update > feature of Dev-C++ > (from the Tools menu), that way it will install automatically. > Otherwise, you can download it manually by going to : > http://bloodshed.net/dev/devcpp.html > > Greetings, > Colin Laplace > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU > Hosting Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly > Commission! > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > _______________________________________________ > 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 > |
From: John C. D. D. <jd...@ni...> - 2003-06-25 02:27:38
|
hello, i need to use the gsl in my program, but i'm having a linker error when i compile. i have placed the .dll files in /windows/system and some routines are working. but when i try to use the random numbers, there's a linker error. - john |
From: Colin L. <ha...@bl...> - 2003-06-24 23:24:44
|
Hello ! Just to say that version 4.9.8.1 is available, and is mainly a bug-fix update. We recommend you download it using the Check for Update feature of Dev-C++ (from the Tools menu), that way it will install automatically. Otherwise, you can download it manually by going to : http://bloodshed.net/dev/devcpp.html Greetings, Colin Laplace |
From: Abhijit S. <mu...@gm...> - 2003-06-24 21:26:03
|
Hello, Paulo. > Hi there! > Could somebody help me? > I must link compilation with -lcomctl32, how can i do this in dev-cpp? > I am implementing a win32 program with control tab. > Thank you. > Paulo You can go to `Project' > `Project Options' > `Parameters', and enter (or append) `-lcomctl32' in the `Linker' text-box. Another way to link in the library (but this will affect all compilations, not just the current project) is to go to `Tools' > `Compiler Options' and add the option in the box labelled `Add these commands to the linker command-line'. Also select the check-box. -- Abhijit Shylanath Homepage: http://mudeth.tripod.com/ |
From: Paulo-Fernando G. <pau...@se...> - 2003-06-24 20:43:03
|
Hi there! Could somebody help me? I must link compilation with -lcomctl32, how can i do this in dev-cpp? I am implementing a win32 program with control tab. Thank you. Paulo |
From: <jor...@fa...> - 2003-06-24 17:06:20
|
From: <jor...@fa...> - 2003-06-24 17:02:05
|
From: Ricardo A. <ri...@te...> - 2003-06-24 16:10:38
|
Shane Bryldt escribió: > I suppose a similar solution is possible with cin, the opposite to > cout. You can use cin.get() ;) -- --------------------------------------------------- Ricardo Amores Hernández ICQ: 19463735 MSN: zheo_ (at) hotmail (dot) es --------------------------------------------------- |
From: <or...@vp...> - 2003-06-24 07:59:47
|
Michael Shee wrote: > I don't know how to link more than one source codes files using the > devcpp ide graphical user > interface. Add more than one source code files to your project. -- Greetings, Balázs |
From: Michael S. <mic...@ho...> - 2003-06-24 04:41:01
|
Dear devcpp user, I don't know how to link more than one source codes files using the devcpp ide graphical user interface. However, i do know how to link the source code/object file using linux's gcc at command-line/ thank you very much _________________________________________________________________ Download the latest MSN Messenger http://messenger.msn.com.my |
From: Per W. <pw...@ia...> - 2003-06-23 19:23:37
|
Isn't it better with an answer to much, then to be met with deadly silence... At least as long as the answers aren't too contradicting. /Per W On Tue, 24 Jun 2003, Abhijit Shylanath wrote: > > Regarding my last post, sorry for repeating what everyone had already said. > I had just clicked `Send' when I noticed that many others had previously > replied. > > ONT. > > This being the Dev-C++ mailing-list, I have to mention that Dev has > short-cuts for doing this: > > Ctrl-Alt-. comments, > Ctrl-alt-, strips. > > This can be found under the `Edit' menu. > > -- > Abhijit Shylanath > Homepage: http://mudeth.tripod.com/ > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU Hosting Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > _______________________________________________ > 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 > |