|
well actually you can convert them.
The main difference is that a BOOL is actually an integer (4 bytes I think) and TRUE and FALSE are defined values to 1 and 0 respectively.
a bool is a class I think, where the data integrety (true/false) is forced more then the BOOL datatype.
(a little warning: bool can have a sort of tri-state, never use something like the following:
bool mybool;<br />
<br />
<br />
if(mybool == true){
}<br />
else{<br />
}
but use
if(mybool){
}<br />
else{<br />
/code<br />
}
)
both types are used often. BOOL is especially used on structures like:
BOOL myBOOL;<br />
<br />
if(myBOOL == TRUE){<br />
<br />
}<br />
else{<br />
if(myBOOL == 3){<br />
<br />
}<br />
else{<br />
}<br />
}<br />
}
I'll leave it up to you whether you find this good or bad design.
I hope this helps you a bit.
good luck!
No hurries, no worries.
|
|
|
|
|
In your MFC code, stick to BOOL. For everything else (within reason), move towards bool.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
100% agreed. And never compare a BOOL to TRUE, only check if it is FALSE or not. Since anything that is not FALSE is TRUE.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
I want to write a Visual C++ program which gets data from the user and gives this data to GAMS (on a simple button click and GAMS should not run visibly). GAMS is then supposed to make a calculation and give the obtained data back to my Visual C++ program so that I can use this new data. Does anybody know if this is possible???? And if so, then how should I do this? THANKS in advance.
|
|
|
|
|
Two type definitions are used in borZoi can anyone explain it to me.
1.typedef unsigned char OCTET;
This represents an unsigned 8 bit type. It is called octet rather than
byte in order to be consistent with the various standards.
2.typedef std::vector<octet> OCTETSTR;
This is a vector of octets and represents an octet string as described in various standards.
|
|
|
|
|
What's the question?
"God doesn't play dice" - Albert Einstein
"God not only plays dice, He sometimes throws the dices where they cannot be seen" - Niels Bohr
|
|
|
|
|
using typedef allow you to define synonyms.
you use it just as you would define a variable of that type, but the name of the variable is the synonym name...
<font color=green>
<font color=blue>typedef unsigned char</font> OCTET;
<font color=green>
<font color=green>
<font color=blue>typedef</font> vector<OCTET> OCTETSTR;
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
by definition an octet is 8 "something".
octet is the (better) french translation of a byte; maybe the original programmers were french.
as for the other one, maybe we're missing < >
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
we want to transefer one file from one pc to another.
please give me code in VC++.
when we run any Windows program in VC++ linking error was arise.
error was like . unresolved symbol : _beginthreadex
unresolved symbol : _endthreadex
in some library file.
|
|
|
|
|
manishgandhi wrote:
when we run any Windows program in VC++ linking error was arise.
error was like . unresolved symbol : _beginthreadex
unresolved symbol : _endthreadex
in some library file.
I Believe you forget to Enable MFC in your Project!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
manishgandhi wrote:
we want to transefer one file from one pc to another.
please give me code in VC++.
How? RS-232, tcp, ... ?
manishgandhi wrote:
when we run any Windows program in VC++ linking error was arise.
error was like . unresolved symbol : _beginthreadex
unresolved symbol : _endthreadex
That's bcause you are compiling with /MT flag activated (multithread option)and your libc.lib seems that it doesn't support it. Do you have this library? Read this[^] for info.
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
I am currently wokring on the server side applications of the project and i am using Visual Studio .NET and MFC to develop the server side applications. As for the server's user interface i am using MFC and my server's side user interface will receive the summary page from the client which is send by the customer using the Pocket PC to send the summary page. The summary page is the finalised orders made by the customers and it consists of the name of the food ordered, number of drinks, what type of desserts and including the special orders made by the customers. I am actually doing a project on the ordering of foods and my part is responsible for receiving the summary page which is the finalised food orders from the customers using the Pocket PC and my difficulties is how to program some intelligence in the server so that for eg .it can calculate the accumulated orders of the total of how many plates of chicken chops are ordered and how many drinks and dessert are ordered, pls help me i am really stuck!! yr help is very much appreciated
Claude
|
|
|
|
|
hi,
i have a MDI doc, in that i want the child frame to be able to move outside the main frame work-area when its restored, and when its maximized it shud fit the mainframe's work-area(ie, it shud maximize inside the mainframe)
ss
|
|
|
|
|
If it can move outside the main frame, then it is (probably) not a child of the main frame.
I am not saying it is not possible (you'll have to step outside of MFC to do it), but you have have just step into the twilite zone.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
I wrote a program to send a file over rs233.
When I send a text file, it works correctly.
But When I send a Binary File It does not work correctly.
Because It assumes reach '\0'.How Can I send any File Correctly via serial port?
|
|
|
|
|
What are you using to read and write the file on each end? Are you indicating the the binary mode when you open each file?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Could any one please help me out in adding X button in right corner in tab ctrl and a show a spliter window in tab ctrl.
|
|
|
|
|
I was looking for the same, found a solution?
|
|
|
|
|
hi,
can I open the Dll or exe file with VC,if yes,how to do?
thanks
|
|
|
|
|
You mean "VC" as the Visual Studio IDE (for example to debug the EXE/DLL), or "VC" as C++ code in some program of yours? If the former, you can go through the "Open Project" menu and select the EXE/DLL file. If the latter, it depends on how you want to open it (i.e.: what you want to do with it).
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
I use Visual studio 6.0,I want to open exe or dll file to see C++ code,just do"go through the "Open Project" menu and select the EXE/DLL file",what to do else?
Thanks!!
|
|
|
|
|
Anonymous wrote:
,I want to open exe or dll file to see C++ code,just do"go through the "Open Project" menu and select the EXE/DLL file",what to do else?
you are asking for impossible thing(In today scenario atleast)! you can't see the source code by opening the dll/exe in Visual Studio.
And how are you so Sure that, that Executable was written in c++?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
ThatsAlok wrote:
you are asking for impossible thing
unless he uses a decompiler, which is of course, absolutely forbidden if he doesn't own the code (which seems to be)...
moreover, the code won't be perfectly written back to how the owner wrote the code
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
he uses a decompiler
I have never seen a decompiler in my Life! do u ?, Moreover how can Decompiler convert the code written in machine language to HighLevel langauge!, how could it possible!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
ThatsAlok wrote:
I have never seen a decompiler in my Life! do u ?
never what is hacking ?
ThatsAlok wrote:
Moreover how can Decompiler convert the code written in machine language to HighLevel langauge!, how could it possible!
that's its job... in fact, decompiling an exe in debug mode is very easy as the compiler inserted source informations (to allow to debug) ; with machine code, it has to identify the machine CPU (to know what language set is used), and so regenerates - awfully - a C++ code which is an interpretation of what it found in the binary...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|