|
see radio buttons or checkboxes. they are actually CButtons, and they do have in their properties a flags called something like "push button" (see in the resource editor)...
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
It's probably the easiest solution
I used mine because I had to do the same but the buttons were on a toolbar (so you cannot control the properties with resource editor).
|
|
|
|
|
But i am creating a button with image.(customised one)... Say that i already have a CButton now i want to change that to toggle.
|
|
|
|
|
|
hmmm... Ok.... Can I make a radio button with Image and will it look like a normal button?
|
|
|
|
|
|
okay... How should i write Message Maps for two states(On/OFF)... I am creating everything at runtime
|
|
|
|
|
Message Maps ? I thought you were using the MFC's (CButton is part of the MFC), so you don't have to write message maps yourself. What are you trying to achieve exactly ?
|
|
|
|
|
Hey,
As i am creating everything at runtime i am writing the message maps.
And I got the solution also... I can just keep count of button pressed and writing my code accordingly ...
Thanks for the help
|
|
|
|
|
Ok, sorry, I misunderstood you (almost the week-end ).
Use it the same way as a normal button. But if you create them at runtime, you won't be able to configure them through the resource editor. So, the solution is to use the code I posted in my first thread.
So, you make the message map like for a standard button press and inside the function, you paste the code.
|
|
|
|
|
Is there anyother functions available... instead of static variable??
bcoz I may face problem for situation like,
just describing in steps.
1.I am pressing the button... It state will be set to true.
2. without releasing it say i am closing that window
3. Again i am opening the window and pressing it...
I will face unwanted behaviour. Is there anyother function call is there to get the state??
Hope I made it clear
|
|
|
|
|
atimpoo wrote: Hope I made it clear
Err, no, I didn't understand.
From which window are you speaking about ?? (You said 'that window')
|
|
|
|
|
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[^].
|
|
|
|