PDA

View Full Version : can u see whats wrong with this code?



reven
2004-12-06, 02:38 AM
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> if&#40;skinHelper == null&#41;
{
// setup skin helper
XmlDocument document = new XmlDocument&#40;&#41;;
document.Load&#40;PluginHelperFactory.getPluginHelper&#40; &#41;.GetSkinRootDirectory&#40;&#41; + getSkinSubdirectory&#40;&#41; + &#34;&#92;&#92;Skin.xml&#34;&#41;;
skinHelper = new SkinHelper&#40;document, PluginHelperFactory.getPluginHelper&#40;&#41;.GetSkinRootD irectory&#40;&#41; + getSkinSubdirectory&#40;&#41;&#41;;

}
// load background image if we havn&#39;t already
if &#40;backgroundImage == null&#41;
{
backgroundImage = skinHelper.getNamedImage&#40;&#34;Background&#34;&#41;;
}
[/QUOTE]
each time i try and use skinHelper.getWHATEVER it returns null. the skin file is fine, i can check to see if the node exists, and it does, but still getting null exception, any thoughts?

reven
2004-12-06, 02:55 AM
never mind, i found the problem (was going nuts, but found the problem) the textstyle in the composite image/drawstring referred to an undefined textstyle.

dont you just hate it when its something so simple, but you miss it, and takes you hours to realize, dah&#33;

sub
2004-12-06, 03:44 AM
The SkinHelper isnt very forgiving, but it usually gives an appropriate error message in GBPVR.exe.log. Anyway, glad to hear you got it working.