|
Use the LB_SETTOPINDEX message (or the ListBox_SetTopIndex macro), or the LB_SETCURSEL message (or the ListBox_SetCurSel macro) if you want to select the item (LB_SETSEL to select multiple items) that has been added to the end of the list.
Regards,
--Perspx
"A refund for defective software might be nice, except it would bankrupt the entire software industry in the first year." -Andrew Tanenbaum
"Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer." -Fred Brooks
|
|
|
|
|
Thanks!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Another option, although slightly less appealing, is to send the listbox a LB_INSERTSTRING message with 0 as the index.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
This will reverse the order of the messages?
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
RomTibi wrote: This will reverse the order of the messages?
Of course it will, hence my opening remark.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Thanks! I finally used your advice.
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Hi all,
I have a struct a bit like this, which is the header to a file on disk:-
struct Header
{
short a;
short b;
short c;
float floatvalue;
}
I read the header from the disk like this:-
ReadFile(hFile,&header,sizeof(Header),&bytesRead,NULL);
Once I'd done that, the values in a,b,c are as expected, but the floatvalue is not.
However, if I adjust the struct so that instead of float, I have BYTE[4] as follows:-
struct Header
{
short a;
short b;
short c;
BYTE floatvalue[4];
}
And then after reading the header as before, I do:-
float f;
memcpy(&f,header.floatvalue,sizeof(float));
Then f contains the value expected.
I don't understand why the first version didn't work. Can anyone enlighten me please?
Thanks
Jon
|
|
|
|
|
Maybe take a look at this[^], i hope it explains what you need explained.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Thank for that, it's clear now.
Looks like a can get around the issue with #pragma pack (2)
|
|
|
|
|
I think that a
#pragma pack (1) or
#pragma pack (2) declaration before the structure's definition would help. Think so?
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Hello Team,
I have written a C++ program, which will fetch the MAC address using the GetAdaptersInfo, and this program is compiled using gcc of mingw. when i run this program in my PC, this has return valid MAC. Everything fine.
But When I run same program , where I had a wifi card and a LAN card, this program returend both the MAC address. In my program i am chacking for MIB_IF_TYPE_ETHERNET, still it is giving both the MAC.
How do i get only MAC of LAN card ? not wifi / bluetooth card?
Thank you
glamakid
|
|
|
|
|
You could try using WMI[^] and retrieving <a href="http://msdn.microsoft.com/en-us/library/aa394216%28VS.85%29.aspx" rel="nofollow">Win32_NetworkAdapter</a> [^] instances whose AdapterType is Ethernet 802.3 ?
WMI at least separates out wireless adapters.
|
|
|
|
|
Hello
Thank you . Cant I use the GetAdapter...API itself? I am not good at usign WMI program
glamakid
|
|
|
|
|
The documentation and your experience indicate that you can't. I'm guessing that at that level of abstraction, WiFi is close enough to ethernet that they can be treated the same.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hello Stuart,
I am getting both the adapter, but i want only the ethernet adapter. how can i supress the other one ?
|
|
|
|
|
As I said before, I think WIndows treats WiFi (and Bluetooth, judging from what I've seen) as Ethernet interfaces at this level of abstracvtion. You need to find some interface that's closer to the hardware that allows you to make adefinitive statement about whether an interface is 802.3 or not.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I have inserted media player activex on my dialog box, using OnPositionChangeOcx1 event i am able to get the audio slider bar position, now i want to set the slider position to some where in the slider bar.
I am not able to do that, i don't know which function i have to use for setting, becuase i am very new to this ActiveX environment..
Can any one help me regarding this..?
Your help will be appriciated...
Thanks in advance.....
Thanks
Venkatesh.
|
|
|
|
|
venki502 wrote: I have inserted media player activex on my dialog box
If you are going to use the media player activeX control in your application you might want to consult the documentation[^]
|
|
|
|
|
I like the "let me Google it" thing. Nice touch. I can't believe I haven't come across it before.
Steve
|
|
|
|
|
Stephen Hewitt wrote: I can't believe I haven't come across it before.
That's exactly what I said when I saw someone else here had used it.
|
|
|
|
|
Hi,
I have created one application in VC++, in that am using one edit box to display the values , i hav created a member variable for that edit box in that defined double datatype. My question is , if i get any exponential value, it is not displaying fully, it displays upto the size of the edit box. is there any way to see the exponential value in the edit box
Thanks,
Balaji S
|
|
|
|
|
I think CEdit is not directly support that. You can use %e or %g to format it as string and set as window text to edit control
e.g
float f = 100.234235454;
CString str;<br />
str.Format( "%e", f );<br />
editCtrl.SetWindowText( str );
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
modified on Tuesday, February 10, 2009 5:57 AM
|
|
|
|
|
Sarath. wrote: float f = 100.234235454; // some value
CString str;
str.Format( "%e", f );
editCtrl.SetWindowText( f );
I think you mean this:
float f = 100.234235454;
CString str;
str.Format("%e", f);
editCtrl.SetWindowText(str);
Steve
|
|
|
|
|
Yeap... It was a typo
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Okay this one is for the Gurus!
I am trying to open multiple modal dialogs from a parent modal dialog. However, in modal dialogs only one child dialog can be opened at a time under a parent dialog. Therefore, I have to use the applications main window to have multiple modal dialogs opened and use a map to track which dialogs belong to the parent dialog.
How can I get a handle or pointer to the childrens dialog windows to store them in my map (for the parent to track)?
My goal is to close all the parent's children dialogs once the parent's has been closed. And also consistently close them out by calling theDlg->EndDialog(IDOK) when the parent dialog has been closed by clicking "OK" or theDlg->EndDialog(IDCANCEL) when the parent dialog has been closed by clicking "Cancel".
|
|
|
|