<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: MFC Resource labels not set in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/mfc-resource-labels-not-set/m-p/328714#M42096</link>
    <description>Hi, Wolf,&lt;BR /&gt;
&lt;BR /&gt;
from my experiences with MFC under Arx :&lt;BR /&gt;
&lt;BR /&gt;
Because of some trouble with CTemporaryResourceOverride (similar to yours),&lt;BR /&gt;
I will never use it anymore - simply, there is no reason to use it, MFC&lt;BR /&gt;
provides simple &amp;amp; stable technique for !&lt;BR /&gt;
&lt;BR /&gt;
What I do (without any problems):&lt;BR /&gt;
&lt;BR /&gt;
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)&lt;BR /&gt;
{&lt;BR /&gt;
 // Remove this if you use lpReserved&lt;BR /&gt;
 UNREFERENCED_PARAMETER(lpReserved);&lt;BR /&gt;
 if (dwReason == DLL_PROCESS_ATTACH)&lt;BR /&gt;
 {&lt;BR /&gt;
        _hdllInstance = hInstance;&lt;BR /&gt;
 }&lt;BR /&gt;
 Like you, I will save my own resource handle - so far so good.&lt;BR /&gt;
&lt;BR /&gt;
Creating the dialog :&lt;BR /&gt;
&lt;BR /&gt;
HINSTANCE  oldInstance = :: AfxGetResourceHandle();  // buffer the currently&lt;BR /&gt;
active resource&lt;BR /&gt;
::AfxSetResourceHandle(_hdllInstance);&lt;BR /&gt;
DlgLogin  *pDlg = new DlgLogin();&lt;BR /&gt;
   :&lt;BR /&gt;
   :&lt;BR /&gt;
open the dialog with pDlg-&amp;gt;DoModal(); or pDlg-&amp;gt;Create(....); as needed&lt;BR /&gt;
  :&lt;BR /&gt;
  :&lt;BR /&gt;
::AfxSetResourceHandle(OldInstance);&lt;BR /&gt;
return;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
With this simple 'buffer &amp;amp; restore' technique, together with ONLY dynamic&lt;BR /&gt;
dialog creation, I have never experienced any resource problems - and I have&lt;BR /&gt;
really complex MFC/Arx programs running ...&lt;BR /&gt;
The advantage is, that your code can control resource usage, and the time of&lt;BR /&gt;
resource usage is clear.&lt;BR /&gt;
&lt;BR /&gt;
I hope this helps ....&lt;BR /&gt;
Torsten Moses</description>
    <pubDate>Fri, 01 Mar 2002 07:03:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2002-03-01T07:03:02Z</dc:date>
    <item>
      <title>MFC Resource labels not set</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/mfc-resource-labels-not-set/m-p/328713#M42095</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
another question about ARX &amp;amp; MFC:&lt;BR /&gt;
We use an ARX extension dll (dynamically linked), we reproduce exactly the&lt;BR /&gt;
MFC&lt;BR /&gt;
example, using TemporaryResourceOverride and module state managing.&lt;BR /&gt;
&lt;BR /&gt;
When executing the application, the labels of the button with IDOK, IDCANCEL&lt;BR /&gt;
and&lt;BR /&gt;
IDC_STATIC have some random text. All the rest is correctly shown. Since i&lt;BR /&gt;
rename,&lt;BR /&gt;
 i.e. IDOK resource to  IDOK_MYUNIQUEANDVERYSPECIALRESOURCE,&lt;BR /&gt;
all works fine. It looks to me like a resource handling problem, but i&lt;BR /&gt;
cannot figure out&lt;BR /&gt;
where it is:&lt;BR /&gt;
&lt;BR /&gt;
my main file:&lt;BR /&gt;
&lt;BR /&gt;
...&lt;BR /&gt;
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)&lt;BR /&gt;
{&lt;BR /&gt;
 // Remove this if you use lpReserved&lt;BR /&gt;
 UNREFERENCED_PARAMETER(lpReserved);&lt;BR /&gt;
&lt;BR /&gt;
 if (dwReason == DLL_PROCESS_ATTACH)&lt;BR /&gt;
 {&lt;BR /&gt;
        _hdllInstance = hInstance;&lt;BR /&gt;
        CTemporaryResourceOverride::SetDefaultResource(_hdllInstance);&lt;BR /&gt;
        ...&lt;BR /&gt;
&lt;BR /&gt;
and when creating dialog:&lt;BR /&gt;
&lt;BR /&gt;
...&lt;BR /&gt;
CTemporaryResourceOverride temp;&lt;BR /&gt;
DlgLogin dlg;&lt;BR /&gt;
...&lt;BR /&gt;
        theArxDLL.AttachInstance(hInstance);&lt;BR /&gt;
&lt;BR /&gt;
Thanx,&lt;BR /&gt;
Wolf.</description>
      <pubDate>Fri, 01 Mar 2002 06:28:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/mfc-resource-labels-not-set/m-p/328713#M42095</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-03-01T06:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: MFC Resource labels not set</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/mfc-resource-labels-not-set/m-p/328714#M42096</link>
      <description>Hi, Wolf,&lt;BR /&gt;
&lt;BR /&gt;
from my experiences with MFC under Arx :&lt;BR /&gt;
&lt;BR /&gt;
Because of some trouble with CTemporaryResourceOverride (similar to yours),&lt;BR /&gt;
I will never use it anymore - simply, there is no reason to use it, MFC&lt;BR /&gt;
provides simple &amp;amp; stable technique for !&lt;BR /&gt;
&lt;BR /&gt;
What I do (without any problems):&lt;BR /&gt;
&lt;BR /&gt;
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)&lt;BR /&gt;
{&lt;BR /&gt;
 // Remove this if you use lpReserved&lt;BR /&gt;
 UNREFERENCED_PARAMETER(lpReserved);&lt;BR /&gt;
 if (dwReason == DLL_PROCESS_ATTACH)&lt;BR /&gt;
 {&lt;BR /&gt;
        _hdllInstance = hInstance;&lt;BR /&gt;
 }&lt;BR /&gt;
 Like you, I will save my own resource handle - so far so good.&lt;BR /&gt;
&lt;BR /&gt;
Creating the dialog :&lt;BR /&gt;
&lt;BR /&gt;
HINSTANCE  oldInstance = :: AfxGetResourceHandle();  // buffer the currently&lt;BR /&gt;
active resource&lt;BR /&gt;
::AfxSetResourceHandle(_hdllInstance);&lt;BR /&gt;
DlgLogin  *pDlg = new DlgLogin();&lt;BR /&gt;
   :&lt;BR /&gt;
   :&lt;BR /&gt;
open the dialog with pDlg-&amp;gt;DoModal(); or pDlg-&amp;gt;Create(....); as needed&lt;BR /&gt;
  :&lt;BR /&gt;
  :&lt;BR /&gt;
::AfxSetResourceHandle(OldInstance);&lt;BR /&gt;
return;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
With this simple 'buffer &amp;amp; restore' technique, together with ONLY dynamic&lt;BR /&gt;
dialog creation, I have never experienced any resource problems - and I have&lt;BR /&gt;
really complex MFC/Arx programs running ...&lt;BR /&gt;
The advantage is, that your code can control resource usage, and the time of&lt;BR /&gt;
resource usage is clear.&lt;BR /&gt;
&lt;BR /&gt;
I hope this helps ....&lt;BR /&gt;
Torsten Moses</description>
      <pubDate>Fri, 01 Mar 2002 07:03:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/mfc-resource-labels-not-set/m-p/328714#M42096</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-03-01T07:03:02Z</dc:date>
    </item>
  </channel>
</rss>

