Print Page | Close Window

LoadSkin from Resource ?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=16653
Printed Date: 27 November 2024 at 3:24pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: LoadSkin from Resource ?
Posted By: apathy
Subject: LoadSkin from Resource ?
Date 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.



Replies:
Posted By: znakeeye
Date Posted: 04 May 2010 at 6:31am

From memory:

HINSTANCE hInstResourceDLL = LoadLibrary("YourSkin.dll");
XTPSkinManager()->SetResourceHandle(hInstResourceDLL);


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: apathy
Date Posted: 04 May 2010 at 9:28am
But how can I convert my .cjstyles file into a Dll ? Thanks again.


Posted By: znakeeye
Date 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/


Posted By: apathy
Date 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.


Posted By: znakeeye
Date 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/


Posted By: apathy
Date 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


Posted By: znakeeye
Date 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/


Posted By: apathy
Date 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.






Posted By: znakeeye
Date 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/


Posted By: druscelli
Date 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?


Posted By: blaider
Date 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


Posted By: sodind
Date Posted: 21 November 2012 at 8:42am
Hello,
This solution is for one skin but for two and more.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net