|
|
lol, ok...
dunno if it's enough ; give you 5 for it :p
|
|
|
|
|
Hi, I'm using the TrackPopupMenu() MFC function and would like (i really have to do this for my customer ) this contextual menu to open up on a default subitem.
I mean, assuming i have in my menu an item 1 and an item 2, and item 2 is a popup having an subitem1 and a subitem2, i need the whole menu to directly open on subitem2 selected for example.
Any idea on how to solve this ?
thanks !
|
|
|
|
|
Do you want to show contextmenu on the item for example in the listctrl ?
|
|
|
|
|
no i just want the contextmenu to openup on the desired subitem : a menu is a set of item and subitems, items having subitems beeing called popup because when passing on them, a sub-popup menu opens up. What i need is when i display my menu with TrackPopupMenu(), directly having a perticular sub-popmenu opened
|
|
|
|
|
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
|
|
|
|
|