Guys thaks for your input.
Here is what I’m doing.
- in VS I’m adding add reosurce->import and importing file.
- in rcfile I’m changing all afxres.h to winres.h
- in sources file I’m adding rc file to SOURCES
- perform compilation and I see that app has grather size
- code for dump on disk looks like this:
HGLOBAL hResLoad; // handle to loaded resource
HRSRC hRes; // handle/ptr. to res. info. in hExe
hRes = FindResource(NULL, MAKEINTRESOURCE(IDR_RES1), L"RES");
if (hRes == NULL)
{
printf(“ERROR. %d”, GetLastError());
return 1;
}
hResLoad = LoadResource(NULL, hRes);
if (hResLoad == NULL)
{
printf(“ERROR”);
return 2;
}
//…
Running this code generates error 0x715
rc file looks like this:
// Microsoft Visual C++ generated resource script.
//
#include “resource.h”
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include “winres.h”
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Polish resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_PLK)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
#pragma code_page(1250)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
“resource.h\0”
END
2 TEXTINCLUDE
BEGIN
“#include ““winres.h””\r\n”
“\0”
END
3 TEXTINCLUDE
BEGIN
“\r\n”
“\0”
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// RES
//
IDR_RES1 RES “PATH_TO_RESOURCE”
#endif // Polish resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
What’s wrong?
Probably I should generate everything in differentway. - can you point me out how to do this?
Thanks!