July 22nd, 2003, 12:15 AM
I'm compiling a MFC application and I need to use the MAKEINTRESOURCE macro to pass the appropriate variable to the CreateDialog function to open a dialog. I keep getting the following error messages,
C:\Documents and Settings\summer\Desktop\Process Speech\Process SpeechDlg.cpp(932) : error C2065: 'MAKEINTRESOURCEA' : undeclared identifier
C:\Documents and Settings\summer\Desktop\Process Speech\Process SpeechDlg.cpp(932) : error C2146: syntax error : missing ';' before identifier 'templateID'
C:\Documents and Settings\summer\Desktop\Process Speech\Process SpeechDlg.cpp(932) : error C2065: 'templateID' : undeclared identifier
Error executing cl.exe.
Creating browse info file...
Process Speech.exe - 3 error(s), 0 warning(s)
As you can see, it seem like it's caused by a spelling mistake in my code, yet I've double checked and triped checked, I've spelled MAKEINRESOURCE correctly without the A on the end.
I'm using Visual C++ 6.0 on a XP system. Any help to clear up this problem would be great.
July 22nd, 2003, 03:24 AM
Have you included windows.h ?
(as it will include winuser.h that contains the macro MAKEINTRESOURCE and its variants)
The essence of Christianity is told us in the Garden of Eden history. The fruit that was forbidden was on the Tree of Knowledge. The subtext is, All the suffering you have is because you wanted to find out what was going on. You could be in the Garden of Eden if you had just kept your f***ing mouth shut and hadn't asked any questions.
July 22nd, 2003, 01:59 PM
Where are you learning MFC? Because I have a 'basic' Win32 tutorial. And all of them are the same. So could you please tell me???
July 22nd, 2003, 03:45 PM
I found out what the problem was, I had used the macro incorrectly, I was trying to assign a value to a variable defined by the macro via the assignment operator but apprently it wasn't how it was supposed to be done. That area's working fine. Now I'm off to try to figure out the other problem.
I have a dialog that I wish to create in another dialog window. So I call CreateDialog but it doesn't work, apparently the GetSafeHwnd function used to supply the hwnd of the parent window is returning NULL which according to the documentation indicates that CWnd isn't attached to the parent dialog. I have no idea what that means. I've only been using MFC for a short time.
I'm learning MFC largely by trial and error and using the advise of another person who's well versed in MFC programming.