|
i am calling an exe from a batch file. when i run this batch file it should hide the exe window(ie dos window ) how to hide this dos window from batch file
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
|
hmm yes but the batch file is inturn called by my program.
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Then do as advised in this answer to your previos question and hide the dos window running the batch file
hide dos windows[^]
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
Could you use of CreateProccess for run exe file
|
|
|
|
|
My program works fine if the temperature entered is above 30(say 100).. it will perform the calculations and output the result. I need it to also output the number if it is below 30 (if i enter 29, it outputs 29) but i can't get it to output anything. Thnx for the advice.
#include "stdafx.h"
#include <iostream>
using namespace std;
float CheckCent(float c)
{
if (c > 30.0)
{
c=(c-32.0)/(1.80); return c;
}
return c;
}
int _tmain(int argc, _TCHAR* argv[])
{
float myarray[50];
int flag;
flag=1;
int i;
for(i = 0; i < 50 && flag == 1; i++)
{
cout << "Enter Temperature Reading:";
cin >>myarray[i];
cout << "Enter 1 to input more values, 0 to stop";
cin >>flag;
}
cout << "\n\nNumber of elements in the array is: " << i <<endl;
cout <<"\n";
for(int j=0;j<=i;j++)
{
if(myarray[j]>30.0)
{
myarray[j]=CheckCent(myarray[j]);
cout <<"The corrected value is: ";
cout <<myarray[j] <<" Celsius";
cout <<"\n\nProgram Complete!\n\n";
}
}
return 0;
}
|
|
|
|
|
In your program you are allowing only the input value thats greater than 30 for the conversion. if(myarray[j]>30.0)
And in CheckCent function also you are having the checkpoint
if (c > 30.0)
Remove them. So that it work for other values too. And check your conversion factor too.
Below is the formula for converting Faren... to Celsius
(Tc = (5/9)*(Tf-32); Tc = temperature in degrees Celsius, Tf = temperature in degrees Fahrenheit)
|
|
|
|
|
This is the output I get from my program now, but after it ouputs the correct value it says outputs another number like -12323e.6 and then says "Program Complete!" again. How do i get rid of this second output? Im also getting an error message - line [14] conversion from double to float, possible loss of data. Thanks.
#include "stdafx.h"
#include <iostream>
using namespace std;
float CheckCent(float c)
{
if(c>30)
{
c=(c-32)/(1.80); return c;
}
else return c;
}
int _tmain(int argc, _TCHAR* argv[])
{
float myarray[50];
int flag;
flag=1;
int i;
for(i = 0; i < 50 && flag == 1; i++)
{
cout << "Enter Temperature Reading:";
cin >>myarray[i];
cout << "Enter 1 to input more values, 0 to stop";
cin >>flag;
}
cout << "\n\nNumber of elements in the array is: " << i <<endl;
cout <<"\n";
for(int j=0;j<=i;j++)
{
myarray[j]=CheckCent(myarray[j]);
cout <<"The corrected value is: ";
cout <<myarray[j] <<" Celsius";
cout <<"\n\nProgram Complete!\n\n";
}
return 0;
}
|
|
|
|
|
Try this
for(int j = 0; j < i; j++)
instead of this
for(int j = 0; j <= i; j++)
-- modified at 10:22 Monday 9th April, 2007
|
|
|
|
|
I have a Property Sheet, I add 5 page in to the sheet. I want to change page name at runtime.
Please help me.
Thanks a lot,
Papais
|
|
|
|
|
dungpapai wrote: I want to change page name at runtime.
Since a CPropertyPage is nothing but a CWnd , you can use its SetWindowText() method to change its caption.
/ravi
|
|
|
|
|
I have used SetWindowText() at OnInitDialog() function of each pages but it does not success.
Papais
|
|
|
|
|
hi!
I have put two radio. one is singleselect and second is multiselect.
I want to set the click event on radio button for enable/disale Combobox and Listbox control.
for single select on which event of radio button.I have to write the code. Is BN_CLICKED ?
if it is then how can I write?
Please give me some guidline
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
Is there a Win32 API I can call to get the total physical RAM of the computer?
It would also be nice to get "Available physical memory" as well, but that's not really a huge concern. But it probably involves using some awful API like WMI or PDH.
|
|
|
|
|
|
Brilliant. I knew it had to be simple. I think I'll use both GlobalMemoryStatusEx() and GlobalMemoryStatus() to make sure I handle all Windows platforms cleanly.
|
|
|
|
|
hi
I will ask a question but I don't know it is about the subject I wrote.I have a dialog box with an edit box and from this dialog box I created a new dialog box.And in second dialog box I will put many pushbuttons because I want to use it like a keyboard.When I push a button in second dialog box,it shoud write a letter at the edit box in first dialog box and the second dialog box will not be closed when I push the button.I tried many ways but in the first dialog box I coudn't get the knowledge of which button is pushed in second dialog box.How can I do that?
Thanks
|
|
|
|
|
Here's one way:- Add a public method to your first dialog box, that appends a letter to the edit control. For example:
void CFirstDlg::TypeLetter
(CString theLetter)
{
CString strText;
CEdit* pEditBox = GetDlgItem (IDC_EDIT_BOX)
pEditBox->GetWindowText (strText);
strText += theLetter;
pEditBox->SetWindowText (strText); <code>
int nLen = strText.GetLength();
pEditBox->SetSel (nLen, nLen, TRUE); <code>
}
- When you create your second dialog, pass it a pointer to the first dialog box. In the button handlers of your second dialog box, "send" the typed keystroke to the first dialog box. For example:
void CSecondDlg::TypeD()
{
m_pFirstDlg->TypeLetter ("D");
}
/ravi
|
|
|
|
|
Thanks
But I am beginner and I couldn't understand some parts.
First of all is this program will write the letter to first dialog box at the same time when I pushed the button in the second dialog box?Which part of the program provide this?And lastly,where I am declaring m_pFirstDlg?
Thanks again.
|
|
|
|
|
Which part of code is hard for you?
|
|
|
|
|
I tried a similar code in my project but I couldn't achieve.I declare a new object in second dialog box like;
void CSecondDlg::TypeD()
{
CFirstDlg firstDlg;
firstDlg.TypeLetter("d");
}
The problem is that for me I think the method in second dialog box is creating a new object which is different from the First dialog box own object.And when I add a letter in second dialog it is directly adding the letter to its own object so I couldn't see the letter in first dialog box(is it true?I am only thinking and I am not experienced).Maybe I don't know how thay are communicate with each other.
|
|
|
|
|
Do you want to send some values of a dialog to another dialog,if yes you can use of this line
CFirst *m_First=(CFirst*)GetParent();
<code>m_First->m_str;</code> or <code>m_First->yourcontrol</code>
|
|
|
|
|
iayd wrote: is this program will write the letter to first dialog box at the same time when I pushed the button in the second dialog box?
Yes.
iayd wrote: Which part of the program provide this?
I'm not sure I understand your question.
iayd wrote: where I am declaring m_pFirstDlg?
m_pFirstDlg is declared in the second dialog box and is a pointer to the first one. When the first dialog box creates the second one, it should pass a pointer to itself to the 2nd dialog box. That pointer is stored in the second dialog box's member variable m_pFirstDlg . Alternatively (as has WhiteSky has pointed out), the 2nd dialog box can get at the first dialog box by calling GetParent() , since it (the 2nd dialog box) is the child of the first one.
/ravi
|
|
|
|
|
Thanks to ravi and WhiteSky.
These answers solved my problem.
|
|
|
|
|
How to restrict the user to collapse the items in a tree control, it should always be expanded mode.
|
|
|
|