Problem With Resource

  • Thread starter Thread starter manoj
  • Start date Start date
M

manoj

Hi
I have a unicode program for win2k and win98 in vc7(dotnet). It contains
Dlls.Each Dll has string table resource,menu resource,dialog resource etc.
It successfully run on win2k. When i run it in win98, only string resource
of any dll is loaded, menu and dialog are not loaded.
I use LoadMenuW(handle of dll module,menuname)
No problem for win2k
Please reply
Thanks in advance
 
I have a unicode program for win2k and win98 in vc7(dotnet). It contains
Dlls.Each Dll has string table resource,menu resource,dialog resource etc.
It successfully run on win2k. When i run it in win98, only string resource
of any dll is loaded, menu and dialog are not loaded.
I use LoadMenuW(handle of dll module,menuname)

Presumably you're using Unicows on Win9x?

What does GetLastError (or the ERR pseudo register in the debugger)
tell you about why LoadMenu failed?

Dave
 
GetLastError and FormatMessage says "operation completed successfully".
LoadMenuW returns 0 and DoModal returns -1.
 
GetLastError and FormatMessage says "operation completed successfully".
LoadMenuW returns 0 and DoModal returns -1.

And are you using the Unicows library under Win9x?

Can you reproduce this issue with a small sample project - a console
application that calls LoadMenu(W)?

Dave
 
Yes, I'm using unicows library under win98.
Under win98, program load toolbar and resource string of dll when i load
the specified dll. Only menu and dialog box are creating the problem. There
is no problem for win2k at all.
sample code is
HINSTANCE langDLL = NULL;

langDLL = LoadLibraryExW(_T("dllname.dll"),NULL,LOAD_LIBRARY_AS_DATAFILE);

if(langDLL)

AfxSetResourceHandle(langDLL);

Now for menu

HMENU menu;

menu=LoadMenuW(langDLL,(LPCTSTR)IDR_MENU1);

::SetMenu(m_hWnd,menu);

For dialog

dlg.DoModal();

where dlg is object of dialog(IDD_DIALOG1) class.
 
Under win98, program load toolbar and resource string of dll when i load
the specified dll. Only menu and dialog box are creating the problem. There
is no problem for win2k at all.
sample code is
HMENU menu;
menu=LoadMenuW(langDLL,(LPCTSTR)IDR_MENU1);
dlg.DoModal();
where dlg is object of dialog(IDD_DIALOG1) class.

I don't know if this is the issue, but what are the numeric values of
IDR_MENU1 and IDD_DIALOG1 ?

Win9x has problems with resource ID values > 32K.

If this isn't the issue I'm not aware of any problems in this area. I
suggest that you try re-posting your question with as much detail as
possible in the microsoft.public.platformsdk.mslayerforunicode
newsgroup.

Dave
 
Thanks, If Win98 has problems with resource ID values > 32K then how can i
solve it. For win98, LoadMenuW fail when loading menu of any dll. This not
case with menu of main exe. In this case LoadMenuW success.While all Dlls
and main exe have same menu id IDR_MENU1. I create IDR_MENU1 and put its
copy in all dll.and All dlls have different languages. No problem with
string and toolbar resources of any dll.
 
Thanks, If Win98 has problems with resource ID values > 32K then how can i
solve it.

Change the values to be less than 32K.

You've not said what the values actually are though - so what are they
in your DLL?

Dave
 
IDR_MENU1 is a menu resource which i added to project. and IDR_DIALOG1 is a
dialog box resource which i add.Then i copy these resources to Dlls.
I think this is the answer of your question. If not then please clear what
you want to ask?
and how to Change the values of these resources to be less than 32K?
Thanks
 
IDR_MENU1 is a menu resource which i added to project. and IDR_DIALOG1 is a
dialog box resource which i add.Then i copy these resources to Dlls.
I think this is the answer of your question. If not then please clear what
you want to ask?

Those are the symbolic definitions of the values, what are the
numerical values for these definitions (usually defined in the
resource.h file)?

Dave
 
Following are the numeric values

#define IDS_STRING129 129 // use this string to set title of
main window

#define IDS_STRING130 130 // use for displaying message box

#define IDD_DIALOG1 130 //value of dialog box which a added to
project

#define IDR_MENU1 131 //value of menu which a added to project

#define ID_FILE_DIALOG 32771 //File->Dialog menu, in IDR_MENU1

#define ID_LANGUAGE_ENGLISH 32772 //Language->English menu, in IDR_MENU1

#define ID_LANGUAGE_JAPANESE 32773 //Language->Japanese menu, in
IDR_MENU1

#ifdef APSTUDIO_INVOKED

#ifndef APSTUDIO_READONLY_SYMBOLS

#define _APS_NEXT_RESOURCE_VALUE 135

#define _APS_NEXT_COMMAND_VALUE 32774

#define _APS_NEXT_CONTROL_VALUE 1000

#define _APS_NEXT_SYMED_VALUE 101

#endif

#endif

My UFT-8(non unicode) program has same values as above but it loads its menu
and dialog in win98.

Thanks waiting for reply
 
My UFT-8(non unicode) program has same values as above but it loads its menu
and dialog in win98.

OK, so that's not the problem.

At this stage I can only suggest that you re-post your question in the
microsoft.public.platformsdk.mslayerforunicode newsgroup.

Dave
 
Back
Top