|
|
elissa1001 wrote: well i solved it but the output is always wrong...
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I've been trying for about a month and a half to integrate direct3d into a mfc dialog box
the best i've found is direct3d integration into a mfc single document project...
can anyone please pretty please tell me how the hell can i integrate direct3d into a dialog box
many thanks in advance
Nuno
PS: i'm kind of desperate
|
|
|
|
|
|
Thats cool
Thanks...
But i can't aply it...
I get assertions errors...
here's the code i'm using
http://www.directxtutorial.com/Tutorial9/B-Direct3DBasics/dx9B5.aspx#still
i just took away the winmain and the mainproc
anyway, does any anyone has some code about it? ( direct3d on MFC dialog based )
i'll be way happy if it just shows a d3d render ... i can get my way around it just with that
Thanks
Nuno
|
|
|
|
|
You will have to show us the way you have set up your code, and then what errors you get too. Just a quick question, are you linking the appropriate .libs?
Also, is this the first DX stuff you have done or have you done similar things before? Have you tried simply compiling the example source to be sure it works?
|
|
|
|
|
Hi,
I want to display a Modaless Dialog box instead of Modal dialog box in mfc application.So,I called Create function instead of DoModal() inside the InitInstance() but I am getting Debug Assertion Failed error.
CDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.Create(IDD_DIALOG1);
if(nResponse)
dlg.ShowWindow(SW_SHOW);
else
MessageBox(NULL,_T("Error"),_T("Error"),MB_OK);
I dont know where made the mistake???
Siddharth
|
|
|
|
|
While creating dialog box pass the second parameter as NULL. After successful creation of dialog you have to assign the address of the dialog to the m_pMainWnd.
int nResponse = dlg.Create(IDD_DIALOG1, NULL);
if(nResponse)
{
m_pMainWnd = &dlg;
m_pMainWnd->ShowWindow(SW_SHOW);
}
else
{}
I think this will solve your problem.
|
|
|
|
|
Thank you,
I have to globally define the dlg instance,
CMfc_Modaless_vc6Dlg dlg;
CWnd* m_pMainWnd = &dlg;
while I do this after the application instance creation it is giving the same Debug Assertion Failed problem.I cannot declare the Dlg locally,so what i can do for this?
Siddharth
|
|
|
|
|
siddharthsan wrote: I have to globally define the dlg instance,
You should not have to do this.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
tvrsrao wrote: After successful creation of dialog you have to assign the address of the dialog to the m_pMainWnd.
Why would you say this?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
siddharthsan wrote: ...I am getting Debug Assertion Failed error.
What line of what file is asserting?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thank you,
I am getting Debug Assertion in afxwin1.ini file.
I told that we have to create dlg instance globally because,when i create it inside the initinstance then dialog will be disappeared when the it is out of the scope,so I wanted it as a global one.
|
|
|
|
|
siddharthsan wrote: I am getting Debug Assertion in afxwin1.ini file.
The file is over 1100 lines long. Which one?
siddharthsan wrote: I told that we have to create dlg instance globally because,when i create it inside the initinstance then dialog will be disappeared when the it is out of the scope,so I wanted it as a global one.
Make it a member of your CWinApp -derived class instead.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
So are you directly or indirectly calling AfxGetResourceHandle() ?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
No, I am not calling that function directly.
But global declaration where I am doing Is it correct?
After the App instance creation,I am creating Dlg instance.
|
|
|
|
|
siddharthsan wrote: No, I am not calling that function directly.
I also asked about an indirect call. When the assertion fires, check the call stack.
siddharthsan wrote: But global declaration where I am doing Is it correct?
Not in my opinion. Until you actually solve the problem, you'll not know for sure if it's correct or not.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
In my project i want to disable and enable Main Menu at run time using mfc .
I had try to run the following code, but don't send error occurred
CMenu* mmenu = GetMenu();
CMenu* submenu = mmenu->GetSubMenu(0);
submenu->EnableMenuItem(ID_FILE_NEW,MF_DISABLED | MF_GRAYED);
Please help me How to Disable/Enable Main Menu using View class
|
|
|
|
|
I don't think we can work on Menus using View object. try to get the MainWindow handle and use that handle for obtaining menus.
CWnd* wnd=AfxGetMainWnd();
CMenu* mmenu = wnd->GetMenu();
CMenu* submenu = mmenu->GetSubMenu(0);
submenu->EnableMenuItem(ID_FILE_NEW,MF_DISABLED | MF_GRAYED);
Try this and i hope this will work fine.
|
|
|
|
|
Hi
I had work with following code in view class, but Debug assertion failed had occured.
code:
CWnd* wnd=AfxGetMainWnd();
CMenu* mmenu = wnd->GetMenu();
CMenu* submenu = mmenu->GetSubMenu(0);
submenu->EnableMenuItem(ID_FILE_NEW,MF_DISABLED | MF_GRAYED);
|
|
|
|
|
mohindar_kks wrote: ...but Debug assertion failed had occured.
What line of what file is asserting?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi
I had solved Debug assertion failed problem.
Problem : Not disable menu with gray color from the following code
code:
CWnd* wnd=AfxGetMainWnd();
CMenu* mmenu = wnd->GetMenu();
CMenu* submenu = mmenu->GetSubMenu(0);
submenu->EnableMenuItem(ID_FILE_NEW,MF_DISABLED | MF_GRAYED);
|
|
|
|
|
I have to use Web Page in VC++.Can anyone suggests me something
S.Yamini
|
|
|
|
|
You can use Web Browser Control-CWebBrowser2 / CHtmlView
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|