|
I already wrote some code, but unfortunately the MainFrame looks very weird and has some GUI-bugs
What are these GUI-bugs?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
You shouldn't call CFrameWnd::OnCreateClient in CMainFrame::OnCreateClient. Just return TRUE. CFrameWnd::OnCreateClient creates additional view using pContext. Your application has 3 (not 2) views and this is where problems begin.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I have a list box that I am using to display a status log. When the visible list box fills up, I would like the list box to scroll down with each new entry. How can I accomplish this?
- John
|
|
|
|
|
I use this
CListBox::SetTopIndex()
Cheers!!!!
Carlos Antollini.
|
|
|
|
|
Hi
I'm just writing an SDI-application with Splitter-Windows.
I have created the splitter-windows in the function BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
Now I need to set the Row-and col-information in the OnSize-function.
But there the application crashes:
void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
CFrameWnd::OnSize(nType, cx, cy);
CRect cr;
if ( m_initSplitters && nType != SIZE_MINIMIZED )
{
m_mainSplitter.SetRowInfo( 0, cy, 0 );
m_mainSplitter.SetRowInfo( 1, cy, 0 );
m_mainSplitter.SetColumnInfo( 0, cx, 0 );
m_mainSplitter.SetColumnInfo( 1, cr.Height() - 150, 0 );
m_mainSplitter.RecalcLayout();
}
}
it crashes in file winsplit.cpp at this point:
void CSplitterWnd::SetRowInfo(int row, int cyIdeal, int cyMin)
{
ASSERT_VALID(this);
ASSERT(row >= 0 && row < m_nMaxRows);
ASSERT(cyIdeal >= 0);
ASSERT(cyMin >= 0);
->>>>>> m_pRowInfo[row].nIdealSize = cyIdeal; <------- here's the crash
m_pRowInfo[row].nMinSize = cyMin;
}
can someone explain me what's going on here?
thanks in advance
|
|
|
|
|
Hi,
check the splitter window handle value before change the size of splitter window,
you can try the following way
void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
CFrameWnd::OnSize(nType, cx, cy);
//i added only the following condition
if ( m_initSplitter.m_hWnd != NULL )
{
CRect cr;
if ( m_initSplitters && nType != SIZE_MINIMIZED )
{
m_mainSplitter.SetRowInfo( 0, cy, 0 );
m_mainSplitter.SetRowInfo( 1, cy, 0 );
m_mainSplitter.SetColumnInfo( 0, cx, 0 );
m_mainSplitter.SetColumnInfo( 1, cr.Height() - 150, 0 );
m_mainSplitter.RecalcLayout();
}
}
}
bye,
J.Mahesh
|
|
|
|
|
Hi,
check the splitter window handle value before change the size of splitter window,
you can try the following way
void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
CFrameWnd::OnSize(nType, cx, cy);
//i added only the following condition
if ( m_initSplitter.m_hWnd != NULL )
{
CRect cr;
if ( m_initSplitters && nType != SIZE_MINIMIZED )
{
m_mainSplitter.SetRowInfo( 0, cy, 0 );
m_mainSplitter.SetRowInfo( 1, cy, 0 );
m_mainSplitter.SetColumnInfo( 0, cx, 0 );
m_mainSplitter.SetColumnInfo( 1, cr.Height() - 150, 0 );
m_mainSplitter.RecalcLayout();
}
}
}
bye,
J.Mahesh
|
|
|
|
|
Thanks!
I just forgot to tell the app that all windows have been created sucsessfully (i.e. I forgot to set the variable m_initSplitters to TRUE)
works well, but I still have problems with the app (view thread above "CSplitterWnd")
|
|
|
|
|
How can I intercept the 'Enter' key before it reach a button.
I tried WM_CHAR in the PreTranslate function, but this works only for alphanumerics and not the 'Enter' key.
Thank You
LP
|
|
|
|
|
Try the IDOK message.. you are using a dialog, aren't you?
You could also try the WM_KEYDOWN message.
|
|
|
|
|
Subject How to send message WM_RBUTTONDOWN?
Category Beginner
Posted by tag on 8/7/01 at 11:06 am
Rating not rated
I want to send the WM_RBUTTONDOWN from a console program to a MFC application window. I did it like this:
::SendMessage(destHwnd, WM_RBUTTONDOWN, 0, MAKELPARAM(point.x,point.y))
But, the MFC application window can't get the msg at all. What's wrong?
PostMessage desn't work also.
Thank you,
tag
|
|
|
|
|
The obvious problem could be a wrong handle.
Use Spy++ and debugger to see if your handle is ok.
LP
|
|
|
|
|
Have you used FindWindow to get the proper destHwnd?
|
|
|
|
|
I have defined inside the DLL a common global variable to store the time (time_t). Well, inside the hook CBTProc i read always a value of 0 from the variable and out of the DLL i can read it correctly (with a function that return it).
What's wrong?
Please help me and thanks in advance.
|
|
|
|
|
Probably you forgot to place global variable into a shared data section. BTW: how are you accessing this variable 'outside the DLL'?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I'm new to MFC programming but I'm slowly learning!
I'm writing a program that minimizes to the systray, I can minimize from the menubar but not from the minimize button in the upper right corner!
What message is sent when that button is pushed and where am I supposed to catch it?
Eyses
|
|
|
|
|
Use CMainFrame::OnSize
if (nType == SIZE_MINIMIZED)
//Handle the minimized window
else
//don't do anything.
Good luck,
Frank
|
|
|
|
|
I'm working on a project in BC++B5 and up until now when compiled the output application is named wb.exe. I want to change what the executable name is when compiled. Any ideas?
Aaron
|
|
|
|
|
If C++ Builder 5.0 is the same as 1.0 which I used. The Project Name is the name of the executable.
if your project is myprj.mak
the executable name is myprj.exe
|
|
|
|
|
They no longer use *.mak, it is now *.bpr for your project. Good idea, but I've tried that already and it doesn't work.
Thanks,
Aaron
|
|
|
|
|
Try renaming the project using "Save Project As..." (from the File Menu if this has not changed since C++ Builder 4.0).
Philippe Mori
|
|
|
|
|
That worked, I knew it was something stupid... Thanks a lot.
Aaron
|
|
|
|
|
I'm not a big Borland user so let me understand. You can't change the name of the generated exe or dll without changing the entire project name?
|
|
|
|
|
I Send the WM_QUIT message in order to kill the internet explorer window and it doesnt work.
How do I do it?
Thanks in advance
|
|
|
|
|