|
My note wasn't about you...I was talking about marketing people! One of my previous company sold me (as consultant) as a C++ and Visual Basic expert, even if (at time) I never coded a single line using VB. Even worse they didn't tell me.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I am currently writing an application using C++ and MFC. Please consider the following lines from a Window's RC file:
<br />
BEGIN<br />
POPUP "&File" {<br />
MENUITEM "&New", CALC_FILE_NEW<br />
MENUITEM "Add Account", ADD_ACCOUNT<br />
MENUITEM "Calculate", CALCULATE<br />
MENUITEM "Abort Calculation", ABORT_CALCULATION,GRAYED<br />
MENUITEM "&Exit", CALC_FILE_EXIT<br />
}<br />
.<br />
.<br />
.<br />
When the menu is displayed, I would expect the E in Exit to be underlined. However, it is not. I thought the & character was suppose to do this. What is the proper way for me to have the E underlined when the menu is displayed?
Thanks
Bob
|
|
|
|
|
Are File and New underlined?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
David,
Thanks for the response. The words File and New are not underlined when my menu is shown.
Bob
|
|
|
|
|
What if you press the Alt key?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
David,
If I press the alt key, then the first letter of each word in the top level menu becomes underlined. However, it does not affect the sub-menus. Is this to be expected?
Bob
|
|
|
|
|
BobInNJ wrote: However, it does not affect the sub-menus. Is this to be expected?
Windows itself seems to behave in the same fashion regardless of the setting on the Effects dialog box.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
There's a setting somewhere in Windows that manage how/when the menu mnemonic will be displayed.
(See display properties -> Appearance -> Effect)
See if that's working.
|
|
|
|
|
Thanks for the response. I could not find the Window's setting you described. Since other
menus are working properly (they come up underlined) I do not think the problem is with how I have
my Windows Operating System configured.
Any other ideas?
Bob
|
|
|
|
|
Press the ALT key...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark,
I am not sure what is going on, but all of a sudden the under line character is showing up.
Bob
|
|
|
|
|
Unusual sun spot activity?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
What happens if you press the ALT key?
i.e. see (for instance) this page [^].
Also wonderful things would happen if I press the browser refresh button...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I would like to thank the group for their responses in this matter. Some how, it is now working. I do not understand why?
Bob
|
|
|
|
|
so I have a data stream I'm getting through on a GPIB that was supposed to be passed through using labview, we've since determined that this isn't possible so we need to do it via C since that is what the hardware likes. the problem is that I don't know how to take the data stream I'm getting in and simply just have it output to the serial port and most of my searches haven't yielded answers.
thank you
|
|
|
|
|
Michael Lutkenhouse wrote: GPIB
is it IEC-488 you are talking about?
I used to use it a lot some 30 years ago, that is before PC's got invented...
out of curiosity what are the make and model of the interface card? does the vendor provide a driver? do you have the documentation?
what is your data rate? how will you handle data flow when outputting to RS232C?
IEC488 could deliver up to a few megabits/second, something RS232C could not sink...
How big is your stream?
|
|
|
|
|
IEEE-488 is the standard, I'm using the National Instruments GPIB to USB adapter, found here...
http://sine.ni.com/nips/cds/view/p/lang/en/nid/201586[^]
data rate is 9600 baud, not quite sure with the outputting question, the data stream is just angular data , so it should just be ~12 digits.
|
|
|
|
|
OK, that looks like a modern device (not cheap though) and it comes with a driver, so it should be rather easy to create an app that interacts with your 488 device.
I suggest you first get it to work without any serial port, just make sure you send the right commands and start getting measurement data (which you could show in a listbox or something similar). Receiving the data correct all the time is the only tricky part, since you are probably not in control as to when and how fast data arrives.
Only when that works to perfection, start adding code to send these data through the serial port; transmitting is easy as long as you can assume the target device can cope.
|
|
|
|
|
I have a sample program already compiled from the company that makes the device I'm trying to talk to which works fine, and using NI spy along with the manual I know the commands to get the data stream coming, I just don't know how to then pass it through to the serial, is there a way to just do a simple re-direct, do I need to write to a temp file, I'm just not familiar with the concept of passing a stream through since ideally it'd never be written to a file other then in memory possibly.
thank you for the help too
|
|
|
|
|
AFAIK you can't just pass a stream of data, you have to receive it, possibly in chuncks, and then transmit it, possibly in chunks; and of course when chunked you can achieve concurrency, in the end it may look as if the stream is passing through.
So you must really have the PC read the data correctly, so you later will be able to transmit it (with WriteFile if you use C++/MFC). As I said earlier reading is the tricky part.
|
|
|
|
|
The ever classic Flounder has a page on serial I/O I suggest you read.
http://www.flounder.com/serial.htm[^]
The clever parts are largely to do with serial reading, but I've used the same techniques to read from USB ADC devices in the past. As has been said in other replies, once your happy you're reading chunks at a time into a RAM buffer, spitting them out on the serial port is the easy part.
The niggles I can see:
Setting up the COM port. Then DCB structure has always been a black art. But I recently came across BuildCommDCB which looks like a handy utility function.
Buffer size for reading from the USB/GPIB device. If you can read in larger chunks, then the PC load will be lighter. But you risk getting a partial chunk, waiting an age, then getting enough data to fill up the rest of the buffer. Depending on how the NI device driver presents itself, you may be able to ask for a large buffer with a small timeout which will help. I do that with FTDI's USB devices. And they seem to popup in all sorts of places.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Hello everyone, I'm relatively new to writing code in C++ and I've been running into a problem. You see, I got a chunk of code off the internet for use in my program and it includes:
using namespace System
But the compiler doesn't like it. From what I can tell it isn't declared in the body of the code and it sounds rather like a predefined namespace. Is there something I need to include to fix this or what? Thanks in advace
|
|
|
|
|
That sounds rather like C++/CLI, i.e. C++ using .NET.
To get that working, you'll want to pass the /clr flag to the C++ compiler - and probably point questions at the C++/CLI forum, as they'll have more of a clue with C++/CLI.
|
|
|
|
|
I am thinking that the statement you want is:
using namespace std;
The namespace std is predefined in C++. The statement:
using namespace System;
should work if you have already defined the name space called System. Have you done so? I hope this helps, if not feel free to ask a follow up question.
Bob
|
|
|
|
|
linkfitz wrote: But the compiler doesn't like it.
Exactly what error message you got while compiling?
Make sure the following,
1) System namespace is applicable only for Managed C++.
2) Did you forget to put a semi-column? Apparently its missing from the code snippet that you've provided.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|