LoadSkin from Resource ? |
Post Reply |
Author | |
apathy
Newbie Joined: 02 May 2010 Status: Offline Points: 5 |
Post Options
Thanks(0)
Posted: 02 May 2010 at 8:44am |
Hi,
just wondering if its possible to load an .cjstyles skin from resource instead from file ? What would I need to do in order to do that ? Thanks. |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
From memory: HINSTANCE hInstResourceDLL = LoadLibrary("YourSkin.dll");
XTPSkinManager()->SetResourceHandle(hInstResourceDLL);
|
|
PokerMemento - http://www.pokermemento.com/
|
|
apathy
Newbie Joined: 02 May 2010 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
But how can I convert my .cjstyles file into a Dll ? Thanks again.
|
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
.cjstyles is just an extension. You can rename it to whatever you want, like .dll. If you want all skins in a dll, then you need to search this forum for: XTToolkitPro.rc
|
|
PokerMemento - http://www.pokermemento.com/
|
|
apathy
Newbie Joined: 02 May 2010 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
But I want to embedd the .cjstyles as a resource, I dont want to load it from a file.
SkinBuilder can export my style as a .rc file, how can I apply the skin from that file ? Thanks. |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
Just include the resources of interest into your rc-file (probably YourResourceDll.rc). E.g.:
#include "Styles\Office2007Blue\Office2007Blue.rc"
...
And to load the skin:
XTPOffice2007Images()->SetHandle(hInstanceDLL, _T("OFFICE2007BLUE.INI"));
XTPSkinManager()->LoadSkin(NULL, _T("NormalBlue.ini")); |
|
PokerMemento - http://www.pokermemento.com/
|
|
apathy
Newbie Joined: 02 May 2010 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
How do I get hInstanceDLL since I cant load it via LoadLibrary ? And do I have to use SetHandle instead of
XTPSkinManager()->SetResourceHandle(hInstResourceDLL); Wouldnt that work aswell ? Thanks for your time |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
Create your resource-only DLL and include the rc-files of your choice. Then use the code above. hInstanceDLL = LoadLibrary("YourResourceOnly.dll");
...
Why wouldn't you be able to use LoadLibrary?
|
|
PokerMemento - http://www.pokermemento.com/
|
|
apathy
Newbie Joined: 02 May 2010 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
I think u didnt get my point.
From memory: HINSTANCE hInstResourceDLL = LoadLibrary("YourSkin.dll");
XTPSkinManager()->SetResourceHandle(hInstResourceDLL);
How is this loading from memory ? its loading from file (.dll) .cjstyles is just an extension. You can rename it to whatever you want, like .dll. yeah and .exe is just a extension aswell and u cant rename it to .dll Create your resource-only DLL and include the rc-files of your choice. Then use the code above. hInstanceDLL = LoadLibrary("YourResourceOnly.dll");
...
Why wouldn't you be able to use LoadLibrary?
And again, I dont want to use a dll, sorry. Why do I need to include the .rc script generated by SkinBuilder and ALSO need to build a dll ? I dont get it. I just want to add the rc file into my dialogapp and directly load it from there. |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
#include "Styles\Office2007Blue\Office2007Blue.rc"
...
And to load the skin:
XTPSkinManager()->LoadSkin(NULL, _T("NormalBlue.ini")); Just move those resource files to your exe's rc2 file instead. This question has been answered like 100 times in this forum. Search for "rc2" or "XTToolkitPro.rc"...
|
|
PokerMemento - http://www.pokermemento.com/
|
|
druscelli
Newbie Joined: 10 July 2012 Status: Offline Points: 1 |
Post Options
Thanks(0)
|
I'm having a problem too.
I downloaded a skin from skinbase.org Glosso.msstyles How can I include this skin in my resource and load it from there?
|
|
blaider
Newbie Joined: 17 November 2012 Status: Offline Points: 2 |
Post Options
Thanks(0)
|
thx
|
|
sodind
Groupie Joined: 16 March 2011 Status: Offline Points: 28 |
Post Options
Thanks(0)
|
Hello,
This solution is for one skin but for two and more.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |