|
a function HiliteMenuItem() exists and its behaviour is exactly what i'm looking for BUT it only wroks for menus with a menubar, not for popup menus (contextual ones)
someone has an idea ?
|
|
|
|
|
What about SetMenuItemInfo to set the state?
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
do you mean setting the state to MFS_HILITE ?
i think it won't work as HiliteMenuItem() function must do the same.... and doesn't work for popup menus...
but i'll try
|
|
|
|
|
Hi All,
Can anyone please suggest me some ideas about how to control LED's using VC++?
Thanks in advance.
Regards,
Ram
|
|
|
|
|
Which LED ?
|
|
|
|
|
I am trying to design a software to communicate with a LED using serial port to On/Off the LED. so any help regarding this will highly be appreciated.
Regards,
Ram
|
|
|
|
|
You can't communicate with a LED using the serial port (a LED doesn't 'communicate'). You probably meant that you communicate with some kind of harware (like a microcontroler) that will switch your LED on or off.
Well, then just send some specific packet on the link that your microcontroller can recognize.
Where are you stuck exactly ? Because it is really vague...
|
|
|
|
|
Oooopzzzz. I just started to do some research regarding this to gather some knowledge about controlling LEDs using software. I understood by your answer that i should need some extra hardware(Microcontroller) to control LED.
Then I must go and find something about microcontroller and controlling LED first. Anyway thanx a lot for your information. Atleast i got some idea abt this.
Do you have any idea about this without microcontroller. ( that means jus with common electronic items such as breadboards, resistors, capacitors and transistors.)
Regards,
Ram
|
|
|
|
|
Maybe what you could do is use one of the control line of the serial port (like CTS, but you need to check which one you could use) and then connect your LED with a resistor between this line and the ground.
But, I don't think this is the most appropriate forum to discuss about that because it is not in fact a programming question...
|
|
|
|
|
K thank you very much for your valuable information. I think your information is more than enough for me. I think i mus go with the microcontroller.
Thanks again.
Regards,
Ram
|
|
|
|
|
If you can use the parallel printer port instead, see my response.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
I believe that you can do it using the parallel port using 24 volts that you should make available from your code in one of the port pins.
We have here working something like that but in that case we make an alarm to sound and we have used a relay and some cables, but only the parallel port. If we are capable to make an alarm to sound, I'm sure that you'll be able to enlight a led.
Hope this helps.
|
|
|
|
|
Cedric Moonen wrote: Which LED ?
THE Led
|
|
|
|
|
|
You can connect LED's to some of the pins of the parallell printer port. You will need to use serial resistors, though. Else, chances are that you will break either the printer driver circuitry (in the computer), or the LEDs themself.
You can use inpout32 (search for it) to control the individual pins of the parallell port.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
If you are willing to use the parallel port for driving of the LED, as Kahan has suggested, then here's a good article that might help: "Parallel port interfacing made easy: Simple circuits and programs to show how to use PC parallel port output capabilities" at http://www.epanorama.net/circuits/parallel_output.html[^]
Note that under current Windows OSs, the outportb() function is no longer usable, and indeed all functions that directly access the port are not usable. You will need a prot driver, as noted in the cited article.
Mike
|
|
|
|
|
Hi all.
In my application I am trying to copy an html page from one temp location to another location specified by user.
I am using CopyFile() API to copy html pages.
But I need to explicitly carryout the image copying along with the .html page copying.
I also tried using SHFileOperation API but it also doesn't support implicite copying of images.
Is there any other API which copies all the images from particular html pages implicitly when I copy that html page?
Thanks
Sameer Thakur
|
|
|
|
|
Hi
As I know there isnt any API for that .
you should search for image function in the html file , and find the image adresses and copy them near the html file , then you should change the adresses in the file to new addresses (related addresses) . Then you can copy them wherever you want . It will take time to do that ...but if you want to write the program you should spend time .
|
|
|
|
|
When I call teh acceptex function , it will return false and I use WSAGetLastError to get the error code. It is 10038.
I ensure I pass the function valid parameters, but why?
yangyi
|
|
|
|
|
|
Looking up the error code gives:
C:\>net helpmsg 10038
An operation was attempted on something that is not a socket.
|
|
|
|
|
Hi all,
I created a thread in a function, and I would like to terminate that thread in another function, when a certain condition has been reached. Would it be wise to use:
BOOL TerminateThread(
HANDLE hThread,
DWORD dwExitCode
);
And what does the dwExitCode exactly do ?
I know MSDN states: Specifies the exit code for the thread.
So I can specify any integer value ??
Many Thanks in advance.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
In general, it is best if you can avoid using TerminateThread because that will really kill the thread (so you won't be able to do clean-up tasks or things like that). What you'll have probably is a kind of loop (while something is true, you continue processing). So, what you could do is set this variable to false in the other thread.
|
|
|
|
|
Thank you Cédric.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
I think these links will helpful for you link1[^] and link2[^]
|
|
|
|