|
i want to know that CTTListBox is not in the listbox type as i want to declare a variable of this type.
when i decalare this directly or by changing CListBox type then it gives error
plz tell me how can i use this
Ashish Dogra
MCA
Noida
|
|
|
|
|
|
hi all,
i wantto create a Splitter View Please help me out.
thanks and regards,
uday.
|
|
|
|
|
Call OnCreateClient in you CMainFrame class and make the changes approprialtely.
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
if (!m_wndSplitter.CreateStatic(this, 1, 2))
{
TRACE0("Failed to CreateStaticSplitter\n");
return FALSE;
}
if (!m_wndSplitter.CreateView(0, 1,
pContext->m_pNewViewClass, CSize(0, 0), pContext))
{
TRACE0("Failed to create first pane\n");
return FALSE;
}
if (!m_wndSplitter.CreateView(0, 0,
pContext->m_pNewViewClass, CSize(200, 0), pContext))
{
TRACE0("Failed to create second pane\n");
return FALSE;
}
SetActiveView((CScrollView*)m_wndSplitter.GetPane(0,1));
return true;
}
Hope that helps.
Fortitudine Vincimus!
|
|
|
|
|
Hi,
I want to add some code when the 'X' button on the top right of a dialog box is pressed. For example if the window size is changed, maximises/minimised we add the code in OnSize() function (WM_SIZE).
Please can you tell me how to know when the 'X ' button is pressed.
Thanks,
Tara
Fortitudine Vincimus!
|
|
|
|
|
Handle WM_CLOSE Message.
Jubin Chawda
braindrain1@rediffmail.com
-----------------------------
Come online at:-
fitiyal@yahoo.com
|
|
|
|
|
Yes, of course!! Silly of me. I did not see properly.
Thank you.
Fortitudine Vincimus!
|
|
|
|
|
yes you can useWM_CLOSE if this is your question or you want to write your button instead Close button
whitesky
|
|
|
|
|
I want a message box to appear asking the user if he wants to save his work when he closes the dialog box.
Fortitudine Vincimus!
|
|
|
|
|
int int nIndex=MessageBox("Are your sure to exit,"Question",MB_YESNO); and check return value
whitesky
|
|
|
|
|
Yes. Thank you.
Fortitudine Vincimus!
|
|
|
|
|
Hi All
I am having a problem in my application, what I am doing is:
Calling a function SaveKeys(TCHAR *) within a loop and this function save the specified registry key to a .reg file,
for this using CreateProcess( ) for calling regedit.exe from command line and WaitForSingleObject( ) function.
code looks like this
<br />
for (int i = 0; i < 10; i++)<br />
{<br />
SaveKeys(cRegistryKey );
}<br />
<br />
void MyClass::SaveKeys(TCHAR *cRegistryKey)<br />
{<br />
STARTUPINFO StartupInfo;<br />
PROCESS_INFORMATION ProcessInformation;<br />
<br />
CreateProcess(NULL, cCommand,NULL,NULL,FALSE,CREATE_DEFAULT_ERROR_MODE|CREATE_SUSPENDED,NULL, NULL, &StartupInfo, &ProcessInformation);<br />
WaitForSingleObject( ProcessInformation.hProcess, INFINITE );<br />
<br />
}<br />
Now what is my problem is that here WaitForSingleObject( ) function is not working. and only a single reg file is created.
and when use Sleep(1000) then all the 10 reg file are created.
So please tell me that how should I overcome this problem.
Please reply
Thanks
|
|
|
|
|
|
Uninitialized STARTUPINFO structure is one of the problems of your code. It can be fixed like this:
STARTUPINFO StartupInfo = { sizeof(STARTUPINFO) };
|
|
|
|
|
In addition, it seems that the invoked regedit tools cannot work in multi-instance mode. For example, I cannot start more then one regedit application from Windows menu or command line. That's why only some of your calls work.
This probably means that you cannot do multi-threaded export using regedit tool.
|
|
|
|
|
CREATE_SUSPENDED
ResumeThread()
Kuphryn
|
|
|
|
|
iam calling the function from another class.in that function i have SetTimer(0,1000,NULL).
but it will no work.
ONTimer is not calling.
ram.
|
|
|
|
|
do you have an HANDLER ( ON_WM_TIMER ) for the timer ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
yah
void CMPEGPlayerDlg::OnPlay()
{
Onstop();
int k = m_list7.GetCurSel();
m_list7.GetText(k,m_SongName);
if(!m_SongName.IsEmpty())
{
OpenNew(m_SongName);
MessageBox(m_SongName);
}
if(m_Player.PlayerMode() == pmReady)
{
MessageBox("bye");
m_Player.Play();
}
SetTimer(0, 1000, NULL);
}
here it is working because it is in the same class
where as
void CMPEGPlayerDlg::OnPlay(CString string)
{
Onstop();
m_SongName=string;
if(!m_SongName.IsEmpty())
{
OpenNew(m_SongName);
MessageBox(m_SongName);
}
if(m_Player.PlayerMode() == pmReady)
{
MessageBox("hi");
m_Player.Play();
}
SetTimer(ID_TIMER, 1000,NULL);
}
herer not working because this fuction is calling from different class.
ram
|
|
|
|
|
How did you call settimer???
"Dream bigger...Do bigger...Expect smaller"
aji
|
|
|
|
|
thank u for ur reply,
what i cann't get u,
ram.
|
|
|
|
|
Perhaps it does not work because of first parameter, which is zero. According to documentation, it must be a non-zero identifier.
Try something like this:
SetTimer(1, 1000, NULL);
I hope it works.
|
|
|
|
|
|
How to declare WM_TIMER? and How to use settimer in another class
whitesky
|
|
|
|
|
i completed my project in release mode. But when i compiled it in debug i am unable to run because of assertion failures,and mfc errors etc.,
please tell me the solution
Regards
Venu g
venu
|
|
|
|