|
ya.. I will explain it properly... say that i have an application running. A window is created by clicking a menu item. In that window i am having my toggle button.
Now i am clicking the toggle button first time. It state changes... Now i am closing the window.. and when i again open that window... That static variable wont be created again. It holds the previous value...
This is the problem i am facing it..
|
|
|
|
|
Change the scope of the static variable.
I mean outside the code of the window handler where you create the buttons
Knock out 'T' from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|
|
Hi together,
I need some help to get the name of the local host from DNS (VC++6).
My problem is that the WINS entry is different from the DNS entry. So, gethostname() and gethostbyname/addr() always return the WINS entry and not the DNS entry. Moreover, I can't change the entries or configure the system
Can anybody help me on how to get the DNS entry (host name) anyway? For example, if I type "nslookup <IP of local host>" to the console, I get the wanted host name. I just need this functionality in C++.
Thank you very much for your help!
Marcus.
|
|
|
|
|
Have you looked at DnsQueryConfig() ?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
Hi David,
thank you very much for the tip. I tried out the function in the last three hours. However, it doesn't work as expected. I tried
DnsQueryConfig(DnsConfigHostName_A, FALSE, NULL, NULL, szHostName, &ulSize); and this gives me the local(!) host name So, the result is equal to gethostname() . Then I tried
DnsQueryConfig(DnsConfigFullHostName_A, FALSE, NULL, NULL, szHostName, &ulSize); and it works only on those machines where the local host name (WINS entry) is equal to the DNS entry. So, I suppose that DnsQueryConfig() queries information by giving the local host name to DNS Of course this won't work. Moreover, the function doesn't work for Win2000 although it is specified for it (I always get a "wrong parameter" error).
Maybe you can tell me what I'm doing wrong? Or do you have another idea?
Thank you again for your help,
Marcus.
|
|
|
|
|
how do i get the user name from windows nt using VC i am working in the console application environment..... i shall be very thankful to you
noumanzaidi
|
|
|
|
|
|
Hello everybody!
I have two process (father and child) and my implementation was all based in the article How to spawn console processes with redirected standard handles. Everything works fine, send command and receive answers from the child process (command line)... but, it works just a few times (two to be more exactly). In the third command that I send, there is no answer. The WriteFile function does not give any error, and the ReadFile ('Threaded') function don't receive any bytes and don't accuse any errors to. In this case, I'm even using the PeekNamedPipe function to know how much bytes (if it's there) I have to read.
It's strange to me... everything is working fine, but suddenly stops working.
Does anybody here already have this problem or knows what I'm doing wrong?
Thanks in advance!
cheers!
|
|
|
|
|
This is just a guess since no one else replied. Most of my IPC experience is socket based. If you don't solve this you might try that approach.
Anyway the IO streams might have ( based on a vague memory ) error states that you need to reset (clear) before each read and/or write operation.
Hope that helps.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
Hi led mike!
Thanks for your answer. I've been searching for those error states that need to reset, but I don't found them in MSDN and nowhere.
I've been thinking about use named pipes (I'm using anonymous), but this really scares me... my project is already late, and the use of named pipes will demand a whole new approach.
Thanks for your help led mike,
best regards
|
|
|
|
|
|
i have an apllication with property sheet. but i run the application it executes, but if press enter at very first time when application window appears then application suddenly closes without givig any error message or assertion failure. i set the tab order properly but still this is happening . need help!
jiteen
|
|
|
|
|
If your application is a dialog based app, take a look in the FAQ[^].
|
|
|
|
|
Hey man,
if your application is dialog based then the following code helps you
what i have used in my application.
BOOL CmyApp::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message == WM_KEYDOWN && (VK_ESCAPE == pMsg->wParam || VK_RETURN == pMsg->wParam))
pMsg->wParam=NULL;
return CWinApp::PreTranslateMessage(pMsg);
}
Knock out 'T' from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|
|
its working very nice.
thans a lot sir.
hence after no 'T'.
regards,
jiteen tilekar
jiteen
|
|
|
|
|
Hi Geniuses,
Don't feel me childish. Despite I am working in C++, I am ashamed of not knowing much about C++ versions. From this post, I'd like to know the following facts:
(1)what are are all different kind of C++'s (Turbo C++, Microsoft C++, Borland C++, ANSI C++... with proprietor name) are there in the industry?
(2) How they differ ?
(3) Which one is used more ?
(4) Which among them are free?
(5) For freewares, how to get the updated libraries ?
If anyone could provide these information, I would be grateful. I'd appreciate, if I get more info on C++.
Thanks in advance,
Sarvan AL
|
|
|
|
|
Sarvan AL wrote: (1)what are are all different kind of C++'s (Turbo C++, Microsoft C++, Borland C++, ANSI C++... with proprietor name) are there in the industry?
you first confuse some things. Microsoft and Borland C++ are products, while Turbo C++ and Ansi C++ are Languages. there are plenty of IDEs and/or compilers+linkers that build C++ (one of the most famous is the GCC compiler).
Sarvan AL wrote: (2) How they differ ?
each have specifics, but they should all compile standard C+++ the same way (they should, but they actually don't - unfortunately).
Sarvan AL wrote: (3) Which one is used more ?
dunno. maybe gcc on unix/linux world, maybe Visual C++ on windows world (but i cannot certify at all my thoughts).
Sarvan AL wrote: (4) Which among them are free?
GCC is free, Visual Studio 2005 express edition is free, and certainly others are free too
Sarvan AL wrote: (5) For freewares, how to get the updated libraries ?
sorry, i don't understand.
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
Thank you "toxcct".
As you said, I was really confused with products and languages.
In my 5th question, what I mean is: How a language enhances itself to adapt the new technologies? Hope it is sufficient to download the latest versions.
Hope I am clear now.
What do you mean by "Standard C++". Still I am not getting the things. Kindly help me to understand clearly.
Sarvan AL
|
|
|
|
|
well, i believe that each compiler editor professional enough do provide updates to their product when they make changes. microsoft is well known for its "service Packs"...
but as far as the standard remains the same, you do not have to change your code
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
Thanks a lot toxcct.
Sarvan AL
|
|
|
|
|
|
Sarvan AL wrote: What do you mean by "Standard C++".
It's what most C++ compiler vendors strive for, although they usually fall short of that for one reason or another. See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
toxcct wrote: Turbo C++
Turbo C++ is a product of Borland, which accepts pre-ISO C++ (C++90) and ANSI C (C89) languages, and produces 16-bit DOS programs.
Maxwell Chen
|
|
|
|
|
1- There is only one C++ language, and there are numerous vendor specific variants based on that standard ( Visual C++, Borland C++, G++, Intel C++ compiler... )
2- The differences are usually in the libraries shipped with them, either for UI, or other OS specific functionalities ( MFC for VisualC++, OWL for Borland, ... )
3- Nowadays, I think MS's Visual C++ might the one that is the most used, but not far behind should be G++ ( for linux and other unix like OS)
4- I think, gcc/g++ is the only one free.
5- for gcc/g++ As far as I remember, you only get the basic C/C++ libraries, maybe STL, all other libraries, you should get separatly from the different things you want to do ( UI, ... )
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Hi Maximilien,
Thanks a lot for your great effort.
Sarvan AL
|
|
|
|