--------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1R00010 Date: 01/21/98 From: PAT GLENN Time: 06:56pm \/To: RAY GEAR (Read 1 times) Subj: Borland c++ v 4.52 Ray, RG>I have just started to use Borland c++ and have a problem RG>with the first OWL programs that I have tried. I entered RG>the programs from "Teach yourself Borland C++ 4 in 21 RG>Days". Instead of entering the .rc files from the book I RG>used the Resource Workshop to create them. The first RG>program ran but did not display the menu created in RW. On RG>examing the .rh file produced by RW there was the line RG> #define MAINMENU 1 RG>I removed this line, recompiled the program and it worked??? RG> RG>The second program I entered was to display a dialog box. RG>Again I used the Resource Workshop to produce the dialog. RG>The program crashed with a GPF. On checking the .rh file RG>there was a line RG> #define DIALOG1 1 RG>I removed this line and recompiled the program. It worked. RG> RG>I'm sure I must be doing something wrong either in the C++ RG>code or in the Resource Workshop. As I am new to C++ I'm RG>not sure where to look. Can any one help??? That one took me several months to figure out... There seems to be a slight bug (undocumented feature?) with the resource compiler and I found by reading and reading several after market books (it's not in Borlands documentation, at least not that I could find at the time) that it is necessary to ensure that the following lines are placed in the RC file. #ifdef RC_INVOKED //Place at the beginning of file // Other lines of resource code #endif // Place at the end of the file Note: If you add more resources to the file, more stuff on the menu, another dialog box, etc. You MUST manually move the "#endif" to the end of the file listing or you will have problems similar to what you describe. BTW, Unless you have the resources defined elsewhere in the code, you should NOT remove the define lines from the RH file. If problems persist, I would take another look at how you are calling your functions. (Maybe you could post a short snippet) If your program's causing a GPF, I would suspect that the problem is not going to be in the necessary declaration of a resource. Later, Pat Glenn ___ * UniQWK v4.2 * The Windows Mail Reader --- Maximus 3.01 * Origin: C+Net BBS. Programming & Networking. (1:342/601) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1R00011 Date: 01/21/98 From: BRIAN WOOD Time: 06:56pm \/To: ALL (Read 1 times) Subj: multichar constant I found a quick fix for now, but I'm still curious about why an expression like '/a' could be evaluated two different ways on the same machine, using different compilers. By fooling around and doing stuff like this... cout << "Expression /a in hex = " << hex << '/a' << endl; and checking the output, I've realized that Microsoft v 8.00 is 'seeing' this two char constant right-to-left, while Borland sees it left-to-right. Adding a case 'a/': fixes the problem for now. while(--argc && **argv++) { cout << "command-line switch = "; switch(*(int*) *argv) { case '/a': case 'a/': cout << "/a" << endl; break; default: cout << *argv << " (unknown)" << endl; break; } } I suppose the problem is "undefined", "non-portable" solutions implemented by each vendor on how to handle multi-byte character constants?? Is there a simple, portable way to do the above? L8r, bw ... If all goes well, you've overlooked something! --- Blue Wave/DOS v2.20 * Origin: River Canyon Rd. BBS Chattanooga, Tn (1:362/627) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1R00012 Date: 01/20/98 From: AUKE REITSMA Time: 09:15pm \/To: JONATHAN DE BOYNE POLLARD (Read 1 times) Subj: moderation and the echos Hi Jonathan, On 15 Jan 98, 14:56, you wrote to Auke Reitsma BS>>> a) Candidates may either be nominated without AR>> I nominate Jonathan de Boyne Pollard, Tom Torfs and Roger Scudder. JdBP> I am happy to accept the nomination for moderator here, since one JdBP> is needed and I want the echo to continue. JdBP> But I don't want to burden everyone with a long and boring JdBP> popularity contest. I'm a strong believer in moderation issues JdBP> being as small a part of echomail bandwidth as possible. So (as Basically I agree with that. However, IMHO, a moderator needs to be rather visibly present. So if electing you as moderator is a requirement to make you show your presence here ... ;-) Greetings from _____ /_|__| Auke Reitsma, Delft, The Netherlands. / | \ -------------------------------------- --- GEcho 1.00 * Origin: Home by the C (Auke.Reitsma@net.hcc.nl) (2:281/400.20) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1R00013 Date: 01/21/98 From: ADAM MAJER Time: 06:05pm \/To: MICHAEL RATHBURN (Read 1 times) Subj: Wav files MR>Hi All , hope you are having a nice day MR>I am attempting to write a program with Borland Builder the Problem I have MR>come up against is playing a Wav sound file without shoe the windows media MR>player is there a coded routine available to play wavs through the MR>program ? if so could someone tell me how to get hold of it. There's a routine in Multimedia Windows DLL (comes with windows). It's the _sndPlaySound_. You have to include mmsystem.h for this function. * SLMR 2.1a * --T-A+G-L-I+N-E--+M-E-A+S-U-R+I-N-G+--G-A+U-G-E-- --- FMail 0.92 * Origin: The Programmer's Oasis on FIDONET! (1:348/203) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1R00014 Date: 01/21/98 From: ADAM MAJER Time: 06:24pm \/To: RAY GEAR (Read 1 times) Subj: Borland c++ v 4.52 RG> #define MAINMENU 1 RG>I removed this line, recompiled the program and it worked??? RG>The second program I entered was to display a dialog box. Again I used the RG>Resource Workshop to produce the dialog. The program crashed with a GPF. n RG>king the .rh file there was a line RG> #define DIALOG1 1 RG>I removed this line and recompiled the program. It worked. I still use Borland C++ 3.1 but I can probably help. Post the code for one of the applications. (It's like shooting in the dark with no code ;-) * SLMR 2.1a * My reality check just bounced. --- FMail 0.92 * Origin: The Programmer's Oasis on FIDONET! (1:348/203) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1S00000 Date: 01/22/98 From: CHRISTIAN FELDE Time: 05:06pm \/To: ALL (Read 1 times) Subj: sort.cpp Can't say I see what's wrong with this. There's no error in compiling it, and when I try to run it, there's no output, and no input I give does anything. So then I must brake it with ctrl+c to return to command line. [start of source] // sort.cpp #include void main() { const int MAX = 10; int table[MAX]; int i; int temp, test = 0; cout << "\n\n\tThis program demostrates sorting array " << "elements into\n\tdescending order\n\n" << "\tEnter ten integers:\n"; for (i = 0; i < MAX; i++) { cout << i + 1 << ".: "; cin >> table[i]; } cout << "\n\n\tThe unsorted array is: "; for (i = 0; i < MAX; i++) cout << table[i] << " "; //sort while(test == 0) { test = 1; for (i = 0; i < (MAX - 1); i++) { if (table[i] < table[i + 1]) { temp = table[i]; table[i] = table[i + 1]; table[i + 1] = temp; test = 0; } } } cout << "\n\n\tThe sorted array is: "; for (i = 0; i < MAX; i++) cout << table[i] << " "; } [end of source] Anyone who can help me? __ __ __ __ _ _ /_ // / // ///\// email: scooby@applausenett.no _ _ __ __//_ /_//_//_/// homepage: http://www.applausenett.no/~scooby/ --- BBBS/L v3.33 How * Origin: Fluxpod Information eXchange, telnet://fix.no (2:210/30) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1S00001 Date: 01/22/98 From: CHRISTIAN FELDE Time: 05:06pm \/To: THOMAS MAEDER (Read 1 times) Subj: strcmpi error? CF>> >If you are a C++ newbie, you'd better not use these C string functi CF>> >if you don't have to. Use the string class. CF>> Hmm.. well.. the book I'm using (Instant C++ Programming) isn't a C >I don't know the book. But if it's no more than a few years old, >there's no excuse for teaching using char arrays instead of the >Standard string class. >I'd suggest that you just skip the "string" stuff in the book. Well... found out that strcasecmp() did the same jobb as strcmpi(). __ __ __ __ _ _ /_ // / // ///\// email: scooby@applausenett.no _ _ __ __//_ /_//_//_/// homepage: http://www.applausenett.no/~scooby/ --- BBBS/L v3.33 How * Origin: Fluxpod Information eXchange, telnet://fix.no (2:210/30) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1S00002 Date: 01/22/98 From: CHRISTIAN FELDE Time: 05:06pm \/To: ALL (Read 1 times) Subj: This work's, but... This program works, but it seams like when I give more the 3 char's in to array 2, I get this: "Segmentation fault (core dumped)" Here's the source: [start] // chararray.cpp #include void main() { char array[2][10]; cout << "Enter array 1: "; cin >> array[1]; cout << "Enter array 2: "; cin >> array[2]; cout << "Array 1: " << array[1] << endl; cout << "Array 2: " << array[2] << endl; } [eof] and here's the error: [start] sco-systems:~/work/code$ chararray Enter array 1: test1 Enter array 2: test2 Array 1: test1 Array 2: test2 Segmentation fault (core dumped) sco-systems:~/work/code$ [eof] Thanks for all help... __ __ __ __ _ _ /_ // / // ///\// email: scooby@applausenett.no _ _ __ __//_ /_//_//_/// homepage: http://www.applausenett.no/~scooby/ --- BBBS/L v3.33 How * Origin: Fluxpod Information eXchange, telnet://fix.no (2:210/30) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1S00003 Date: 01/21/98 From: RANDAL KOHUTEK Time: 01:44pm \/To: NEIL FERGUSON (Read 1 times) Subj: Newbie =) NF>This is a serious book! It has all the stuff from basic C++ (DOS) to NF>Multiple-Document-Interfaces (MDI - windows) I see ... hefty book =) I'm not so sure of whether or not I'm ready to dive into windows programming yet - if I am, then I'd probably start with Visual Basic --- well, maybe not. $299 is a little hefty for VB. NF>Right - I would STRONGLY recommend getting hold of a copy of Borland C+ NF>Windows v4.5 'cos we got it free on a Cover CD here - full version - al NF>you to build DOS apps, Win16s (3.x/386) AND Win32s ('95+NT)... If you NF>get hold of a copy I suppose I could probably mail it to ya - cost a bi NF>tho'... NF>Anyway - whether you want the compiler or not - mail me for a chat! - H Cool ... do you have an idea where I might buy the book, and how much it costs? Mailing the book to me while you use the compiler would be against copyright ... I think. Thanks, Randal Kohutek - slip42@juno.com oh yea ... I'm 15, living it up in colorado springs, CO. --- GEcho 1.20/Pro/PBBS * Origin: Redbeard's Cove BBS, Security, CO. (719) 392-2705 (1:128/202)