I need advice with resource files..

Started by
-1 comments, last by habus 23 years, 11 months ago
Hi! I''m having some headaches with resource files and I hope you can help me. Let me explain the problem: I want to include a midi file in my proyect, so I did a resource file: //heres the code: //Microsoft Developer Studio generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "afxres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // Spanish (Mexican) resources #if !defined(AFX_RESOURCE_DLL) // defined(AFX_TARG_ESM) #ifdef _WIN32 LANGUAGE LANG_SPANISH, SUBLANG_SPANISH_MEXICAN #pragma code_page(1252) #endif //_WIN32 #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE DISCARDABLE BEGIN "resource.h\0" END 2 TEXTINCLUDE DISCARDABLE BEGIN "#include ""afxres.h""\r\n" "\0" END 3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" END #endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // MIDI // IDR_MIDI1 MIDI DISCARDABLE "loopfury.mid" #endif // Spanish (Mexican) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED and the resource.h file created is: //{{NO_DEPENDENCIES}} // Microsoft Developer Studio generated include file. // Used by firstdraw.rc // #define IDR_MIDI1 102 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 105 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1000 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif So far my proyect compiles and gets the exe done.. the uh ohs are when I run my exe because this function fails: HRSRC hFound = FindResource(NULL, MAKEINTRESOURCE(IDR_MIDI1), TEXT("MIDI")); Someone has an idea why is all this happening? Any help would be appreciated. Thanks in advance and sorry for the long post.
"Old programmers don't die,they just terminate and stay resident."

This topic is closed to new replies.

Advertisement