|
CPallini wrote: and neither Alfonso the Wise...
Ok, from now on I will call you Alfonso. Do you agree with that Alfonso ?
|
|
|
|
|
All or nothing: Alfonso the Wise!
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
|
|
|
|
|
I am bit late to collect a vote , I am your friend alfonso , may be thats going on my arrogant assumptions.
|
|
|
|
|
Rajkumar R wrote: I am bit late to collect a vote
It's (almost ) never too late.
Rajkumar R wrote: I am your friend alfonso [Rose] , may be thats going on my arrogant assumptions.
Well, if you like to be my friend don't use my friendly name alfonso , use instead the fully-featured one: Alfonso the Wise.
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
|
|
|
|
|
I think "Pallini the wise" best match.
|
|
|
|
|
I am trying to use a CFrameWnd in my code and I keep getting an assertion error when I try to ShowWindow(SW_SHOW);
CWnd * tempWnd = new CWnd();
tempWnd->Attach(p_adsw_hwndAcad);
CFPLvlLyrWnd *mWnd = (CFPLvlLyrWnd*)(RUNTIME_CLASS(CFPLvlLyrWnd))->CreateObject();
RECT sizze = CFrameWnd::rectDefault;
DWORD dwStyle = WS_OVERLAPPEDWINDOW;
if (mWnd->Create(NULL, "Levels/Layers", dwStyle, sizze, tempWnd, MAKEINTRESOURCE(0) ))
{
mWnd->m_parentWHandle = p_adsw_hwndAcad;
tempWnd->BeginModalState();
mWnd->ShowWindow(SW_SHOW);
}
else
{
AfxMessageBox("LoadFrame failed!");
}
HWND tempHandle = tempWnd->Detach();
delete(tempWnd);
This will run in VS 6.0 but in VS 2005 I get an assertion error and the program crashes. What could be the problem?
Help me Obi-Wan Kenobi, you're my only hope!
|
|
|
|
|
LeonardLay wrote: ...I get an assertion error...
What line of what file is asserting?
"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
|
|
|
|
|
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 ...
|
|
|
|