I want to ask: "m_bCleaup variable and WN_USER_THREAD_WAITED variable".How are they declared?and how to use them?
camuoi288
Posts
-
Open other Application From Dialogue -
Open other Application From DialogueMy question is how to call a application (example FireFox.exe) when i click in "Open" Button on Dialogue.I don't know use CreateProcess in function : "void CthunghiemDlg::OnOpen" because CreateProcess is function return Bool Value,and with what value of this function is a application called?
-
Open other Application From DialogueExample i want to call InternetExplorer.exe when i click on "Open" button,so what code i need add to "void CthunghiemDlg :: OnOpen". Because CreateProcess is function return Bool Value.
-
Open other Application From DialogueI have a Dialogue and a Button "Open".I want when i click on "Open" Button,an other application will open.I know MFC guide to use CreatProcess Function but i don't know how to add this function into "Open" Clicked event.:(.Please help me. Example i have:
void CThunghiemDlg::OnButtonOpen()
{
// TODO: Add your control notification handler code here}
-
how to transfer Cstring to floatI also used atof(),but with atof() parameter in atof()function is char * but my string is Cstring.:(
-
how to transfer Cstring to floatHow to transfer Cstring type like : 6.591E+02 to float type. exmple : Cstring a="6.591E+02"; float b; and i want b=6.591E+02.I work with MFC.Thanks.
-
How to get String from ".txt" file and transfer to floatMy problem is when i want show a result at Editbox(only show a element of array) then it's errored,and Editbox don't show anything.:(.I want to know be this code errored?:
for (i=1;i<count_line;i++) { int c; char *kytux,*kytuy; c=tamthoi.Find(" ",21*(i-1)+9); cx[i]=tamthoi.Mid(c+1,9); cy[i]=tamthoi.Mid(c+6,9); sscanf(cx[i],"&c",&kytux); sscanf(cx[i],"&c",&kytuy); x[i]=atof(kytux); y[i]=atof(kytuy);
-
How to get String from ".txt" file and transfer to floatI want to get String as : "6.591E+02" from text file,and transfer it to float.My file have a form: STT x y 1 6.591E+02 8.575E+02 2 7.350E+02 9.289E+02 3 7.234E+02 1.078E+03 4 6.844E+02 1.191E+03 5 5.951E+02 1.306E+03 6 4.125E+02 1.259E+03 my code as:
CString m_file; UINT nOpenFlags; nOpenFlags = CFile ::modeRead|CFile ::modeCreate; UpdateData(TRUE); CFileDialog dlg(TRUE,0,0,OFN_HIDEREADONLY | OFN_FILEMUSTEXIST,"All Files (*.txt)|*.txt||"); if (dlg.DoModal()==IDCANCEL) return; m_file=dlg.GetPathName(); int i,count,j; count =0; UINT nOpenFlags1; CStdioFile Inputfile; CFileException File; CString s; tamthoi=""; nOpenFlags1=CFile ::modeRead; if(!Inputfile.Open(m_file,nOpenFlags1,&File)) { File.ReportError(); } while(Inputfile.ReadString(s)) { count++; tamthoi+=s; } Inputfile.Close(); count_line=count; if(!Inputfile.Open(m_file,nOpenFlags1,&File)) { File.ReportError(); } m_Listfile.ResetContent(); for(i=0;i<count_line;i++) { Inputfile.ReadString(s); m_Listfile.AddString(s); } Inputfile.Close(); CStringArray cx,cy; cx.SetSize(count_line); cy.SetSize(count_line); x= new float[count_line]; y= new float [count_line]; for (i=1;i<count_line;i++) { int c; char *kytux,*kytuy; c=tamthoi.Find(" ",21*(i-1)+9); cx[i]=tamthoi.Mid(c+1,9); cy[i]=tamthoi.Mid(c+6,9); sscanf(cx[i],"&c",&kytux); sscanf(cx[i],"&c",&kytuy); x[i]=atof(kytux); y[i]=atof(kytuy); } UpdateData(FALSE);