|
According to the MSDN CWnd::OnParentNotify
A parent's OnParentNotify member function is called by the framework when its child window is created or destroyed, or when the user clicks a mouse button while the cursor is over the child window.
So I think It should work. if not so what should I do?
|
|
|
|
|
From the same link you have given...
[quote]
All child windows except those that have the WS_EX_NOPARENTNOTIFY style send this message to their parent windows. By default, child windows in a dialog box have the WS_EX_NOPARENTNOTIFY style unless the child window was created without this style by calling the CreateEx member function.
[/quote]
How do you create your child dialog?
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Thanks I think that should works
|
|
|
|
|
You are welcome
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Hai,
I am having a VC++ exe. i wat to create a setup file, I tried creating a setupfile by reading the msdn site.when i am running it, it is working in some machines, but not in other machines. will you please help me
|
|
|
|
|
Are you making the setup from your debug or your release version?
If you are making it from debug, it probably is the reason why in some machines does not work. They probably are machines where visual studio is not installed, and so your program is missing the needed libraries and dlls to be able to run the application.
What error do it appears in the machines where it is not working?
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
i Am making it from the debug version.It is showing the error Application Not configuredf properly.Try reinstalling it.
|
|
|
|
|
As I said, if you do the setup from the debug version and you try to run the application in a machine where no visual studio is installed... you may have problems. The debug versions sometimes need to have some DLLs and other files in the target computer to run correctly.
Take a look with the dependancy-walker about what your programm needs when it is running and add it to the setup packet.
Or do the setup with released version. If you do this, I strongly recommend to take a look into:
Surviving the Release Version[^]
Debugging Release Mode Problems[^]
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Are you including visual studio runtime library in your setup? The Target machine may not have these files
|
|
|
|
|
I want show some options as checkbox in menu.
this menu could be called by right clicking the dialog.
If user select some menu item according to that i will make some operation.
how could i add checkbox to submenu item
|
|
|
|
|
If you go through MENUITEMINFO structure (which is used in InsertMenuItem() function) you can find fMask member which supports MIIM_CHECKMARKS value.
|
|
|
|
|
CMenu::GetSubMenu[^] and CMenu::CheckMenuItem[^] might help you with that...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Hi...
Hi i am having a multiline text box.
Initially i have some data in edit box. Then if i add any data, the previous datas are gone. i want both previous and current data.
For example, I am Having "This is Test \r\n This is multiline text box".
if i add "This is second line", the editbox should show both data.
How to do...
Please help me.
I used,
CString str1 = "Some String";
GetDlgItemText(IDC_EDIT1, str);
str2 = str+str1;
SetDlgItemText(IDC_EDIT1, str2);
Please tell me is there any otherway....
G.Paulraj
|
|
|
|
|
You can try EM_REPLACESEL message.
CString cs;
GetDlgItemText(IDC_EDIT1, cs);
SendDlgItemMessage(IDC_EDIT1, EM_SETSEL, cs.GetLength(), cs.GetLength());
SendDlgItemMessage(IDC_EDIT1, EM_REPLACESEL, 0, (LPARAM)_T("Some String"));
modified on Wednesday, December 23, 2009 5:34 AM
|
|
|
|
|
Good suggestion.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Thank you!
|
|
|
|
|
OK you modified that post. While I thought the EM_REPLACESEL itself was a great idea, I wouldn't have liked the usage of GetDlgItem() call. But hey, different people, different ways. (why I don't like GetDlgItem() ? Because I'm a terrific fan of Dr. Joseph Newcomer, and his philosophies and I take 'em seriously).
Added: Look at my second answer to the OP.
“Follow your bliss.” – Joseph Campbell
modified on Wednesday, December 23, 2009 5:48 AM
|
|
|
|
|
Me too don't like to use GetDlgItem(). It is always better and clean to use binded members with DDX/DDV. I thought I would provide an answer which resembles the sample code segment in the post . Thanks for the comment.
|
|
|
|
|
Rejeesh.T.S wrote: Me too don't like to use GetDlgItem(). It is always better and clean to use binded members with DDX/DDV.
You do realize, of course, that DDX_ macros internally call GetDlgItem? Newcomer's screed on the subject overlooks that fact. It really comes down to personal preference in coding style; one way is no more evil than another. Personally I try to avoid MFC-specific API's where possible - it makes porting code between frameworks a little less painful.
L u n a t i c F r i n g e
|
|
|
|
|
Use a control type member variable for the edit control. Then do something like
m_Edit.GetWindowText(szTemp );
szTemp += _T("Whatever");
m_Edit.SetWindowText(szTemp);
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Hi,
You might want to try this (thanks to Rejeesh for his EM_REPLACESEL suggestion, which triggered this idea)
int len = m_Edit.GetWindowTextLength();
m_Edit.SetSel(len, len, 0);
m_Edit.ReplaceSel(szNewText);
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
This is the MFC way. Now the code looks cleaner
|
|
|
|
|
Sorry for deleyed reply...
Thanks for Both of you...
the problem has been solved...
G.Paulraj
|
|
|
|
|
After converting my project from VC6.0 to VS2008.Im getting continouly error.I dont have error in building the exe.
When im running this exe i got lot of errors.Mostly on System.AccessViolation,System.NullRefernceException like this.Now i get
An unhandled exception of type 'System.NullReferenceException' occurred in InstructorStation.exe
Additional information: Object reference not set to an instance of an object.
error in this fucntion.
void CMainFrame::UpdateOprs(CTrans *pData)
{
IsNewOpr = TRUE;
WriteDebug("UpdateOprs() - Begin");
.
.
}
THis function get called as follow
CTrans tData;
CMainFrame* tFrm = (CMainFrame*)AfxGetMainWnd();
for(i=0;i<LiveDataCount.Count;i++)
tData.m_sData.Insert(i,LiveArray[i]);
tFrm->UpdateOprs(&tData);
Whats the problem in converting?I thought converting project should be simple likethat.I don't know whether i did any wrong?
Pls guide me on this issue.
Anu
|
|
|
|
|
CMainFrame* tFrm,
what is the value of tFrm?
Did u check whether it is 0 or not?
Please check
if( 0 != frm )
Величие не Бога может быть недооценена.
|
|
|
|