|
Thanks for taking the time to give your input. You sound like you have experience with the library, thanks.
Now that you explain it, that's probably what Louis meant by what he said.
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
I'd like to use <vector> to create a multi-dimensional array holding
a string, int, int. . .
something like this
Name Wage Age Ranking
===== ==== === =======
Ben 9 29
Matt 16 38
.
.
Tom 21 50
Then I would like to use std::sort to sort first by age, then by wage. Then I'd like to rank them by wage within their age decade (twenties, thirties, etc.).
Though this is new ground for me (typically i'd hack something using linked list or a bubble sort; but i have seen
single array examples which are more efficient).
After the sort, I would like to rank by the first int ,"wage", creating
a table that can be presented in a Windows GUI app. It should be compatible with .NET (how is that different from what I'm accustomed to Visual C++ 6.0?]
Thanks
|
|
|
|
|
vinniez_ok wrote: It should be compatible with .NET
How do you mean - are you using C++/CLI, or do you mean you want it to work in VC++.NET, but not in .NET code ?
VC6 STL sucks, but writing a function object that works in VC6 shouldn't be a problem, and it iwll work in 2002/2003/2005, too. I believe I have an article on the topic of function objects, which seems to be what you want, on this site. Just search for my surname, and choose the article you need.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Thanks did so and found some useful code.
Not having experience with .NET, I'm not sure why there's this requirement.
Thanks Christian for your quick reply
Appreciated!
Vin
|
|
|
|
|
Hi Christian
What I have to do is a very small piece of code that sends a table from compiled C++ code to a Windows GUI.
I've been searching for days for something extremely simple to send 4 columns/10 rows of data out and can't find anything without a lot of clutter.
I realize it's not proper to ask for code but I don't anticipate having to do this again with my C++ code --Do you know of a posting or some tutorial that can pull off this very easy event?
Thanks much!
Vin
|
|
|
|
|
Would this be a good start?
import java.awt.event.*;<br />
import javax.swing.*;<br />
<br />
public class WinBlank {<br />
public static void main( String[] args ){<br />
JFrame jFrame = new JFrame("Blank window");<br />
WinHandler windowHandler = new WinHandler();<br />
jFrame.addWindowListener(windowHandler);<br />
jFrame.setSize(400, 200);<br />
jFrame.setLocation(50, 50);<br />
jFrame.setVisible(true);<br />
}<br />
}<br />
<br />
class WinHandler extends WindowAdapter {<br />
public void windowClosing(WindowEvent event){<br />
System.exit(0);<br />
}<br />
}<br />
|
|
|
|
|
vinniez_ok wrote: I realize it's not proper to ask for code
No, that's not true. We don't like it when people who have not tried anything ask for their homework to be done.
If I had to send tabular data anywhere, I'd do it as XML. Depending where the data comes from, a DataTable is another candidate.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Thanks Christian but for the little bit of data I'm using XML would overcomplicate things for me.
I'm thinking that Win32 would have what i need.
A table like this ::
name age wage ranking
Joe5 2 99 1
Joe9 7 1 1
Joe2 7 10 2
Joe1 14 1000 1
Joe4 25 1 1
Joe6 26 5 2
Joe8 26 20 3
Joe7 26 50 4
Joe3 26 500 5
is all I'm looking to output into a no-frills window that pops up after C++ compilation.
Thx!
Vin
|
|
|
|
|
OK, so it's just a rendering issue ? Looks like a job for a listview to me.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
is it possible to make a normal button pressed and lock it until its pressed again?
|
|
|
|
|
yes, it is.
set a radio or a checkbox, and change its property "Toogle Button" to True
|
|
|
|
|
thnx for the reply.
but the problem here is i hav more than 1000 buttons in my applicaton, so quit big work to change those buttons to check boxes and set toggle to true. can u provide me way for normal buttons.
Raj Gopal
|
|
|
|
|
Various Ways.-
1. Find out in a 3 button dialog what needs replacement, Load the .RES File in a Wordprocessor, and make relevant changes by Text replacement.
2. I do not believe that you wrote all this code for more than 1000 buttons, without testing for 2 or 3 first. but, maybe that's experience on my part
3. If you have thousands of buttons in your dialog template, you're at the wrong end of the stick. in 'OnInitDialog(), run a for(...)statement to go through each item to first retrieve the style, and then add the relevant style bit.
There's an Old Irish saying though,
"If I wanted to go where you tell me you want to go, If I where you, I would not have started where you are now". Think about it!!!
LateNightsInNewry
|
|
|
|
|
radio button and check boxes ARE normal buttons... only the style changes...
|
|
|
|
|
create a checkbox/button and set the BS_PUSHLIKE style ( either by code or in the resource editor )
|
|
|
|
|
Can someone direct me to information on how to 'activate' a button (that is either ON or OFF) without clicking on it ---- using only code to manipulate the action that would normally occur if the user clicked on it.
Thanks very much.
John P.
|
|
|
|
|
CButton m_button;
m_button.EnableWindow(TRUE);
|
|
|
|
|
Do you mean:
(1) making the button to have the Focus ?
SetFocus();
(2) making the button Enabled?
EnableWindow(TRUE);
(3) making the button (previously hidden) to appear?
ShowWindow(SW_SHOW);
(4) ...
hope that helps...
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.
|
|
|
|
|
What Language are U Using?? What Compiler, etc.!
LateNightsInNewry
|
|
|
|
|
1) Use SendInput
2) Use two SendMessage calls, one with WM_LBUTTONDOWN and one with WM_LBUTTONUP with the appropriate coordinates.
3) Use mouse_event (I think it still exists).
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Actually I have 2 bytes hexavalue and I want to convert into decimal value in C language could some one tell me how can i do that.
ikram
|
|
|
|
|
if you have two bytes worth of data that you want to interpret as an integer: __int16 i = *(__int16 *)pYour2Bytes;
if you have two strings:
char *p;
int i1 = strtol(pStr1, &p, 16);
int i2 = strtol(pStr2, &p, 16);
int i = (i1 << 8) + i2;
if you have one string:
char *p;
int i = strtol(pStr1, &p, 16);
|
|
|
|
|
thx..
I have some thing like that.
unsigned char DATA[25]; // DATA array consist of hex values.
I want to convert DATA[1] and DATA[2] contain hexadecimal values that is (0x00 0x02) into the decimal value.plz let me knw accordindly..thanks in advance.
|
|
|
|
|
__int16 i = *(__int16 *)pYour2Bytes;
FYI: unsigned chars do not contain "hexadecimal values" . a uchar contains 8 bits which can be combined to represent numeric values from 0 to 255 in decimal, or 0 to 0xff hex, or 0377 in octal, or 00000000 to 11111111 in binary, or any other base you prefer to use.
|
|
|
|
|
Please explain what you want to achieve. It appears you want to read two Text Strings, base 16, and combine them into one int.Why only shift 8 bits,etc. A lot depends on your End Pointer &p, which appears to be not modified between calls. How are you sure that p points to a valid end value in BOTH Strings. Me thinks that your code cannot make sense!
See your Standard header File for
'long strtol( const char *nptr, char **endptr, int base );'
LateNightsInNewry
|
|
|
|