Click here to Skip to main content
15,893,487 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Windows Threads and CPU % usage... [modified] Pin
Jijo.Raj5-Jun-08 8:58
Jijo.Raj5-Jun-08 8:58 
GeneralRe: Windows Threads and CPU % usage... Pin
Jijo.Raj5-Jun-08 18:28
Jijo.Raj5-Jun-08 18:28 
AnswerRe: Windows Threads and CPU % usage... Pin
krmed5-Jun-08 9:11
krmed5-Jun-08 9:11 
AnswerRe: Windows Threads and CPU % usage... Pin
Joe Woodbury5-Jun-08 9:35
professionalJoe Woodbury5-Jun-08 9:35 
AnswerRe: Windows Threads and CPU % usage... Pin
Nemanja Trifunovic5-Jun-08 10:08
Nemanja Trifunovic5-Jun-08 10:08 
AnswerRe: Windows Threads and CPU % usage... Pin
OCrowley5-Jun-08 13:13
OCrowley5-Jun-08 13:13 
QuestionPreview outlook express email(.eml) file in my application Pin
john56325-Jun-08 8:25
john56325-Jun-08 8:25 
QuestionProblems with variables Pin
Henitz5-Jun-08 6:55
Henitz5-Jun-08 6:55 
I could found functions that solve the problem, but there is some problem with the kind of variables, first I made a cast of the name the archive, it solve but it did't with CStringArray line; to LPCTSTR

tried:
AppendLineToMultilineEditCtrl(m_Edit,LPCTSTR(line::GetData()));
It gave the error:

Error 1 error C2510: 'line' : left of '::' must be a class/struct/union c:\Users\henitz\Documents\Visual Studio 2005\Projects\CodeDecodeCPlus2\CodeDecodeCPlus2\CodeDecodeCPlus2Dlg.cpp 108
Error 2 error C3861: 'GetData': identifier not found c:\Users\henitz\Documents\Visual Studio 2005\Projects\CodeDecodeCPlus2\CodeDecodeCPlus2\CodeDecodeCPlus2Dlg.cpp 108

Thanks


void CCodeDecodeCPlus2Dlg::OnBnClickedCode()
{
// TODO: Add your control notification handler code here
if (m_Code)
{
CStringArray line;
ReadTextFile(LPCTSTR("Teste2.txt"),line);
AppendLineToMultilineEditCtrl(m_Edit,line);
}

}


void AppendTextToEditCtrl(CEdit& edit, LPCTSTR pszText)
{
// get the initial text length
int nLength = edit.GetWindowTextLength();
// put the selection at the end of text
edit.SetSel(nLength, nLength);
// replace the selection
edit.ReplaceSel(pszText);
}
void AppendLineToMultilineEditCtrl(CEdit& edit, LPCTSTR pszText)
{
CString strLine;
// add CR/LF to text
strLine.Format(_T("\r\n%s"), pszText);
AppendTextToEditCtrl(edit, strLine);
}
void ReadTextFile(LPCTSTR pszFileName, CStringArray& arrLines)
{
arrLines.RemoveAll();
CString strLine;
TRY
{
CStdioFile file(pszFileName, CFile::modeRead);
while(file.ReadString(strLine))
arrLines.Add(strLine);
}
CATCH_ALL(e)
{
e->ReportError(); // shows what's going wrong
}
END_CATCH_ALL
}
AnswerRe: Problems with variables Pin
toxcct5-Jun-08 7:03
toxcct5-Jun-08 7:03 
GeneralRe: Problems with variables [modified] Pin
Nelek5-Jun-08 7:08
protectorNelek5-Jun-08 7:08 
GeneralRe: Problems with variables Pin
Henitz5-Jun-08 8:42
Henitz5-Jun-08 8:42 
AnswerRe: Problems with variables Pin
Nelek5-Jun-08 7:07
protectorNelek5-Jun-08 7:07 
AnswerRe: Problems with variables Pin
Jijo.Raj5-Jun-08 8:46
Jijo.Raj5-Jun-08 8:46 
GeneralRe: Problems with variables Pin
Henitz5-Jun-08 9:20
Henitz5-Jun-08 9:20 
GeneralRe: Problems with variables Pin
Nelek5-Jun-08 12:32
protectorNelek5-Jun-08 12:32 
AnswerRe: Problems with variables Pin
Stephen Hewitt5-Jun-08 16:18
Stephen Hewitt5-Jun-08 16:18 
AnswerRe: Problems with variables Pin
Nibu babu thomas5-Jun-08 17:23
Nibu babu thomas5-Jun-08 17:23 
QuestionEnumerating through local drives Pin
JBAK_CP5-Jun-08 6:53
JBAK_CP5-Jun-08 6:53 
QuestionRe: Enumerating through local drives Pin
David Crow5-Jun-08 7:24
David Crow5-Jun-08 7:24 
AnswerRe: Enumerating through local drives Pin
Stephen Hewitt5-Jun-08 16:25
Stephen Hewitt5-Jun-08 16:25 
GeneralRe: Enumerating through local drives Pin
JBAK_CP5-Jun-08 17:39
JBAK_CP5-Jun-08 17:39 
AnswerRe: Enumerating through local drives Pin
Hamid_RT6-Jun-08 1:26
Hamid_RT6-Jun-08 1:26 
QuestionRichEditControl in Visual c++ 6 or in C Win 32 programming Pin
mamp5-Jun-08 6:32
mamp5-Jun-08 6:32 
AnswerRe: RichEditControl in Visual c++ 6 or in C Win 32 programming Pin
Nelek5-Jun-08 7:01
protectorNelek5-Jun-08 7:01 
QuestionHow can I display current time in dialog static control Pin
amistry_petlad5-Jun-08 5:23
amistry_petlad5-Jun-08 5:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.