Click here to Skip to main content
15,918,742 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralGET ICON Pin
kedar.dave1-Feb-05 0:33
kedar.dave1-Feb-05 0:33 
GeneralRe: GET ICON Pin
ThatsAlok1-Feb-05 2:53
ThatsAlok1-Feb-05 2:53 
GeneralRe: GET ICON Pin
kedar.dave2-Feb-05 19:06
kedar.dave2-Feb-05 19:06 
Generalresize PropertySheet Pin
includeh101-Feb-05 0:32
includeh101-Feb-05 0:32 
GeneralRe: resize PropertySheet Pin
PJ Arends1-Feb-05 10:25
professionalPJ Arends1-Feb-05 10:25 
QuestionHow to get image dimensions? Pin
Monisankar1-Feb-05 0:08
Monisankar1-Feb-05 0:08 
AnswerRe: How to get image dimensions? Pin
Selvam R1-Feb-05 1:48
professionalSelvam R1-Feb-05 1:48 
AnswerRe: How to get image dimensions? Pin
viliam1-Feb-05 3:08
viliam1-Feb-05 3:08 
GeneralOverriding mouse events in Win32 Console application Pin
mahade131-Jan-05 23:49
mahade131-Jan-05 23:49 
GeneralPage Flip Effect Pin
Muneeb R. Baig31-Jan-05 23:43
Muneeb R. Baig31-Jan-05 23:43 
GeneralRe: Page Flip Effect Pin
Selvam R1-Feb-05 1:44
professionalSelvam R1-Feb-05 1:44 
GeneralRe: Page Flip Effect Pin
Alex Korchemniy2-Feb-05 13:17
Alex Korchemniy2-Feb-05 13:17 
GeneralSDI and dialog based application Pin
Johnny Peszek31-Jan-05 23:35
Johnny Peszek31-Jan-05 23:35 
GeneralRe: SDI and dialog based application Pin
wb1-Feb-05 0:38
wb1-Feb-05 0:38 
GeneralRe: SDI and dialog based application Pin
Johnny Peszek2-Feb-05 0:22
Johnny Peszek2-Feb-05 0:22 
Generalassertion fails in appcore.cpp Pin
Tariq87831-Jan-05 22:54
Tariq87831-Jan-05 22:54 
GeneralI have a problem with rotation a ball Pin
HGArmen31-Jan-05 21:54
HGArmen31-Jan-05 21:54 
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.

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.