|
Rajesh R Subramanian wrote: They're mutually exclusive.
mutually inclusive
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
How to check for or assign the positive/negative infinitive to an int variable?
Thanks,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
There are no infinities for int.
Maximum value of int is 2147483647
Minimum value of int is -2147483648
These are defined as INT_MAX and INT_MIN in the limits.h headers file. These files are VC++ specific, if you need portable way to getting these numbers then try numeric_limits class in c++.
-Saurabh
|
|
|
|
|
The values I gave are based on 32 bit int's. Since size of int is not same for all platforms, you should not directly use them. Instead use macros defined in limits.h file.
-Saurabh
|
|
|
|
|
Are you kidding?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
rp_suman wrote: positive/negative infinitive to an int variable
Did you mean to say float or double?
|
|
|
|
|
Hi,
I mean, in some cases, I want to return negative or positive infinitive as result.
And I want to check the returned value is whether negative/positive infinitive or other value.
I think there is some constant like BIGVALUE or something other than INT_MAX.
Thanks,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
Nope: all possible bit configurations of an int variable represent a valid int value (i.e. no special meanings).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Sometime I saw the number is becoming like "#.inf" in watch window after assigning result of divide by zero.
I thought, that means variable is having some value representing infinite.
But the VC++ IDE may be showing this after the divide by zero attempt.
Is it true?
Thanks,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
The number must be either float or double .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Hi,
Thanks a lot for help!!
So, can I compare returned float value is -ve or +ve infinitive?
Thanks,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
Yes, have a look here [^] and here [^] (some background).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Hi,
Thanks a lot for all help!!
Thanks,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
Hello,
I want a user defined function that can be called by every process running.
That is: -
void HelloWorld()
{
MessageBox(NULL, L"Hello World", "Test", 0);
}
I need a mechanism by which this function can be called inside every running process.
|
|
|
|
|
tony_udz wrote: I need a mechanism by which this function can be called inside every running process.
Write your funtion in the DllMain() of a dll and inject it to the process you need using CreateRemoteThread() API. For more details see Three Ways to Inject Your Code into Another Process[^]
|
|
|
|
|
Thanks! for your reply.
In Windows CE CreateRemoteThread() API is not supported. I have tried out many options but could not find a way to inject DLL.
|
|
|
|
|
|
Hi
How to connect database using MFC?Replay ME
Regards
Nisha.S![Rose | [Rose]](https://codeproject.freetls.fastly.net/script/Forums/Images/rose.gif)
|
|
|
|
|
You can use of CDaoDatabase class.
|
|
|
|
|
|
Maybe someone else can see the error. I can't (of course, as soon as I post this, I'll see it ).
typedef struct
{
BOOL bObsolete;
TCHAR sOn[16];
TCHAR sOff[16];
TCHAR sName[50];
ULONG nId;
} _MESSAGES_TYPE;
#define NUM_MESSAGES 260
const _MESSAGES_TYPE FeatureSetTable[NUM_MESSAGES] =
{ //<----- compiler error!!!!!!!!!!!!!!!!!!!!!
{ FALSE, _T("ON"), _T("OFF"), _T("Message 1"), NULL},
{ FALSE, _T("ON"), _T("OFF"), _T("Message 2"), NULL},
{ FALSE, _T("ON"), _T("OFF"), _T("Message 3"), NULL},
};
This results in a compiler error C2059 at the location above. For the life of me, I don't know why. Suggestions?
Charlie Gilley
Will program for food...
|
|
|
|
|
I couldn't see the error as well. Then I decided to compile it in a new project and it compiles fine. So I guess the error might be due to conflict from other parts of code.
-Saurabh
|
|
|
|
|
By the way I tried in VS 2008.
-Saurabh
|
|
|
|
|
Thanks. I'm in VS 6.0, and I don't see it. I suspect a conflict as well. Just can't see it.
Charlie Gilley
Will program for food...
|
|
|
|
|
How about trying to rename _MESSAGES_TYPE, NUM_MESSAGES, and FeatureSetTable. May be there is a macro with these names some where else.
-Saurabh
|
|
|
|