|
|
I did try that out but I am unable to get anywhere near as
presently there are three views in my splitter window and one of the view
needs to switched with the fourth view.
Please help me out with the splitter window.
drai
|
|
|
|
|
Somebody know how can i send to other computer the user windows id because i don't know where is this information.
TACK.
|
|
|
|
|
Is GetUserName() what you are after?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi, I am new in c++ and i have done a program where i can show the files and directories of C:, for example and i have used FindFirstFile, FindNextFile and FindClose but now i don't want only show the files, i want keep these files in a package and send to other computer, but i only want to know how can i keep these files, no the communication.
Thank you very much. TACK
/Densitet
|
|
|
|
|
Add the filenames to a data structure of some sort, like a list or an array. Both of these are in the STL as well as MFC.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
This program show the files in Dos, but if i want that it shows the files in a List in a graphc interface, how can i do it, because i have create my interface but i can't wirte the files in the list.
Tack.
|
|
|
|
|
How the filenames are gathered is independent of whether you use a console or a GUI application. In either case, the FindFirstFile() /FindFirstFile() pair is used, or the CFileFind class if you are using MFC.
What type of control are you adding the filenames to (e.g., edit control, listbox, combobox, list control)? Each has its own method of "addition."
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Ok, i have to use CFileFind because i'm using MFC. I want to add the filenames in a listbox, you know what is the method?
Thanks.
|
|
|
|
|
See here.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
hai anybdy can help me.i have some keys that generated and stored in to text file. That key contain name and two dates like start date and end date.so now i want to compare the key with the given or enterd name is present in that txt file and if present compare the currentdate with dates given in the key.and give boolen like the current date exceed the end date or not? and start date less than the current date. can any body help me?
regards
shaanu
|
|
|
|
|
|
my date format is DD/MM/yyyy.can u help me?
shan
|
|
|
|
|
here is small code that compare current date with your stored date.
My date Format is YYYY-MM-DD , i Believe,you are smart Enough to modify the code according to your need.
BOOL <You Class>::FnCheckForValidDates(CString szEndDate)
{
<font color=#008000>
CTime TodayDate=CTime::GetCurrentTime();
int nYear,nMonth,nDay;
<font color=#008000>
<font color=#008000> nYear=_ttoi(szEndDate.Left(szEndDate.Find('-')));
<font color=#008000> szEndDate.Replace(szEndDate.Left(szEndDate.Find('-')),"");
<font color=#008000> szEndDate.TrimLeft('-');
<font color=#008000> nMonth=_ttoi(szEndDate.Left(szEndDate.Find('-')));
<font color=#008000> szEndDate.Replace(szEndDate.Left(szEndDate.Find('-')),"");
<font color=#008000> szEndDate.TrimLeft('-');
<font color=#008000> nDay=_ttoi(szEndDate);
<font color=#008000> <font color=#008000>
if(TodayDate.GetYear()>nYear)
return FALSE;
if(TodayDate.GetMonth()>nMonth)
return FALSE;
if(TodayDate.GetDay()>nDay)
return FALSE;
#ifdef MYDEBUG
AfxMessageBox("Returning True");
#endif
return TRUE;
}
[Vote One Here, Complete my Survey....]
Alok Gupta visit me at http://www.thisisalok.tk
"I Think Believe this Will Help"
|
|
|
|
|
Hi!
How is it possible to limit my edit control (MFC) to only accept two digits. Now it is possible to type in how many as you want. To get it to accept only numbers were no problems, is there any properties that I can set to get it to only accept two digits as well?
|
|
|
|
|
No, you will need to subclass your edit control.
It is not really complicated: with class wizard create a new MFC class and make it inherits from CEdit. Then override the OnChar() member function (response to the WM_CHAR event). In this function, if you don't want to add a new char in the edit control, don't call OnChar from the CEdit class. If the character can be displayed, then call CEdit::OnChar().
Hope this help
|
|
|
|
|
CEdit::SetLimitText
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Hi there,
I fill a ListBox (AddString(str)) from a loop.
When ListBox become full the vertical scrollbar will be appeared.
But I want to do somthing to move the scroll to down in order to the last item become appeared always.
How can I do this?
This functionality is very simple when we use CListControl, because there is a method called Scroll(...) in CListControl class for this reason.
Thanks.
|
|
|
|
|
you have to do it manually:
something like:
void DlgFlexListSelectValue::SetHorizontalScrollBar(){<br />
CString str;<br />
CSize sz;<br />
int dx = 0;<br />
TEXTMETRIC tm;<br />
CDC* pDC = m_valueList.GetDC();<br />
CFont* pFont = m_valueList.GetFont();<br />
<br />
CFont* pOldFont = pDC->SelectObject(pFont);<br />
pDC->GetTextMetrics(&tm); <br />
<br />
for(int i = 0; i < m_valueList.GetCount(); i++){<br />
m_valueList.GetText(i, str);<br />
sz = pDC->GetTextExtent(str);<br />
<br />
sz.cx += tm.tmAveCharWidth;<br />
<br />
if(sz.cx > dx){<br />
dx = sz.cx;<br />
}
}
<br />
pDC->SelectObject(pOldFont);<br />
m_valueList.ReleaseDC(pDC);<br />
m_valueList.SetHorizontalExtent(dx);<br />
}
call the function when you have loaded the listbox.
it's on MSDN somewhere.
good luck.
No hurries, no worries.
|
|
|
|
|
Thank you.
but I don't have problem with horizontal scrolling
|
|
|
|
|
idd, I misread, my apologies .
good luck though.
PS: there should be a function like SetScrollPos or something.
No hurries, no worries.
|
|
|
|
|
m_list.SetCurSel( m_list.AddString(s) );
will work for u.
It will autimatically scroll to last item and will make is selected.
Jetli
Constant Thing In World Is Change.
|
|
|
|
|
i seem to have probz with my dialog based application.....my main dialog callz a modal dialog (which basically loadz some imagez into the screen) and then when i close thiz modal dialog....i see that the memory is not freed!!!!!(i came to view that from taskmanager)....each time i call this modal dialog,it increases by a definitive amount(520kb).....i have freed the dc memery and also even the pointer dynamically created for the modal dialog.....HELP....herez the code.....
THIZ IZ HOW I HAVE CALLED THE MODAL DIALOG FROM MY MAIN DIALOG!!!!!
CMyPresetViewer *PresetViewerDlg = new CMyPresetViewer;
if(PresetViewerDlg->DoModal()==IDOK)
{
}
delete PresetViewerDlg;
THIZ IZ THE CODE THAT IZ WRITTEN IN THE MODAL DIALOG
void CMyPresetViewer::OnStatic1()
{
ReleaseDC(m_dcPresetViewerDialog);
delete m_dcPresetViewerDialog;
AfxMessageBox("done");
CDialog::OnOK();
}
BOOL CMyPresetViewer::OnInitDialog()
{
CDialog::OnInitDialog();
m_DragOn=FALSE;
CClientDC dc(this);
m_dcPresetViewerDialog->CreateCompatibleDC( &dc );
m_hBmpNew = (HBITMAP) LoadImage(
AfxGetInstanceHandle(),
MAKEINTRESOURCE(IDB_BITMAP59),
IMAGE_BITMAP,
0,
0,
LR_CREATEDIBSECTION);
if( m_hBmpNew == NULL )
{
AfxMessageBox("Load Image Failed");
}
else {
m_st0.GetClientRect( &rectStaticClient );
rectStaticClient.NormalizeRect();
m_size.cx=rectStaticClient.Size().cx;
m_size.cy=rectStaticClient.Size().cy;
m_size.cx = rectStaticClient.Width();
m_size.cy = rectStaticClient.Height();
m_st0.ClientToScreen( &rectStaticClient );
ScreenToClient( &rectStaticClient);
GetObject( m_hBmpNew , sizeof(BITMAP), &m_bmInfo );
VERIFY(m_hBmpOld = (HBITMAP)SelectObject(*m_dcPresetViewerDialog, m_hBmpNew ) );
offsetx= rectStaticClient.left;
offsety= rectStaticClient.top;
}
return TRUE;
}
void CMyPresetViewer::OnCancel()
{
CDialog::OnCancel();
}
void CMyPresetViewer::OnPaint()
{
CPaintDC dc(this);
dc.BitBlt(offsetx,offsety,m_size.cx,m_size.cy,m_dcPresetViewerDialog, 0, 0,SRCCOPY);
}
}
CAN ANYONE TELL ME WHERE I HAVE GONE WRONG!!!!!
I SEEM TO HAVE FREED AL THE RESOURCES.....
HEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEELP!!!!!
thankz in advance.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
Let me guess, the bitmat is about 520 KB in size? I suggest the next time u use an API, you look at it in MSDN first, because that's what caused your memory leak! Take a look here[^] and see what you have to do...
I also got the blogging virus..[^]
|
|
|
|
|
READ IT A MILLON TIMEZ!!!!!if ur suggesring LR_SHARED!!!thatz not it.....and by the way.....itz not a cut paste code.....and moreover i didnt put it to be graded!!!!!
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|