#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    3
    Rep Power
    0

    About MAKEINTRESOURCE


    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,

    Compiling...
    Process SpeechDlg.cpp

    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.

    Alex
  2. #2
  3. No Profile Picture
    Offensive Member
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2002
    Location
    in the perfect world
    Posts
    622
    Rep Power
    27
    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.

    Frank Zappa
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Representin' Quebec
    Posts
    106
    Rep Power
    11
    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???
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    3
    Rep Power
    0
    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.

IMN logo majestic logo threadwatch logo seochat tools logo