 |
|
 |
if i want to change this application to a .dll and i want to create a docking window by calling the newly created .dll from an .exe, how can i move with that.which class should i expose from the .dll.
modified 8 May '12.
|
|
|
|
 |
|
 |
We would like to use your code in a commercial product and would like your permission to do so. We request permission to make modifications to your code, make copies and create derivative works. We also request your permission to distribute to third parties, including US and Foreign governments.
Your reply is appreciated and thank you for creating useful software.
Kind regards.
|
|
|
|
 |
|
|
 |
|
 |
This is a great work. I'm impressed.
But I found a problem when I tried the example.
When you put two windows docked at the bottom in parallel and drag the left edge of the right window till the maximum size, the program hogs the CPU power and no response comes back .
Could you investigate on this?
Thanks in advance .
|
|
|
|
 |
|
 |
I am not able to compile example under VS 2005. I got:
c:\work\codeproject\dockable windows\t\sizebar\sizecbar.cpp(108) : error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall CSizingControlBar::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint)'
Cast from base to derived requires dynamic_cast or static_cast
c:\work\codeproject\dockable windows\t\sizebar\sizecbar.cpp(1298) : error C2065: 'afxChNil' : undeclared identifier
scbarg.cpp
c:\work\codeproject\dockable windows\t\sizebar\scbarg.cpp(57) : error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall CSizingControlBarG::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint)'
Cast from base to derived requires dynamic_cast or static_cast
scbarcf.cpp
pindockView.cpp
pindockDoc.cpp
PinDockBar.cpp
c:\work\codeproject\dockable windows\t\pindockbar.cpp(235) : error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall CPinDockBar::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint)'
Cast from base to derived requires dynamic_cast or static_cast
pindock.cpp
c:\work\codeproject\dockable windows\t\drawframe.cpp(52) : error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall CDrawFrame::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint)'
Cast from base to derived requires dynamic_cast or static_cast
Do you have an idea how to fix these bugs?
|
|
|
|
 |
|
 |
Hi!
For "error C2440: 'static_cast' : cannot convert from 'UINT ...", you must find that function and change UINT THAT_FUNCTION(...) to LRESULT THAT_FUNCTION(...).
For "error C2065: 'afxChNil' : undeclared identifier", find "afxChNil" and instead of it put NULL, it worked fine for me.
|
|
|
|
 |
|
 |
Very Good, the solution you provided make the project work well in vs2005
|
|
|
|
 |
|
 |
I have readed the article, it's very good!
But I don't how to deal with the control item's notify message. For example, I need to deal with double click the list-view and LBN_SELCHANGE message, what will I do. Please send your method to my E-mail: feifa168@163.com
Thanks!
feifa168@163.com
|
|
|
|
 |
|
 |
Hi,
I would try to implement thi two function, and I try to start from "CSizingControlBar::LoadState" and "CSizingControlBar::LoadState".
This function correctly saving and restore size of CPinDockBar when it is dock on left or right; but their don't work if bar is dock on top or bottmo or bar is floating. I don't understand the problem, someone can give me any suggestion?
Thanks in advantage!!
Ciao a tutti
Matteo
|
|
|
|
 |
|
 |
in MDI project, the pinnable control bar doesnt work correctly.When i hide controlBar, Repeatedly OnNcActivate message comes to DrawFrame.So i coulnd focus Controlbar again. How can i solve the problem?
|
|
|
|
 |
|
 |
If the problem is the focus, it is normal that you lost focus on bar when hide it; probably I don't understand your problem, can you explain much more please?
|
|
|
|
 |
|
 |
Hi,
Thanks for this great article.
will these class work well with Visual Studio 2003 ,because i am trying to using it i am facing problem .
please suggest me changes that need for Visual Studio 2003.
Thanks
|
|
|
|
 |
|
 |
Thank you for your excellent work.
How can I add tooltip on auto hide button?
|
|
|
|
 |
|
 |
I try to use this "dockable OutlookBar" in MDI , but there are some errors.
Can you tell me how to use this code in MDI?
Thank u!
Laronze
|
|
|
|
 |
|
 |
The code post in this article is neutral to SDI and MDI. I have not tried outlookbar sample. Maybe you can ask the author and give more detail error info.
|
|
|
|
 |
|
 |
I make a project with more CPinDockSize, and one of them contain the class COutlook2Ctrl; if your question refer to this configuration, i can certificate that this configuration of class run correctly. I simply follow the example code.
If you have some specific error, write it!
Hi.
|
|
|
|
 |
|
 |
If I press escape in the CEdit control, all pages in this control will disappear, why?
|
|
|
|
 |
|
|
 |
|
 |
Thank you for posting this example!
Very usefull!
I try to implement your example in a COM DLL dialog. Everything works fine except one error:
error C2248: 'm_pFloatingFrameClass' : cannot access protected member declared in class 'CFrameWnd'
How can I avoid this? I do not use the example you have posted it in a classic MFC DOC/VIEW application, but in a COM DLL add-in. Using COM functions interface I can get a pointer to CMDIFrameWnd main application. This is a brief of my "OnCreate()" function deal with the creation of this dockable dialog.
//in the class header
CMyBar* m_wndMyBar;
bool CMyCOMDialogApp::CreateUserDockDialog(CMDIFrameWnd* pFrame)
{
m_wndMyBar = new CMyBar();
if (!m_wndMyBar->Create(_T("My bar"), pFrame, 127))
{
TRACE0("Failed to create mybar\n");
return -1;
// fail to create
}
....
//IF I COMMENT THESE LINES OF CODE I CAN WORK WITH THE DOCKING CONTROL BUT IT IS NOT PINNABLE
//AND THE FRAME BECAME DOUBLLED
//IF THIS LINES ARE NOT COMMENTED I get
//error C2248: 'm_pFloatingFrameClass' : cannot access protected member declared
//in class 'CFrameWnd'
#ifdef _SCB_REPLACE_MINIFRAME
pFrame->m_pFloatingFrameClass = RUNTIME_CLASS(CSCBMiniDockFrameWnd);
// m_pFloatingFrameClass = RUNTIME_CLASS(CSCBMiniDockFrameWnd);
#endif //_SCB_REPLACE_MINIFRAME
}
Any ideea will be apreciate!
Ioan
Ioan
|
|
|
|
 |
|
 |
m_pFloatingFrameClass is declared as a protected member in CFrameWnd.
One way I can think of is adding a public member function in the CMainFrame class to solve this,
e,g,:
class UrMainFrameWnd : public CFrameWnd
{
...
public:
void SetFrameClass(CRuntimeClass* pRunTime)
{
m_pFloatingFrameClass = pRunTime;
}
...
|
|
|
|
 |
|
 |
Thank you Ziran for answering to my question!
Tha problem is that my aplication is a COM DLL, derivated from CWinApp. I do not use any "MFC frame
style" so there is no CMainFrame derived class in my dll aplication. All I can do is, using COM functions interface, to get a pointer to CMDIFrameWnd main application.
Any ideea?
|
|
|
|
 |
|
 |
Probably this "dirty" way is feasible:
1. Get the offset of m_pFloatingFrameClass in CMDIFrameWnd
You can get this by derivng a class from CMDIFrameWnd, and adding a member functiuon of calculating the offset of m_pFloatingFrameClass
2. Since you have the offset of m_pFloatingFrameClass
You can put code like:
*(CRuntimeClass*)((BYTE *)pFrame + offset) = RUNTIME_CLASS(CSCBMiniDockFrameWnd);
|
|
|
|
 |
|
 |
Thank you Ziran for your response!
Something I understand, but I'm a novice.. I do not know how to calculate the offset. Would you like to detail the point 1?
King regards!
Ioan
|
|
|
|
 |
|
 |
Something like following:
1. Create a class derived from CMainFrame:
class MyFrameWnd : public CMainFrame
{
public:
int Offset()
{
return (int) ((long)&(this->m_pFloatingFrameClass) - (long)this);
}
};
2. In your code, declare a dummyFrame variable
MyFrameWnd dummy;
int Offset = dummy.Offset();
CRuntimeClass ** p;
p= (CRuntimeClass **)(((BYTE *)pFrame) + offset);
*p = RUNTIME_CLASS(CSCBMiniDockFrameWnd);
3. Use it at your own risk!
|
|
|
|
 |
|
 |
Hi Ziran!
Everything seems to work fine! Now I got NO doubled frame and my dialog is dockable with double click on the title bar. I hope the your tricky offset to be safe I do not test it very well!
Now I have another problem: when I push the pin button (on the instant bar) I got no reaction - nothing happend. I insert some break point in the code, but it seems that the debbuger don't reach, not enter - in OnPushPinOn(..) member function. I check out all the declaration and their positions in the code, but I'm not sure that the press button message goes in coresponding function, probably becose it is a DLL COM. You have any ideea how I can achive this push button message in my case?
Important: the debugger reach CPinDockBar::OnNcLButtonUp(..)
Kind regards!
Ioan
-- modified at 4:33 Saturday 16th September, 2006
|
|
|
|
 |