Posted By: djfeeler
create menu with resource.rc file ? - 09/06/14 05:10
Hello,
I program in lite c legacy mode and I would like to add a resource.rc file in my code to create a menu. How to get it to read the file?
Thanks in advance.
Posted By: FBL
Re: create menu with resource.rc file ? - 09/06/14 21:09
Winapi - include windows.h in your script.
With some adjustment the following should work in Lite-C.
HRSRC rc = FindResource(g_hInstance, MAKEINTRESOURCE(IDR_XML1), MAKEINTRESOURCE(XML));
HGLOBAL rcData = LoadResource(g_hInstance, rc);
DWORD size = SizeofResource(g_hInstance, rc);
const char* data = static_cast<const char*>(LockResource(rcData));
As a start:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms648042%28v=vs.85%29.aspx
Posted By: djfeeler
Re: create menu with resource.rc file ? - 09/07/14 07:16
Thanks for your response. I'll test it immediately.
I have test but I do not have the types HRSRC and HGLOBAL. I create them in windows.h?