-
July 20th, 2013, 01:26 AM
#1
How to locallize a plug-in DLL file?
I have experiences to localize a few MFC executable files, first create a resource dll file then add following code in InitInstance():
Code:
BOOL CMyApp::InitInstance()
{
//Default Application Wizard code.
HINSTANCE hRes = NULL;
hRes= LoadLibrary("ResourceD.dll");
if(hRes)
AfxSetResourceHandle(hRes);
//Rest of wizard code
return CWinApp::InitInstance();
}
Now I need to localize a dll file which is an IE web browser toolbar, who could tell me how localize the dll file? Thank you!
-
September 12th, 2013, 08:22 AM
#2
Re: How to locallize a plug-in DLL file?
I can create a resource dll for the plug-in dll, but I don't know how to import it into the plug-in dll.
Last edited by forester; September 12th, 2013 at 08:32 AM.
-
September 13th, 2013, 04:20 AM
#3
Re: How to locallize a plug-in DLL file?
Does the plug-in API not provide some sort of 'init' function?
Cheers, D Drmmr
Please put [code][/code] tags around your code to preserve indentation and make it more readable.
As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky
-
September 16th, 2013, 08:16 AM
#4
Re: How to locallize a plug-in DLL file?
Thank you for your reply, D_Drmmr.
There is no initializing function, but there is a OnCreate() function. Do you mean I can place AfxSetResourceHandle(hRes) in the Init function if there is one?
hRes is the handle for the resource dll.
Code:
BOOL CMyClass::OnCreate()
{
...
HINSTANCE hRes = NULL;
hRes= LoadLibrary("ResourceD.dll");
if(hRes)
AfxSetResourceHandle(hRes);
else
return false;
...
}
-
September 16th, 2013, 01:53 PM
#5
Re: How to locallize a plug-in DLL file?
i saw this issue in http://irprogramming.ir and this is my question , if anyone can help
-
September 17th, 2013, 01:33 AM
#6
Re: How to locallize a plug-in DLL file?
Originally Posted by forester
There is no initializing function, but there is a OnCreate() function. Do you mean I can place AfxSetResourceHandle(hRes) in the Init function if there is one?
That depends on when the OnCreate function is called. The point is to find some place for initialization and cleanup in the API that you need to expose.
Originally Posted by forester
Code:
BOOL CMyClass::OnCreate()
{
...
HINSTANCE hRes = NULL;
hRes= LoadLibrary("ResourceD.dll");
if(hRes)
AfxSetResourceHandle(hRes);
else
return false;
...
}
What is CMyClass?
Cheers, D Drmmr
Please put [code][/code] tags around your code to preserve indentation and make it more readable.
As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky
-
September 17th, 2013, 04:38 AM
#7
Re: How to locallize a plug-in DLL file?
I write the plug-in dll following the tutorial at http://www.codeproject.com/Articles/1323/Internet-Explorer-Toolbar-Deskband-Tutorial,
The CMyClass is similar to the CMFToolbar in the tutorial.
In the tutorial article, there is a LRESULT CMFToolbar::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) {}
but no other initialization function.
Thank you for your help!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|