|
when i use this, for my program, the status bar stop working. for example it don't detect the state of Num Lock and ... . how should i solve this problem?
|
|
|
|
|
I will try to use your work as an OLE Server for Adobe documents manipulation. I'll let you know how it went.
You can email me at hanacsb@paran.com
Thanks
|
|
|
|
|
I placed the CDFVCtrl in a dialog, so I could then put it in a docking bar.
But when I changed the size of the CDFVCtrl, the View stayed the same size. The solution is to add
void OnSize(UINT nType, int cx, int cy);
to the header, and
BEGIN_MESSAGE_MAP(CDFVCtrl, CWnd)
ON_WM_SIZE ()
END_MESSAGE_MAP()
void CDFVCtrl::OnSize (UINT nType, int cx, int cy)
{
CWnd::OnSize (nType, cx, cy);
if (m_pDocTemplate && m_pDocTemplate->m_pFrame)
m_pDocTemplate->m_pFrame->SetWindowPos (NULL, 0,0, cx, cy, SWP_NOMOVE | SWP_NOZORDER);
}
to the CPP file.
Thanks for your work, it saved me a lot of effort yesterday!
Iain.
|
|
|
|
|
Please tell me about Compare two files similar total commander?
Thanks
HL
|
|
|
|
|
I created a database in Access, and I use odbc consumer class to reach it. I need to display the data in tabcontrol. In MFC the one of the easyest way to operate with database to use CRecordSet, and CRecordView class. I created a document template(MyDoc, MyRecordView, MyFrame) and with this tutorial quite easy to insert it in a;P tabcontrol. THx
Greg
|
|
|
|
|
how to access and modify each view in a dialog?
|
|
|
|
|
|
|
|
Detected memory leaks!
Dumping objects ->
oleinit.cpp(85) : {157} client block at 0x00379268, subtype c0, 68 bytes long.
a CCmdTarget object at $00379268, 68 bytes long
e:\work\uitest\dfv_demo\sample\dfvctrl.cpp(57) : {146} client block at 0x00378948, subtype c0, 140 bytes long.
a CObject object at $00378948, 140 bytes long
{113} normal block at 0x00376D60, 65 bytes long.
Data: < 2|0 0 > D8 9C 32 7C 30 00 00 00 30 00 00 00 01 00 00 00
e:\work\uitest\dfv_demo\sample\dfvctrl.cpp(57) : {112} client block at 0x00377A40, subtype c0, 140 bytes long.
a CDFVDocTemplate object at $00377A40, 140 bytes long
{77} normal block at 0x003769F0, 65 bytes long.
Data: < 2|0 0 > D8 9C 32 7C 30 00 00 00 30 00 00 00 01 00 00 00
e:\work\uitest\dfv_demo\sample\dfvctrl.cpp(57) : {76} client block at 0x00376928, subtype c0, 140 bytes long.
a CDFVDocTemplate object at $00376928, 140 bytes long
{61} normal block at 0x00374C28, 23 bytes long.
Data: < 2| > D8 9C 32 7C 06 00 00 00 06 00 00 00 01 00 00 00
{60} normal block at 0x00374BC8, 33 bytes long.
Data: < 2| > D8 9C 32 7C 10 00 00 00 10 00 00 00 01 00 00 00
{59} normal block at 0x00374B78, 20 bytes long.
Data: < 2| 2| 2|> 04 00 00 00 EC 9C 32 7C EC 9C 32 7C EC 9C 32 7C
{58} normal block at 0x00374B18, 32 bytes long.
Data: <|0 | |K7 K7 > 7C 30 15 7C 04 00 00 00 7C 4B 37 00 D8 4B 37 00
Object dump complete.
|
|
|
|
|
Just put this into the destructor:
m_pDocTemplate->InternalRelease();<br />
m_pDocTemplate = NULL;<br />
Like this:
CDFVCtrl::~CDFVCtrl()<br />
{<br />
m_pDocTemplate->InternalRelease();<br />
m_pDocTemplate = NULL;<br />
}<br />
-------------------------------------------
Cogito, ergo sum.
(Ich denke, also bin ich.)
Nam quod in iuventus non discitur, in matura aetate nescitur.
(Was man in der Jugend nicht lernt, lernt man im Alter niemals.)
Nihil tam difficile est, quin quaerendo investigari possit.
(Nichts ist so schwierig, dass es nicht erforscht werden könnte.)
|
|
|
|
|
Has anyone had any luck getting the Print Preview working using the custom control?
|
|
|
|
|
Hello bbianco,
Yes, I have. Try inserting this code in the CSampleView class:
DoPrintPreview(AFX_IDD_PREVIEW_TOOLBAR, this, RUNTIME_CLASS(CPreviewView), new CPrintPreviewState());
Regards,
Mike
|
|
|
|
|
I have seen your nice article on a Doc View inside a dialog.
May I put forward a situation (not on your article but a different user interface) with a request to tell how to implement it (using MFC with Visual C++ 6).
Suppose you have created a new dialog based MFC application. Add a button, call it 'Start Doc View'. On clicking this button, a Doc View application should pop up (not as a 'child application'). I implemented something like this:
void C...Dlg::OnDocView( ) // click event for the button
{
ShellExecute(...); // Supply the name of Doc View EXE and path...
}
But this has a disadvantage that, if the dialog application is closed, the Doc View still remains on the screen. I don't want this disadvantage. What is desired is, if the dialog based app closes, the Doc View should also 'die'.
I tried to use Doc View as DLL (I saw one or two articles at Code Guru/Code Project). Built and copied the DLL (also .h and .lib files of Doc View) into the dialog-based project, but could not make much headway. Could also be my mistake.
I am also thinking of initiating a user interface thread (when the start Doc View button is clicked) and that thread, instead of showing its own window, calls ShellExecute(...) or calls the DLL for Doc View. Would it be correct?
Can you kindly provide a solution, probably by writing an article? If you think the idea it is worth an article and write it, a line by e-mail (rajeswarit@rediffmail.com) about your posting of article in a site and/or your views would be my fortune.
With many thanks,
Yours sincerely,
T. Rajeswari
-- modified at 6:02 Friday 31st March, 2006
|
|
|
|
|
Hello Jean-Louis,
I used your class in my dialog based project, in order to insert a report Editing functionality.
I found it very useful and easy to implement.
The following however caused a memory leak. You may have fixed it at your end:
The m_pDocTemplate was created by a call to 'new' but wasn't deleted properly, I do clean the memory in the destructor of the DFVCtrl class as per below.
CDFVCtrl::~CDFVCtrl()
{
delete m_pDocTemplate;
m_pDocTemplate = NULL;
m_pParent = NULL;
}
Thank you and Best Regards,
Marie
|
|
|
|
|
:(suppose i have application in MDI form,
i would like to show my own window when i click menu File>>MyDlg
on MyDlgFunction i write code like this to create document template:
void CAppHRIS::OnMyDlg()
{
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(IDR_PKL,
RUNTIME_CLASS(CDSPKL),
RUNTIME_CLASS(CFSPKL),
RUNTIME_CLASS(CVSPKL));
if(!pDocTemplate)
{
AfxMessageBox("gagal!");
return;
}
AddDocTemplate(pDocTemplate);
}
what should i do next to show frame that connected with doc and view in my MDI application ?
|
|
|
|
|
I am finding this article ,it is very good
hanlwang
|
|
|
|
|
hanlwang
|
|
|
|
|
The project will be a FormView containing several child frame windows.
|
|
|
|
|
Yes this is a good way to create the DocView in a Dialog, but has anyone figured out how to add anything to tthe newly created doc/view? As the one article below indicates. This is one solution to put doc-view application inside the dialog-based application.
However, I couldn't find any codes to commnuicate between the parent (dialog) and the child (doc-view app).
so if you know how I can communicate with this newly create doc/view I would be very greatful.
Thanks!
Charlie
|
|
|
|
|
Is it possible to implement an MDI version of this? Has anyone tried? If so, please offer your experience to the group.
Thanks! Dave
|
|
|
|
|
Hi Jean-Louis,
The framework seems to leak menu handles if you are creating and destroying the custom control dynamically.
To fix, in CMainFrame::PreCreateWindow , do the following:
<br />
m_hMenu = cs.hMenu;<br />
and in CMainFrame::~CMainFrame() , do the following:
<br />
::DestroyMenu(m_hMenu);<br />
You also need to add a new member to CMainFrame :
<br />
HMENU m_hMenu;<br />
HTH,
Jim.
|
|
|
|
|
i can not see menu when application is running. how to show the menu
|
|
|
|
|
Hi Jean-Louis,
You said:
Known Bugs:
some keys seems not working in the second CEditView (Return, Tab, ...). May be it is a bug inside CEditView regarding this application.
From the MSVC++ 6.0 docs:
"TAB and ENTER Keys for Multiple-Line Edit Controls in Dialog Boxes
When a multiple-line edit control is used in a dialog box, Windows assigns a default behavior for the ENTER and TAB keys. The ENTER key is used to perform the default function of the dialog box. Usually this is to accept any changes made in the dialog box and then dismiss the dialog box. When a user is editing text in a multiple-line edit control, it may be preferred to have the ENTER key advance to the next line of the edit control. By default, multiple-line edit controls accept CTRL+ENTER to advance to the next line.
Similarly, by default the TAB key moves the input focus to the next control in the tabbing sequence. However, it might be useful for the user to be able to enter TAB characters in an edit control. By default, multiple-line edit controls accept CTRL+TAB to enter TAB characters in an edit control.
The following sections describe four methods that can be used to implement alternative behavior for the ENTER and TAB keys. It should be noted that some users may object if the ENTER and TAB keys no longer act in the default fashion."
So, in BOOL CSampleView::PreCreateWindow(CREATESTRUCT& cs) , do the following:
cs.style |= ES_WANTRETURN;
This fixes ENTER. TAB still does not work, but you can use CTRL+TAB instead
HTH,
Jim.
|
|
|
|
|
Hi, I want to use your class in MDI, and I don't know how to create a new DFVCtrl.Please help me.
Thanks
max
|
|
|
|
|