By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,923 Members | 1,162 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,923 IT Pros & Developers. It's quick & easy.

Loading resources problem

P: n/a
Hello,

I have two resource files( text files). I've added them like custrom
resourses.
Then I want to load the first file:

HMODULE plugin = GetModuleHandle( MY_MODULE );
TCHAR sRestype[13] = _T("GridFormulas");
HRSRC resHndl = FindResource( plugin,
MAKEINTRESOURCE(IDR_GRIDFORMULAS1), sRestype );
HGLOBAL hGlbl = LoadResource( plugin, resHndl );
char* res =( char* ) LockResource( hGlbl );

But res consists from the first's file data *AND* the second's files
data, plus several strange characters.

I've tried to make these two resources of different types, but it
didn't help.

May be the problem is that I'm now using VS2005, because in 2003 it
worked fine.

Please help.
Thanks.

Dec 27 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a

Lu***@bk.ru wrote:
Hello,

I have two resource files( text files). I've added them like custrom
resourses.
Then I want to load the first file:

HMODULE plugin = GetModuleHandle( MY_MODULE );
TCHAR sRestype[13] = _T("GridFormulas");
HRSRC resHndl = FindResource( plugin,
MAKEINTRESOURCE(IDR_GRIDFORMULAS1), sRestype );
HGLOBAL hGlbl = LoadResource( plugin, resHndl );
char* res =( char* ) LockResource( hGlbl );

But res consists from the first's file data *AND* the second's files
data, plus several strange characters.

I've tried to make these two resources of different types, but it
didn't help.

May be the problem is that I'm now using VS2005, because in 2003 it
worked fine.

Please help.
Thanks.
The above is not C++ in any shape or form.
Consult:
[5.9] Which newsgroup should I post my questions?
http://www.parashift.com/c++-faq-lite/how-to-post.html

Dec 27 '06 #2

P: n/a
"Salt_Peter" <pj*****@yahoo.comwrote in message
news:11*********************@48g2000cwx.googlegrou ps.com...
>
Lu***@bk.ru wrote:
>Hello,

I have two resource files( text files). I've added them like custrom
resourses.
Then I want to load the first file:

HMODULE plugin = GetModuleHandle( MY_MODULE );
TCHAR sRestype[13] = _T("GridFormulas");
HRSRC resHndl = FindResource( plugin,
MAKEINTRESOURCE(IDR_GRIDFORMULAS1), sRestype );
HGLOBAL hGlbl = LoadResource( plugin, resHndl );
char* res =( char* ) LockResource( hGlbl );

But res consists from the first's file data *AND* the second's files
data, plus several strange characters.

I've tried to make these two resources of different types, but it
didn't help.

May be the problem is that I'm now using VS2005, because in 2003 it
worked fine.

Please help.
Thanks.

The above is not C++ in any shape or form.
Not true, it is C++, using the C subset, but the function calls and
variables are not part of the standard, so the OP needs to ask in an
appropriate newsgroup.
Consult:
[5.9] Which newsgroup should I post my questions?
http://www.parashift.com/c++-faq-lite/how-to-post.html

Dec 28 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.