--------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4Q00014 Date: 04/14/97 From: DANIAL GIBSON Time: 05:47pm \/To: CHRISTIAN ANDERSEN (Read 5 times) Subj: win95 mailslots CA> DG> a program to chat between the computers. So I read the win32 sdk CA> DG> and thought, gee, pipes look good. So I did that for two hours CA> DG> wondering why it wouldn't work. Found out it's cause pipes are only n CA> DG> nt, not 95. CA>I've been down that alley to :-( Hit the brick wall at the end? CA> DG> 1. Why does it get it twice? CA>dont know! I thought maybe it was some kind of wierdo error checking stuff. CA> DG> 2. Will it _always_ get it twice? CA>I think so. Good. CA>After reading your message i made a small program to see if CA>it was true - and it was. Maybe it is a bug in the windows CA>SDK, or maybe there is a reason for it - not really obvious CA>to me though. Probably a bug, there's a couple in it. Or just an undocumented feature. We all know how Microsoft loves them. :) CA>I dont know which compiler you're using. I'm using MS CA>Visual C++ 4.0. If you're using the same compiler, it could CA>be a problem with the compiler. Nope, using Watcom 10.6. CA>The short of the long is, that I found a way to get by it. CA>Not in a very elegant way, but it works: The basic idea is CA>to only take every 2 messages from the mailslot, when you CA>are reading it, using the MODULUS (%) function. CA>The next few lines of code shows the functions I'm using (do not get confuse Few? It was a bit more. SLMR wasn't able to handle the size of the message. I had to read it with all the pie's in it. Thanks for the info. It was very helpful, though I'm going to wonder _why_ they did it that way for a long time. Danial. ___ X SLMR 2.1a X --- Maximus/2 3.00 * Origin: Hunter Connection OS/2 BBS 24hrs (049) 57-1801 (3:622/403) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4Q00015 Date: 04/16/97 From: DANIAL GIBSON Time: 09:25am \/To: CHRISTIAN ANDERSEN (Read 5 times) Subj: win95 mailslots Hi, Back onto mailslots. I was doing what you said (get every 2nd message), and it worked. Until I sent two message together (ie, send one message then send another immediately after - no pause), and for the first message, it only sent it once. So this method doesn't work _all_ the time. So I came up with a better idea. When you send each message, add a packetnumber to the front. Then, when you receive a message, check if this packetnumber is >= the last packetnumber. If it is, discard the message. It's more complicated to implement, but at works all the time (as far as I can tell). Later, Danial. ___ X SLMR 2.1a X --- Maximus/2 3.00 * Origin: Hunter Connection OS/2 BBS 24hrs (049) 57-1801 (3:622/403) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4Q00016 Date: 04/18/97 From: ANTHONY TIBBS Time: 04:40pm \/To: MARK BARBA (Read 5 times) Subj: How do I? On Apr 13 21:58, 1997, Mark Barba of 1:387/310 wrote: MB> 'control' another program within windows... as an example, I'd MB> like to run my program in Windows, which will cause another Windows MB> program to load--and when it does, it will 'push its buttons' and MB> control it as a user would... if you can't explain it easily, then MB> I would be grateful if you could at least direct me to a good book MB> that can explain it (If possible)... any help appreciated... MB> thanks in advance... The above is very possible, especially if the "to be launched" program supports DDE (Dynamic Data Exchange). I've never used DDE myself (don't have a Windows C/C++ compiler ), but it should do what you want. Of course, if you aren't using DDE, it's another story. I'm not sure how that would be done. (Recorder that comes with Win31 does that.) Anthony --- TriED 0.10 alpha 1 * Origin: World of Power BBS (1:163/545.15) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4Q00017 Date: 04/18/97 From: ANTHONY TIBBS Time: 04:47pm \/To: ALEXANDER DERAZHNE (Read 5 times) Subj: About bit-field syntax On Apr 15 02:29, 1997, Alexander Derazhne of 2:463/16.100 wrote: AD> #include AD> struct A { unsigned int x : 1, y : 2, z : AD> 5; }; AD> struct B { unsigned int x : 1; unsigned int y : 2; unsigned int z : AD> 5; }; AD> === Begin Test.R === AD> sizeof A is 1 AD> sizeof B is 1 AD> === End Test.R === Actually, if I understand this right, it is doing this properly. The unsigned int only requires one byte of memory when using bitfields. If you used: struct A {unsigned int x, y, z;}; struct B {unsigned int x, y, z;}; Then yes, the compiler is wrong. Think of it this way: here is your "A" structure (memory wise - unsigned t) FEDC BA98 7654 3210 .... ...Z ZZZZ YYX (I may be wrong - X may be at 'F', but I am not sure.) You see, it still only uses one byte of memory. Anthony --- TriED 0.10 alpha 1 * Origin: World of Power BBS (1:163/545.15) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4Q00018 Date: 04/19/97 From: ANTHONY TIBBS Time: 12:07pm \/To: THE MISANTHROPE (Read 5 times) Subj: any ideas? On Apr 03 04:26, 1997, THE MISANTHROPE of 1:247/101 wrote: TM> The following program (under Turbo C++) compiles fine with no TM> error but will not link. Linker reports "Break on Link" with no TM> other TM> message to give any clue as to why it doesn't link. I think your TC++ installation requires some reinstalling or something. I just compiled it with Turbo C++ 3.00 and it worked perfectly! --- TriED 0.10 alpha 1 * Origin: World of Power BBS (1:163/545.15) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4Q00019 Date: 04/19/97 From: ANTHONY TIBBS Time: 12:09pm \/To: ERIC ADAMS (Read 5 times) Subj: C++ On Apr 17 18:43, 1997, ERIC ADAMS of 1:2410/437 wrote: EA> Dear all, EA> I want to get into C++ programming. I wanted to know, first, what EA> books are EA> good and what books are not so good. I am getting Borland C++, and EA> I have EA> Turbo. What do you think is better? I'm making a VR type world... Are you familur with C? Anthony --- TriED 0.10 alpha 1 * Origin: World of Power BBS (1:163/545.15) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4Q00020 Date: 04/19/97 From: HERMAN SCHONFELD Time: 01:37pm \/To: NICK SHREDERS (Read 5 times) Subj: Re: DJGPP optimizations HS> How do I get the profiler to work? HS> "gprof .exe | more" doesn't seem to work. NS> I think I previously replied to a similiar message on this, if you get NS>this NS> message and didnt see my previous reply on this, let me know. I did get your previous reply and it was "try the outputed file instead of the exefile". I did and it still says "bad format".. any ideas? ... Error 15 - Unable to exit Windows. Try the door. --- Ezycom V1.48g0 01fd016b * Origin: Fox's Lair BBS Bris Aus +61-7-38033908 V34+ Node 2 (3:640/238) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4Q00021 Date: 04/19/97 From: HERMAN SCHONFELD Time: 01:40pm \/To: NICK SHREDERS (Read 5 times) Subj: Re: DJGPP optimizations NS> Did you compile without the -s ? HS> This is what I did :- HS> A) Compiled my program WITH -s and -pg and no -romit-blahblahblah. NS>B) HS> Ran my newly compiled program. C) gprof tex.exe > report.txt NS> Well, -s strips debugging information. Im quite surprised it let you NS>compile NS> with -s AND -pg. NS> This is another walkthru of how i did it: NS> Entered a source file called a.c and saved it. NS> gcc a.c -o a.exe -Wall -O2 -pg NS> a.exe (then went thru whatever various path in execution) NS> gprof.exe a.exe > a NS> q.exe a (qedit - viewed the file `a') I found the problem. I was compiling with -s and -pg. (djgpp didn't warn me). Thanks for helping ... If you can't read this, try with a modem! --- Ezycom V1.48g0 01fd016b * Origin: Fox's Lair BBS Bris Aus +61-7-38033908 V34+ Node 2 (3:640/238) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4Q00022 Date: 04/19/97 From: HERMAN SCHONFELD Time: 01:46pm \/To: CAMERON CLARK (Read 5 times) Subj: Re: Rating of C++ HS> I fail to see the big hype about OOP & OOD. HS> HS> HS> Please explain where it can be used and how this will make it CC>better. HS> I am thouroughly familiar with OOP & OOD so there's no need for a CC>definitio HS> CC>All these OO[x]'s are just one way for Analysis Design Coding and CC>Testting to CC>be used with objects. CC> Note: SmallTalk and Java are pure object oriented languages because CC>all CC> code and data belong to an object. C++ is a hybrid language because CC> it allows for code to exits as functions - like main(). CC> Anyways, the big deal with OO programming is that it is supposed to CC>come CC> closer to mimicing real life. It allows for objects to be highly CC>cohesive CC> and allow for loose coupling when interacting with other objects. CC> Objects just pass messages back and for to each other. Like in real CC>life, CC> a Teacher gives assignments to a Student and the Student returns the CC> assignment. CC> Teacher Joe("computer science); CC> Student computer_class[30]; CC> assg = Joe.GiveAssg(); CC> for (int i=0; i<30;i++) computer_class.GetAssg( assg ); CC> Modularity is the single component that allows for software to be CC> intullectually managable. So, for an object, you don't have to CC> remeber the "rules" for a procedure. The object is responsible for CC> knowning the rules and being a self contained entity that can CC> keep data to itself but allow access to information through CC>intelligent CC> methods (functions). CC> Can you tell that I'm in software engineering this semester? Yeah.. That message was written quite a while back. I use oop for many things now such as when declaring an enemy it has it's on procedures and private variables which affect it's movement and what its going to do etc. (used in a game ofcours) and you can tell that you are in software engineering :) ... Hey @F, don't steal this tagline! --- Ezycom V1.48g0 01fd016b * Origin: Fox's Lair BBS Bris Aus +61-7-38033908 V34+ Node 2 (3:640/238) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4Q00023 Date: 04/19/97 From: HERMAN SCHONFELD Time: 02:11pm \/To: CAREY BLOODWORTH (Read 5 times) Subj: DJGPP OPTIMIZATIONS HS>Maybe some people don't rely on compilers to compile the fastest code HS>possible. CB>ROFL! In a few years, when you've learned a bit more about programming, CB>differences in the code different compilers generate, how different CB>switches and optimizations can radically change the generated code, CB>programming for different platforms or even similar platforms but CB>different CPUs, etc., you'll realize just how incredibly funny that CB>statement is!! Funny? I don't see how improving ones code can considered funny. If your tender chimp brain actually bothered to read the thread maybe you'd understand what that meant. CB>There is only so much you can do algorithmically in a HLL. There comes CB>a point where it is very much up to the compiler as to how well / fast CB>the resulting executable runs. Thank you for informing me, now I know that a compiler generates optimized code. Where would I be without your free informative lessons carey. CB>For example, switching from a bubble sort to a quick sort might decrease CB>your run time from O(N^2) to O(N log N), but then after that, it's up to CB>the compiler whether it generates code that needs 10 seconds for 'x' CB>items, or 20 seconds for the same 'x' items. My comment merely said "Maybe some people don't rely on compilers compiling that fastest code possible". Lets see now, where did I say that a compiler doesn't optimize? Does a compiler change a *256 to a <<8? Obviously not, so why not optimize it yourself? But according to you thats wrong so don't do it. CB>Does the compiler generate inline ABS() and memcpy() functions or are CB>they so dumb they require calling a library routine. When it transfers CB>memory, does it do it a byte at a time, or is it smart enough to take CB>advantage of things like 32 bit registers which can move 4 bytes at a CB>time. Does the compiler automatically align things on word boundaries, CB>or does it generate code where a variable can be misaligned and require CB>more memory accesses? Does the compiler allow generating better 486 CB>level code, which is tuned to the way a 486 CPU operates, or does it CB>generate code for cruddy, slow 386s? Read the thread idiot CB>For many things, such as the few I mentioned above, you _have_to_depend_ CB>on the compiler, because there is a good chance they are outside of your CB>control, and even if not, they might be dependant upon the user setting CB>or not setting some particular switch that may not be the default or CB>that may interact with some other switch. Ofcourse, everyone depends on the compiler to compile code. But sometimes you have to make an optimizations by hand because the compiler can't do it. Obviously, it's no wonder I see so much sloppy code, if you actually took notice that not everyone has the latest machines to date you might consider trying to make the fastest code possible, not relying on the compiler to do it. ... For a bug-free environment do NOT run this program! --- Ezycom V1.48g0 01fd016b * Origin: Fox's Lair BBS Bris Aus +61-7-38033908 V34+ Node 2 (3:640/238)