|
zahid_ash wrote: would that method continue till its end even the timer has been killed
Nope!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
hi
I want to get the following details of my system in VC.
1)Processor config(eg:233 Mhz)
2)RAM size
3)Display Adapter
4)Monitor Resolution
5)CDROM Drive,Keyboard,Network Card etc
I need this details on Win XP & Win 2000.
Which API gives list of all these details including RAM Size??
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
QuickDeveloper wrote: hi
I want to get the following details of my system in VC.
1)Processor config(eg:233 Mhz)
2)RAM size
3)Display Adapter
4)Monitor Resolution
5)CDROM Drive,Keyboard,Network Card etc
I need this details on Win XP & Win 2000.
Which API gives list of all these details including RAM Size??
For Monitor resolution use GetSystemMetrics .
For Memory use GetMemoryStatus .
For Processor use GetSystemInfo .
Well the only complete answer for all of them is WMI . WMI gives in depth details for each of them.
Nibu thomas
Software Developer
Programming Tips[^]
|
|
|
|
|
Nibu thomas wrote: WMI gives in depth details for each of them
could you give me some links or Sample Code which uses WMI..
Thanx for the reply
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
QuickDeveloper wrote: could you give me some links or Sample Code which uses WMI..
There are plenty of samples. Go google.
Nibu thomas
Software Developer
Programming Tips[^]
|
|
|
|
|
|
NiceNaiduChk Dis :
http://www.codeguru.com/Cpp/W-P/system/article.php/c5773[^]
But why to me...
Nibu thomas
Software Developer
Programming Tips[^] My site[^]
|
|
|
|
|
Nibu thomas wrote: But why to me...
he forget that
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi,
I have developed a dialog base application with some control on this as:
Static Frame, Button, TextBox, ComboBox,
I had render the image on the static frame and used Key Up, Key Letf, Key Right and Key Down to control this image.
But while I pressed the key to control left, right or down, up, I see that mouse cursor still focus on the Button, TextBox, and ComboBox, It maybe make the data change that I have not wanted in this case, so I need to want to let cursor focus just only on static frame image and do not let focus mouse cursor with the orther control on main dialog.
Please help me with this.
Thank in advance!
|
|
|
|
|
huutribk2001 wrote: I had render the image on the static frame and used Key Up, Key Letf, Key Right and Key Down to control this image.
But while I pressed the key to control left, right or down, up, I see that mouse cursor still focus on the Button, TextBox, and ComboBox, It maybe make the data change that I have not wanted in this case, so I need to want to let cursor focus just only on static frame image and do not let focus mouse cursor with the orther control on main dialog.
Please help me with this.
Can you be more specific. It's not clear from your description what you want.
Is the static control not gaining input focus? What is the ID of the static control. Is it IDC_STATIC well if it is then change it to something else and set SS_NOTIFY style on.
Nibu thomas
Software Developer
Programming Tips[^]
|
|
|
|
|
Yah, Sorry for not clearly to you.
I have the main dialog with ID: IDD_TEST_DIALOG
On this i added some control bellow:
a button: IDC_BUTTON1
a combo box: IDC_COMBO_MON1
two radio button: IDC_RADIO_CHECK_ANTI_ON and IDC_RADIO_CHECK_ANTI_OFF
a Text Box: IDC_FILE_EDIT
and a Static Frame IDC_IMAGE
Now, I have implemented a call back function to control the image by pressing the key as Key Up, Key Down, Key Right and Key Left.
It work well but while I press the key I see that the mouse cursor is focus on Button, then continue to change to the other control as TextBox, combo box or radio button if I still press Key Left or key right.
So, I want to do not let the mouse cursor focus on all the Control above on the main dialog while I press Up, Down, Left, Right key to control my image.
Please help me again!
Tx - Tri
|
|
|
|
|
huutribk2001 wrote: So, I want to do not let the mouse cursor focus on all the Control above on the main dialog while I press Up, Down, Left, Right key to control my image. Please help me again!
I guess you can remove WS_TABSTOP style from other controls. Of course this disables using tab and sometimes arrow keys.
You can also do this using the resource editor. There must be an option for tabstop .
Or another option is to override PreTranslateMessage to disable this behavior if input focus is on your control.
Nibu thomas
Software Developer
Programming Tips[^]
|
|
|
|
|
hi ..
Im doing a multithreaded program (in borland c++ builder.. I know that this place is for VC++ but a have no other place to go and I trust the knowladge of the ppl in this site..)that communicate with a modem via serial port.. my program takes characters from Edit1 then writes it to the buffer
strcpy( cp2, Edit1->Text.c_str() );<br />
WriteABuffer(m_hCom,cp2,strlen(cp2));
the problem is that there is something wrong with this ..I use a serial port spy program to monitor the serial port..now when I end an "AT command" like "AT", I send is like this "AT\r" but is show me this
[22/05/2006 10:18:25] - Written data<br />
<br />
41 54 5c 72 AT\\
but when I assign cp2 = "At\r"; it works!!
cp2 = "At\r"; <br />
WriteABuffer(m_hCom,cp2,strlen(cp2));
it shows :
[22/05/2006 10:24:53] - Written data<br />
<br />
41 54 0d AT.
which is right and the modem will respond by sending "ok".
"Edit1->Text" is AnsiString and "Edit1->Text.c_str()" is used to get the string from it..
Im using standerd writeFile ReadFile functions..
how can I solve this problem..I need to type commands in the Edit1 box so I can deal with the port while my program is running ..can you help please??
|
|
|
|
|
Hi
strcpy( cp2, Edit1->Text.c_str() );
WriteABuffer(m_hCom,cp2,strlen(cp2));
In the first case you typing AT\r in the edit box and sending it directly.
as you can see the HEX code of it
A T \ r
41 54 5c 72
and in the second case its different.
So the problem is instead of writting AT\r in the edit box you should just type AT.
and in the coding you change a little. I am writting in C as I don't know borland C++.
strcpy( cp2, Edit1->Text.c_str() ); // AT only.
strcat( cp2, "\r" );
WriteABuffer(m_hCom,cp2,strlen(cp2));
Regards
Anil
|
|
|
|
|
thanks that works.. I totally forgot about the hex value..I did it like this ..
AnsiString tmp;<br />
tmp= Edit1->Text + "\r" ;<br />
WriteABuffer(m_hCom,tmp,strlen(tmp));
thanks again...;)
|
|
|
|
|
I have a CEdit control that pulls in the persons name.
The name has to be exactly 40 characters and if its less
than 40 characters, the remainder has to be blank spaces.
I has this code:
void CWizardPage1::OnKillfocusTr15() <br />
{<br />
CString str;<br />
m_tr_15.GetWindowText(str);
<br />
str.MakeUpper();<br />
<br />
str = str.Left(40);<br />
<br />
if (str.GetLength() < 40)<br />
{<br />
int diff = 40 - str.GetLength();<br />
<br />
for (int i=0; i<diff; i++)<br />
str += " ";<br />
}<br />
<br />
m_tr_15.SetWindowText(str);<br />
}
Anyone have any suggestion or rewriting this so that
I dont use the for loop. Im hoping there is an easier
way to quickly add a variable length of blank spaces.
Please, any response any one can give me will be
greatly appreciated.
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|
|
DanYELL wrote: void CWizardPage1::OnKillfocusTr15()
{
CString str;
m_tr_15.GetWindowText(str); // name
str.MakeUpper();
str = str.Left(40);
if (str.GetLength() < 40)
{
int diff = 40 - str.GetLength();
for (int i=0; i str += " ";
}
m_tr_15.SetWindowText(str);
}
I have not tested, but it should work.
BOOL CWizardPage1::OnInitDialog()<br />
{<br />
m_tr_15.SetLimitText(40); <br />
}
void CWizardPage1::OnKillfocusTr15() <br />
{<br />
CString str;<br />
<br />
m_tr_15.GetWindowText(str);
str.MakeUpper();<br />
<br />
<br />
if (str.GetLength() < 40)<br />
{<br />
<br />
<br />
char sTail[41] = {0};<br />
memset(sTail, ' ' , 40);<br />
str += sTail;<br />
}<br />
<br />
m_tr_15.SetWindowText(str);<br />
}
Maxwell Chen
|
|
|
|
|
Hi I have a situation where I want to performance test an application. I recorded the http request that goes to the server which is using zip compression. That means the request is in a .zip format with 2 files inside it. One file is having all the dynamic data like user id and all the primary keys. other one has some raw data. Because I need to send this request over and over again to the server with different key data I need to manipulate the file that has the userid and replace the userid with different values and send it to the server.
Now the question is are there any available functions that help me ? I heard about 'minizip' package but how to use that ? if anyone of you have used them before please help me.
Thanks
|
|
|
|
|
There are several articles on this site regarding zip files. I would search for them but I am on a very slow connection in an airport right now.
|
|
|
|
|
There are several third party packages available. If just for testing, you could spawn a command line utility from within the program.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Rick and Joe
Please accept my 'Thanks' for your quick replies.
I will detail my requirements as soon as I get to office tomorrow.
I found LiteZip/LiteUnzip on this forum which may help me!
Thanks again
|
|
|
|
|
Please help me!
I use directshow to display a live-kamera in my Application.
Perhaps i have to use Sockets, but how can i transfer the Videostream (directshow) to another Computer and display it in an application?
Can anybody help me, i just don't know what to do!
|
|
|
|
|
Thanks For each one work in the best Site in World
"codeproject"....
can i make my program "Create new Menu or Icon for itself"
When MFC program setup on any pc.
i ask all sites, but ...
Please Idea or Instruction in MFC to work this,as Quickly
because this idea is my Graduation project
please answering must be before week.
thanks in advance
the code project is the best
|
|
|
|
|
Look into the resource editor.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I need to store and access a lot of small separate files. Whats the best way to group them together in an archive like single file (not compressed for fast access reason) and not to waste disk space. are there source codes?
9ine
|
|
|
|