Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » What to do with CExtLocalResourceHelper::g_bUseResourceHandle? Collapse All
Subject Author Date
Hans Bergmeister Jan 8, 2008 - 6:29 AM

Hello,

a while ago you announced the introduction of CExtLocalResourceHelper::g_bUseResourceHandle.

We just installed Version 2.82 here and were happy to find this feature implemented.

But how to use it? The member is declared as private and cannot be changed programmatically.


Best regards,
Juergen

Technical Support Jan 12, 2008 - 1:00 PM

We have made it public. Thank you.

Technical Support Jan 11, 2008 - 11:15 AM

The DLL based localization uses one simple detail of the Win32 resource loading algorithm: to load resources of an appropriate preferred language, you should not let it have any chances to load resources of the default Windows locale based language. The cursors are language independent in most cases. At least all Prof-UIS cursors are absolutely language independent and we are using CWinApp::LoadCursor() MFC’s API for loading them. The resource manager loads dialog templates, strings, bitmaps and custom type resources. But it does not create HCURSOR handles from cursor binary data in resources. That is why we still keep the CExtLocalResourceHelper class. We hope it will not be needed at all in future.


Hans Bergmeister Jan 11, 2008 - 1:24 PM

Be that as it may, it would be helpful, if you could make g_bUseResourceHandle a public member. In the current form this addition is useless.

Technical Support Jan 10, 2008 - 12:32 PM

We confirm the declaration of the CExtLocalResourceHelper class should start with

class __PROF_UIS_API CExtLocalResourceHelper
{
protected:
      HINSTANCE m_hInstPrevResource;
      bool m_bFree:1;
public:
      static bool g_bUseResourceHandle;
protected:
      
      void Init(
            HINSTANCE hInstResourceModule
            )
. . .
But we don’t recommend you use this class at all because it can be removed in future versions. Prof-UIS loads all the resources through CExtResourceManager (a global g_ResourceManager smart pointer variable) which allows you to implement localized resources in your application without any DLLs. The resource manager contains resource loading algorithms written from scratch which can access resources of any preferred language.

Please provide us with more details about your task.

Hans Bergmeister Jan 11, 2008 - 2:55 AM

Hello,

>>
Prof-UIS loads all the resources through CExtResourceManager (a global g_ResourceManager smart pointer variable) which allows you to implement localized resources in your application without any DLLs.
<<
But exactly THIS is the problem. We have several applications with language dependent resources stored in separate DLLs. We can’t and we don’t want to change this. We simply want to load EACH resource by AfxGetResourceHandle(), regardless, which language the resource has. Prof-UIS does not very well support porting of such applications to Prof-UIS. Anyway, we managed to find a workaround by calling

g_ResourceManager->RscInst_Insert(new CExtResourceManager::RscInstEntry(AfxGetResourceHandle(), FALSE));

This works fine for almost all ProfUIS classes we used so far, with one exception: the CExtReportGridWnd throws assertions when loading certain resources (among others here:

    m_hCursorResizingH =
        pApp->LoadCursor( MAKEINTRESOURCE( IDC_EXT_RESIZE_H1 ) );

).

>>
But we don’t recommend you use this class at all because it can be removed in future versions.
<<
We actually DON’T WANT to use this class. In deed the assertions thrown by Prof-UIS forced us to bother with this class. In version 2.70 of Prof-UIS we "patched the class away" by simply adding

#define CExtLocalResourceHelper CWnd

to the header file. This worked fine.

Thus the sooner you remove that stuff the better. At least for us this class only causes trouble for us but no benefit at all!