|
Visual C++ 6
can anyone send me a useful link about
1. the hWnd class and its usage .
2. GetDlgItem() and its reverse (i.e, SetDlgItem() if found!!)
|
|
|
|
|
Oriented wrote:
1. the hWnd class and its usage .
hWnd is not a class, it's a window handle.
Oriented wrote:
2. GetDlgItem() and its reverse (i.e, SetDlgItem() if found!!)
Have you checked MSDN?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
You beat me to it....
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
hWnd is not a class, it's a HANDLE. In other words, it's a number that uniquely identifies a window on the system. CWnd is a class in MFC which wraps a hWnd.
There is no such thing as SetDlgItem, from memory you put a control into a window by making that window it's parent.
http://www.msdn.com is a more up to date version of the MSDN than came with your VC6, but the VC6 one just might be better for you. Install it now.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I want to know how can i assign infinity to a variable?
|
|
|
|
|
infinity is not a number, so you can't!
you can just use very big values using custom libraries for very big numbers.
Don't try it, just do it!
|
|
|
|
|
Since infinity doesn't exist (i.e., there's always one more number after the biggest number you can think of), how can you assign it to a variable? You can, however, assign a maximum value to integral types like:
int i = INT_MAX;
char c = CHAR_MAX;
unsigned long ul = ULONG_MAX;
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
It's easy, just use the infinity symbol. If you can't find it, take your keyboard back and demand a replacement.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Brilliant!!
Don't try it, just do it!
|
|
|
|
|
Where is the any key?
INTP
|
|
|
|
|
It depends.
If you value is a float or double , then it may be possible, take a look at:
numeric_limits<float>::infinity()
If your variable is an int, long or anything like that, then it is NOT possible to do - no matter what you set the value to, you can add to it and change it. (Although if it goes beyond the maximum value it can hold it will wrap around to a really big negative number!)
Now, if you want to know how to create an infinite loop, I've done that many times before...
Remember, even if you win the rat race, you're still a rat.
|
|
|
|
|
Navin wrote:
if you want to know how to create an infinite loop, I've done that many times before...
Maxwell Chen
|
|
|
|
|
Wouldn't assigning infinity to a number require an infinite amount of time? If you every figure it out, I'll be glad to test for a small hourly wage
The maximum characters for the signature is five hundred. I was wondering how long a five hundred characters message would be, so I decided to make my signature 500 characters long. I'm sure if I had some cool html stuff in my signature, I could eat up five hundred characters, but just typing five hundred characters takes quite some time. The trick I think is finding something to say, but I'm usually a man of few words. So I guess I'll tell you what I've discovered is the secret to life. It
|
|
|
|
|
These functions are driving me nuts. They work about 90% of the time, then fail unexpectedly the other 10% (especially on Windows 98.) In particular GetExpandedName often seems to bomb, and there is no extended error information.
So are there any alternatives or other implementations? I need to be able to expand files compressed with the "compress" utility (typcially, the ones named something like "somefile.ex_")
Thanks.
Remember, even if you win the rat race, you're still a rat.
|
|
|
|
|
These files are compressed in a CAB file.
So two easy ways:
Take a custom CAB lib or call the compress command to decompress them
Don't try it, just do it!
|
|
|
|
|
Well, you have to call "expand" to uncompress them, but that won't work for my situation - many systems don't come with expand.exe (98 systems in particular), so we'd have to distribute it, and not sure if there are any strange licensing agreements.
Custom CAB lib? Tell me where to find it, that's what I'm looking for.
Remember, even if you win the rat race, you're still a rat.
|
|
|
|
|
|
Hello All,
Can anyone tell me that what is the different when declare function like
const char* f();
and
char* const f();
I would like to know what does this two function signature means.
Thanks!
Nachi
|
|
|
|
|
easy, the second don't exist ! lol
in fact, you might want to say
const char* f();
char* f const();
that's simple. the first one returns a const char* when the second one returns a simple char*.
What does the second const mean, you'll ask me !? In fact, that is used in object programming, when you read values in an object, where you don't alterate that object... In brief, it means that you don't modify the members of your objet... you don't need this in pure C so...
see you
TOXCCT >>> GEII power
|
|
|
|
|
Ummm,
You said the second one
char* const f();
does not exist, but if I write this in Visual C++, the compiler does not complain. Also, for the first one, I can actualy return something which is not a const, eg,
const int f()
{
int i = 10;
return i;
}
and it also works in Visual C++ too. And would you mind to tell me why's that?
Thank you very much!
Nachi
|
|
|
|
|
Stop playing silly games in here, returning a const value doesn't make any sense!
Don't try it, just do it!
|
|
|
|
|
Hello,
You are right, I know that it does not make any sense, but I still don't know what is this,
int const f();
even thought I never use it in my programming experience. But in some C++ test, people ask something about this, and what I know and what I have used is only something like this,
void f(const int);
or
void f(int) const;
and these both make sense to me, but not
int const f();
therefore, the's why I would like to know whether this signature make sense to any of you.
But anyway, thank you for all your suggestio!
Nachi
|
|
|
|
|
Did this not help?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Sorry, it doesn't really help, I know how to use a constant data in a program, but I have some confussion when using in the definition of functions
Thanks!
Nachi
|
|
|
|
|
So doesn't it make more sense to continue that thread rather than creating a new one of the same topic?
In any case, MSDN has this to say about const :
When modifying a data declaration, the const keyword specifies that the object or variable is not modifiable. When following a member function's parameter list, the const keyword specifies that the function doesn't modify the object for which it is invoked.
With C++, const is often used in place of the #define preprocessor directive. Values defined with const are subject to type checking, and can be used in place of constant expressions.
When const is used with pointers, it specifies that the pointer cannot be modified after initialization; the pointer is protected from modification thereafter.
So, const char *cpch means that the object pointed to by the pointer is const. And, char *const pchc means that the value of the pointer — the actual address stored in the pointer — is const.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|