|
Satishkumar.B wrote:
A crash is expected when you send a message to a window that doesnt handle it.
Huh? A crash should never be expected, especially if a window receives a message that it does not handle. If a window receives a message that it does not handle, DefWindowProc() or DefDlgProc() just sends it on.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Cool Ju wrote:
Dont define ur message as application message (WM_APP), make it WM_USER
Not recommended. While older books and tutorials used WM_USER , these symbols caused problems by conflicting with messages that Microsoft was using. Use WM_APP instead.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
m_fuad67 wrote:
how could i exchange data between the TreeView and Dialog(not FormView)??
I presume some method in the tree view class is in charge of displaying the dialog. Correct? If so, then you'll want something like:
void CMyTreeView::OnButtonClick()
{
CMyDialog dlg;
if (dlg.DoModal() == IDOK)
{
}
} Make sense?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Dear all
there is no true solution
no one can solve this problem?????? ohhhh nooooo
|
|
|
|
|
m_fuad67 wrote:
there is no true solution
no one can solve this problem...
I guess I'll have to go back and change all of my working code to longer work. I've done it so many times, it might take a while, but if you say there is no solution, well...
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hi
i tried it so many times and many ways with other applications
but the problem concentrated between left pane (TreeView) and the dialog (not FormView)
plz any one could help me
i'm at big trouble
MFC programmer
|
|
|
|
|
I thought the code snippet I provided was sufficient. As it is apparently not, please show the code you are using when the button is clicked to display the dialog box.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
show the code you are using when the button is clicked to display the dialog box
i have uploaded the project at me web page
http://www.websamba.com/mohammed_fuad[^]
i cant put it in this forum becuase it is big
thanx
MFC programmer
|
|
|
|
|
m_fuad67 wrote:
i cant put it in this forum becuase it is big
All I asked for was one function. How big can that be?
Why did you save the file as Roshal Archive (RAR) instead of something more common (e.g., ZIP), or uncompressed since it is just a text file?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
this is the solution
CMainFrame* pFrame = (CMainFrame*)AfxGetMainWnd();<br />
CMyView* pView = (CMyView*)pFrame->GetActiveView();
Thanx for evryone who tried to help me
MFC programmer
|
|
|
|
|
I have a serious problem. I hv a VC application which has a feature to write to a DVD, which we have implemented as a DLL which inturn uses another DLL(which has been bought).
from my aplication i open a dialog(which is part of the dll) which takes in the parameters required for burning.
Initialy i click on the build button of the dialog.It shows the progress bar,but as the progressbar is on if i cancel the dialog then the application crashes.
once the progress is completed and then i cancel then the appllication does not crash
if anybody can think for a solution on this then plz let me know
|
|
|
|
|
Well, you don't give us a lot of information to work with, but using common sense, the most logical place to look for your problem is in your OnCancel handler of the process dialog.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
One other guess is that you have a background thread running for the DVD processing. When you click cancel, you are leaving your dialog too soon - the background thread is still running, but you have deleted some data it requires. It tries to access the data and gets an access violation fault.
|
|
|
|
|
i m using CFileDialog object to open file dialog so user can select the files but i want to make disable the "delete" option if user right clicks on the selected file and tries to delete it.Also user cannot be able to delete the selected file by the key "delete" from key board.
thanks
ajmal
ajmalsiddiqui
|
|
|
|
|
|
I think that you'll have to subclass CFileDialog to handle these things.
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
hi
what a good reply thanks for this.
I m using CFileDialog class object but on domodal i want to restrict the user to modifify the files those are veiwed in filedialog.Actually i want that user can only veiw the files and can copy by mouse right click but not cut and del.
bye
ajmal
ajmalsiddiqui
|
|
|
|
|
This is a way:
ShellExecute(pMainFrm->m_hWnd,"open",
"mailto:@?body="+mailBody,NULL,NULL,SW_SHOW);
But the body has 2048 bytes limit;
and it can't have an attachement.
Is there another way to solve it?
Or break through the limit of 2048 bytes?
Opening the default mail client is necessary.
Thanks!!
|
|
|
|
|
|
Thanks for reply.
I tried:
mailto:joe@something.com?subject=Test&attachment="c:\boot.ini"
But it doesn't work.
thanks for reminding me,
I will create a *.eml file instead.
And this is a good idea:
ShellExecute(NULL,"open", "test.eml","","",SW_SHOWNORMAL);
Thanks a lot,
Peter
|
|
|
|
|
petehero wrote:
I tried:
mailto:joe@something.com?subject=Test&attachment="c:\boot.ini"
But it doesn't work.
So what does happen?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I tried:
mailto:joe@something.com?subject=Test&attachment="c:\boot.ini"
Then outlook express opens a new email window with subject "Test".
But there is no attachment.
I use win2k and OE6.
|
|
|
|
|
i wanted to know that while allocating memory to ptr for modeless dialog is it necessary to initialize the ptr to first NULL in the constructor of the class of the dialog or do i need to initilaize to NULL where i write code to dispaly the modeless dialog?(in my case in menu handler of another dialog)
thanks
|
|
|
|
|
Setting first to NULL is a matter of good style, nothing will ever detect that you did, or complain that you didn't ( which is sort of the point ). When you create it, it's too late, before you create it, you want it to be NULL so you can tell it has not been created. So, all pointers should be set to NULL in the constructer for members, and at the time they are declared for variables in functions. There would be no point in setting it to NULL jsut before it got given a valid value.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
thanks,can you suggest on something else.Actually i ahve a problem.I have created a dialog based application.I have inserted menu options voz dialog1,dialog2,dialog3,....dialog6 in the dialog .On clicking of these menu opions i am popping 6 different modeless dialog.here is sample code written for say menu item dialog1
midialog *d1;//midialog is class for dialog resource
d1=new midialog;
d1->Create(IDD_DIALOG1);
d1->ShowWindow(SW_SHOW);
d1 optionally is set to NULL in parent dialog constructor.
To close the dialog i either click on OK or Cancel or Red cross button and then i close the parent window.I have overriden OnCancel,OnOk functions and called DestroyWindow() in them. Also called PostNcDestroy function .Is this correct?
midialog::OnOk()
{
//Cdialog::OnOK();//commented out
UpdateData(TRUE);
Destroywindow(0;
}
midialog::Oncancel()
{
//CDialog::OnCancel();//commented out since it calls EndDialog and not DestroyWindow()
}
midialog::PostNcDestroy()
{
CDialog::PostNcDestroy();
delete this;
}
Is this ok?i also hope then there will be no problem when i close the modeless dialog and open it again
plz reply
i am in fix
|
|
|
|