Click here to Skip to main content
15,889,852 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: I have a problem with rotation a ball Pin
Shog91-Feb-05 10:44
sitebuilderShog91-Feb-05 10:44 
QuestionHow do I use MSXML Parser? Pin
IronMike31-Jan-05 21:48
IronMike31-Jan-05 21:48 
AnswerRe: How do I use MSXML Parser? Pin
Neville Franks31-Jan-05 23:44
Neville Franks31-Jan-05 23:44 
GeneralImage in tree control Pin
Raul Simcic31-Jan-05 21:26
Raul Simcic31-Jan-05 21:26 
GeneralRe: Image in tree control Pin
viliam31-Jan-05 22:14
viliam31-Jan-05 22:14 
GeneralFolder creation Pin
Raul Simcic31-Jan-05 21:08
Raul Simcic31-Jan-05 21:08 
GeneralRe: Folder creation Pin
22491731-Jan-05 22:04
22491731-Jan-05 22:04 
GeneralCFile file.Open assertion failure Pin
arbrsoft31-Jan-05 20:42
arbrsoft31-Jan-05 20:42 
This code is working for...
Open and Read the file "login.rec" in "RECENT" folder and add "USER_NICK" info for a combobox and enumerate "USER_NICK" for same combobox from all existing "USER_NICK.use" file.
this may have a assertion failure error
please fix this code for good working and no error.

BOOL CLogin::OnInitDialog()
{
CDialog::OnInitDialog();

CMainFrame *pMainWnd=(CMainFrame*)AfxGetMainWnd();
CDiet_caloView *pView=(CDiet_caloView*)pMainWnd->GetActiveView();

CString one1;
CString one;
CString RecentUser;
one1.Format("%s\\RECENT",pView->m_strInstallPath);
CFileStatus status;
if( CFile::GetStatus( one1, status ))
{
}
else
{
CreateDirectory(one1, NULL);
}
one.Format("%s\\RECENT\\login.rec",pView->m_strInstallPath);

if( CFile::GetStatus( one, status ))
{
CFile file;
file.Open(one,CFile::modeRead);
char ch[300];
int FileLength=file.GetLength();
file.Read(ch, FileLength);
char seps[]="#";
char *token;

token=strtok(ch,seps);
token=strtok(NULL,seps);
RecentUser.Format("%s",token);
file.Close();
}

CString sPath2;
sPath2.Format("%s",pView->m_strInstallPath);
WIN32_FIND_DATA stFindData;
HANDLE hFindFile;
CString sFile,sTextFile;
CString UserNick;
BOOL nRet;
int nCount;
int num;
char* sPtr=NULL;
sTextFile = sPath2;
sPath2 += "\\user\\*.use";
CString DD;
hFindFile = FindFirstFile(sPath2,&stFindData);
int doit=0;
((CComboBox *)GetDlgItem(IDC_COMBO1))->ResetContent();
while(hFindFile != INVALID_HANDLE_VALUE)
{
if(stFindData.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY)
{
sFile = stFindData.cFileName;
num=sFile.Find(".");
UserNick.Format("%s",sFile.Left(num));
((CComboBox*)GetDlgItem(IDC_COMBO1))->InsertString(doit,UserNick);

nCount = ((CComboBox *)GetDlgItem(IDC_COMBO1))->GetCount();
if(UserNick==RecentUser)
((CComboBox *)GetDlgItem(IDC_COMBO1))->SetCurSel(doit);
doit++;
}
nRet = FindNextFile(hFindFile,&stFindData);
if( !nRet ) break;
}
FindClose(hFindFile);
UpdateData(FALSE);
return TRUE; //return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}


Image will remind us some feelings and if I can ask someone about a problem, that's not a bad life.
GeneralRe: CFile file.Open assertion failure Pin
David Crow1-Feb-05 3:33
David Crow1-Feb-05 3:33 
GeneralNew to VC++ Pin
Munisamy31-Jan-05 19:43
Munisamy31-Jan-05 19:43 
GeneralRe: New to VC++ Pin
Yulianto.31-Jan-05 22:56
Yulianto.31-Jan-05 22:56 
GeneralRe: New to VC++ Pin
toxcct1-Feb-05 2:13
toxcct1-Feb-05 2:13 
GeneralRe: New to VC++ Pin
ThatsAlok1-Feb-05 2:56
ThatsAlok1-Feb-05 2:56 
GeneralRe: New to VC++ Pin
toxcct1-Feb-05 5:46
toxcct1-Feb-05 5:46 
GeneralRe: New to VC++ Pin
Yulianto.1-Feb-05 14:30
Yulianto.1-Feb-05 14:30 
GeneralRe: New to VC++ Pin
toxcct2-Feb-05 4:38
toxcct2-Feb-05 4:38 
GeneralRe: New to VC++ Pin
Yulianto.2-Feb-05 14:39
Yulianto.2-Feb-05 14:39 
Generaluse crystal report in visul c++(please help me) Pin
javad_200531-Jan-05 19:29
javad_200531-Jan-05 19:29 
Questioncan i use InValidateRect() to refresh my desktop Pin
uday__m31-Jan-05 19:16
uday__m31-Jan-05 19:16 
AnswerRe: can i use InValidateRect() to refresh my desktop Pin
ThatsAlok31-Jan-05 20:18
ThatsAlok31-Jan-05 20:18 
GeneralRe: can i use InValidateRect() to refresh my desktop Pin
uday__m31-Jan-05 22:10
uday__m31-Jan-05 22:10 
GeneralRe: can i use InValidateRect() to refresh my desktop Pin
Blake Miller1-Feb-05 4:45
Blake Miller1-Feb-05 4:45 
GeneralRe: can i use InValidateRect() to refresh my desktop Pin
uday__m1-Feb-05 16:22
uday__m1-Feb-05 16:22 
GeneralRe: can i use InValidateRect() to refresh my desktop Pin
Blake Miller3-Feb-05 4:37
Blake Miller3-Feb-05 4:37 
GeneralRe: can i use InValidateRect() to refresh my desktop Pin
uday__m3-Feb-05 17:36
uday__m3-Feb-05 17:36 

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.