|
Folks,
Thanks for the help.
zero errors!
J
|
|
|
|
|
OK, hope I can explain my question well enough.
I have data I am reading from a database that I am displaying in a ComboBox. Parts display in ComboBox1 and Units displayed in ComboBox2.
Example data might be Screws/Box, Screws/Bag, Screwdriver/Set, Screwdriver/Single etc. When the user selects the Part I want only relevant Units in ComboBox2.
The only way to do this that I can think of is to read the Parts/Units into an array (say CStringArray) and when Part is selected read through array matching Part and listing Unit.
This gives me the advantage of having the Table and Array index in synch though seems to me to be a slow way of finding and displaying the Unit data.
Is there a better way I should be doing this?
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
|
Units yes, Parts no.
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
use a multimap ( STL ). A map alllows you to link values like this
m_Parts["fridge'} = "Big fat cardboard box";
A multimap allows for more than one value to be stored for the same index, so you could create a map entry for each storage type for each unit, and then populate the second combobox based on the first.
The alternative, which might be better, is to use a map and store an array of ints, I think you can do this
map<cstring, vector<int=""> > m_Entries; // but make sure there is a space between the two '>'s
and then create another vector or strings, which is the full list of available units. The vector of ints stores the indexes of the units for that part. This means each string is stored only once. If you wanted to sacrifice some elegance for speed, you could also make the first entry an int, the index of the item. That would be faster, but harder to debug/change.
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
Hi
I have a program designed to run in the background. In some events, the program should display information about these events. However, if a fullscreen program is running, the info isn't displayed until the user quits his/her fullscreen app. How can I guarantee that the messagebox / dialog always show up?
|
|
|
|
|
how to connect Crystal report with visual C 6.0
plz can any one send me the snip of code or any web site
Thanks
|
|
|
|
|
Hi,
Is there an utility, which searches libraries for a particular function, which library exports? Or is there any better tool than dumpbin?
Thanks,
Igor Proskuriakov
|
|
|
|
|
Perhaps a stupid question, if i calculate the difference between 2 COleDateTime, the result is a COleDateTimeSpan, and if i use the operator double to this result, i would like to know if the last result is a double?
thanks
gerald
|
|
|
|
|
What does NT stand for in Windows NT?
|
|
|
|
|
Hi,
The NT in Windows NT stands for New Technology!
|
|
|
|
|
|
|
There is also a story about the guy MS hired when they started the
NT project. He (I don't remember his name) was one of the creator
of the VMS operating system for the VAX minicomputer at Digital.
When you take VMS
and increment each letter
you have WNT !
But maybe it's just a coincidence!
|
|
|
|
|
Actually is was the old WMS team that made the first NT.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Another story ..
When you take the name of the sentient computer in 2001 A Space Oddesy, "HAL" and increment each letter you get IBM.
I believe IBM tried to sue Arthur C Clark but he insisted that it was a coincidence.
Steve T.
|
|
|
|
|
|
Numb Testicles
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
|
If it stands for New Technology, then on the W2K splash screen it says "Built on NT Technology". New Technology Technology. Very catchy.
|
|
|
|
|
Hey James, don't you know this a programmers forum. Keep your questions focused on C++ issues and I'm sure someone will help you out. For just general questions why not try the lounge. Lot's of people hang out there and will gladly take up on any discussion.
Back to the coding
Chris
|
|
|
|
|
Thank you to everybody that answered my request about the bsc file format. I have incorporated some of it in my code. However I get a linker error for the openBrowser function, no matter what I do. I have tried the c version, told the compiler where to find the .lib and .dll files. No luck
Anybody got any ideas or solutions
|
|
|
|
|
Who can give me a sample on how to use "OpenRequest" function when I want to post some data to a asp file?Or,give me some advice on this function's para when the verb=POST.
Please help me!Thank you very much.
|
|
|
|
|
Hi,
Now I have a trouble on how to detect a script
variable changed.
In my page, I use activeX control to do something
,and it will return a value. But, I don't know when
it will ? Because my control will return it asynchronously.
So, I decide to try to get the value by using
an event; but, how to do this ? And, I must do it
in ActiveX and send notification to IE or I must
do it in custom event in HTML ?
Thanks for your help
|
|
|
|
|
I want to have in my window a CStaticCtrl.
this->m_static.Create(NULL,WS_VISIBLE|WS_BORDER,CRect(0,0,0,0),this,IDC_STATIC);
Sometimes i need my control. It should lay over the CStaticCtrl!
ActiveX.Create(NULL,WS_VISIBLE|WS_BORDER|TVS_SHOWSELALWAYS,CRect(0,0,0,0),this,ID_TEST);
void CFgServerViewRight::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);
m_static.MoveWindow(0,0,cx,cy);
ActiveX.MoveWindow(0,0,cx,cy);
}
But i don't see my ActiveXControl? Whats the problem?
|
|
|
|