Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - LoadSkin from Resource ?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

LoadSkin from Resource ?

 Post Reply Post Reply
Author
Message
apathy View Drop Down
Newbie
Newbie


Joined: 02 May 2010
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote apathy Quote  Post ReplyReply Direct Link To This Post Topic: LoadSkin from Resource ?
    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.
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2010 at 6:31am

From memory:

HINSTANCE hInstResourceDLL = LoadLibrary("YourSkin.dll");
XTPSkinManager()->SetResourceHandle(hInstResourceDLL);
PokerMemento - http://www.pokermemento.com/
Back to Top
apathy View Drop Down
Newbie
Newbie


Joined: 02 May 2010
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote apathy Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2010 at 9:28am
But how can I convert my .cjstyles file into a Dll ? Thanks again.
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 05 May 2010 at 4:11am

.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/
Back to Top
apathy View Drop Down
Newbie
Newbie


Joined: 02 May 2010
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote apathy Quote  Post ReplyReply Direct Link To This Post Posted: 05 May 2010 at 6:38am
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.
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 06 May 2010 at 3:29pm
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/
Back to Top
apathy View Drop Down
Newbie
Newbie


Joined: 02 May 2010
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote apathy Quote  Post ReplyReply Direct Link To This Post Posted: 07 May 2010 at 4:12pm
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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 24 May 2010 at 2:01pm

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/
Back to Top
apathy View Drop Down
Newbie
Newbie


Joined: 02 May 2010
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote apathy Quote  Post ReplyReply Direct Link To This Post Posted: 25 May 2010 at 2:09pm
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.




Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 2010 at 1:23pm
#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/
Back to Top
druscelli View Drop Down
Newbie
Newbie


Joined: 10 July 2012
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote druscelli Quote  Post ReplyReply Direct Link To This Post Posted: 10 July 2012 at 11:32am
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?
Back to Top
blaider View Drop Down
Newbie
Newbie


Joined: 17 November 2012
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote blaider Quote  Post ReplyReply Direct Link To This Post Posted: 18 November 2012 at 12:42am
Originally posted by znakeeye znakeeye wrote:

#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"...
thx
Back to Top
sodind View Drop Down
Groupie
Groupie


Joined: 16 March 2011
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote sodind Quote  Post ReplyReply Direct Link To This Post Posted: 21 November 2012 at 8:42am
Hello,
This solution is for one skin but for two and more.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.