|
The assertion error is in
File: f:\rtm\vctools\vc7libs\ship\atlmfc\src\mfc\winfrm.cpp
Line: 942
|
|
|
|
|
|
mWnd->ShowWindow(SW_SHOW);
When it gets to this point, the assertion error appears. I stepped into the code for ShowWindow and when it calls the AfxGetThread() it returns a NULL then it gives the assertion error because the return should not be NULL.
|
|
|
|
|
Show us the code that contains the ASSERT !
Steve
|
|
|
|
|
LRESULT CFrameWnd::OnActivateTopLevel(WPARAM wParam, LPARAM lParam)
{
CWnd::OnActivateTopLevel(wParam, lParam);
ExitHelpMode();
#ifndef _AFX_NO_OLE_SUPPORT
if (m_pNotifyHook != NULL)
{
m_pNotifyHook->OnActivate(
LOWORD(wParam) != WA_INACTIVE && !HIWORD(wParam));
}
#endif
CWinThread *pThread = AfxGetThread();
ASSERT(pThread);
if (pThread->m_pMainWnd == this)
{
CView* pActiveView = GetActiveView();
if (pActiveView == NULL)
pActiveView = GetActiveFrame()->GetActiveView();
if (pActiveView != NULL)
pActiveView->OnActivateView(FALSE, pActiveView, pActiveView);
}
|
|
|
|
|
Did you find a solution for your problem ?
Thank you.
|
|
|
|
|
Unfortunately I still haven't found a solution for this problem. I ended up just going back to using VS 6.0 to continue developing my software.
|
|
|
|
|
I have a problem with my embedded web browser control (IWebBrowser2 ).
I try to resize it when it's host (which is a child of the main frame) gets WM_SIZING while the main frame is resized. I was under the apparently naîve impression that I could do this by calling put_Width and put_Height on the web browser in WM_SIZING .
Making these calls actually triggers the DWebBrowserEvents2 events DISPID_WINDOWSETHEIGHT and DISPID_WINDOWSETWIDTH , but the size of the web browser control remains unchanged.
Any guesses as to why this happen?
--
Time you enjoy wasting is not wasted time - Bertrand Russel
|
|
|
|
|
Johann Gerell wrote: I try to resize it when it's host (which is a child of the main frame)
Is there some reason you are not using CHtmlView?
led mike
|
|
|
|
|
led mike wrote: Is there some reason you are not using CHtmlView?
Yes. If possible, I'm not letting MFC within a mile of my codebase. But please let's not discuss that now...
Anyway, I'm now bypassing IWebBrowser2::put_Width/Height by moving the actual OLE object window, roughly like this (error checks omitted):
ATL::CComPtr<IOleWindow> oleWindow;
iOleObject_->QueryInterface(&oleWindow);
HWND hwndBrowser = NULL;
oleWindow->GetWindow(&hwndBrowser);
::MoveWindow(hwndBrowser, 0, 0, cx, cy, TRUE); As an interesting addition, I noticed that IWebBrowser2::get_HWND gives NULL for the window, where I expected the same result as querying the IOleWindow interface.
--
Time you enjoy wasting is not wasted time - Bertrand Russel
|
|
|
|
|
Johann Gerell wrote: Yes. If possible, I'm not letting MFC within a mile of my codebase.
Ah, I see, you believe there is something wrong with MFC but you are fine with writing COM code. Did you read your own post?
Johann Gerell wrote: As an interesting addition, I noticed that IWebBrowser2::get_HWND gives NULL for the window, where I expected the same result as querying the IOleWindow interface.
Ok then, good luck.
led mike
|
|
|
|
|
led mike wrote: you believe there is something wrong with MFC
Yes.
led mike wrote: but you are fine with writing COM code
No. I'd avoid it if I could, but I'm not going to throw in MFC into my project just because I need HTML display functionality.
led mike wrote: Did you read your own post?
Yes. Multiple times. Since I'm not a native English speaker, I want to maximize the likelihood for anyone to understand what I mean. Why did you wonder that?
led mike wrote: Ok then, good luck.
Thanks.
--
Time you enjoy wasting is not wasted time - Bertrand Russel
|
|
|
|
|
I have an app with an icon on system tray. I want to hide the window (just
let the icon appear). I tried to use dlg->ShowWindow(SW_HIDE)instead of DoModal() but when the icon appears, it's useless (when we move the mouse to it, it disappears). Someone plz give me a solution, thanks
|
|
|
|
|
Can you set visible style on the property of window?
|
|
|
|
|
Do you mean setting the visible property to false ? I did so but there's no effect
|
|
|
|
|
No set to ture.
|
|
|
|
|
|
Thanks so much. It's really helpful ...
|
|
|
|
|
Hi,
I am in the maintainance of the application. In one of the function I have the following code
if (FALSE == IsWindowVisible(hCtrl))
return;
Because of that the control is not getting printed. Is there any API which sets the visibility state to WM_VISIBLE.
Regards
|
|
|
|
|
|
subramanyeswari wrote: Is there any API which sets the visibility state to WM_VISIBLE.
How about ShowWindow() ?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Or you can use of SendMessage with WM_VISIBLE .
|
|
|
|
|
subramanyeswari wrote: WM_VISIBLE
?
Probably you're looking for WS_VISIBLE . From MSDN [^]:
WS_VISIBLE
Creates a window that is initially visible.
This style can be turned on and off by using ShowWindow or SetWindowPos.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Hi all,
I am working on a project in which I am using MSFlexGrid.
It works in my system.
But when I install in other PC, the Flexgrid is not appeared.
What will be the problem??
Thanks in advance.
Regards,
Sunil Kumar
|
|
|
|
|
You need to copy and register the flexgrid activeX on the target PC.
|
|
|
|