Originally posted by: Michael Wolfgang
I tried this nice method with many different Views, all but CScrollView worked fine.
When I tried it with a CScrollView as "Debug-Version" (instead of "Release-Version") it crashed at
pView->MoveWindow (rectWindow).
Can anyone suggest WHY?
Reply
Originally posted by: Sibilant
In Debug & Release mode I get a debug assertion error in occsite.cpp line 1204 & 1205. Then I get, "The instruction at "0x5f5110a7" referenced memory at 0x00000000". The memory could not be read."
I've narrowed it down to this line and it runs if I comment this line out. //pView->Navigate(strPath);
I'm running XP & VC6.
Any suggestions would be greatly appreciated.
Originally posted by: Sheldon Lehnert
I want to know how to make a tabbed dialog or
CPropertySheet from the document view
Originally posted by: -Mu-
In the example given in the web page, make the following modifications:
1. In CVwindlgDlg class there is a member called MyView, change that from CView to CHtmlView * (ptr).
2. In InitInstance of the dialog replace the following code:
// TODO: Add extra initialization here
// ==> replace the following code:
CCreateContext pContext;
CWnd* pFrameWnd = this;
pContext.m_pCurrentDoc = new CMyDocument;
pContext.m_pNewViewClass = RUNTIME_CLASS(CMyVw);
MyView =(CMyVw *) ((CFrameWnd*)pFrameWnd)->CreateView(&pContext);/* changed from pView to MyView*/
ASSERT(CMyVW*);/* changed from pView to MyView*/
MyView->ShowWindow(SW_NORMAL);/* changed from pView to MyView*/
CRect rectWindow;
GetClientRect(rectWindow);
MyView->MoveWindow(rectWindow);/* changed from pView to MyView*/
char strPath[255];
::GetCurrentDirectory(255,(LPSTR)(LPCSTR)strPath);
strcat(strPath,"\\defaultpage.html");
MyView->Navigate(strPath);/* changed from pView to MyView*/
return TRUE; // return TRUE unless you set the focus to a control
3. Now MyView will be your pointer to the view created.
in your button handler say, CVwindlgDlg::OnButton1()
place the follwing code:
MyView->Navigate2("http://www.codeguru.com";);
Originally posted by: J�rg
Hello,
your view is pretty good but how can I open an URL later on e.g. if I click on a button?
thanks for help
J�rg
Originally posted by: A Friend
The problem with this approach is that you're outright lying to C++ by, effectively, casting your CDialog-derived class across into a CFrameWnd. Since your class isn't actually a CFrameWnd at all, all hell is liable to break loose if the view you add tries to use any frame window functionality, as many views will. It's a neat trick, but also a recipe for hard-to-find bugs and "random" errors.
ReplyOriginally posted by: hkf
So Good!
Reply
Originally posted by: yahia
it is really a good work to make a view in the dialoge but how i can open a URLin this view???
ReplyOriginally posted by: fany
how could i create a scrollview on a dialog?
ReplyOriginally posted by: stick
It's my needed.
Reply