2004-12-02, 07:01 PM
I am trying to add a penel to the DVD2MPEG plug-in so that it can display status on the main menu page. The only example I could find to use as a template was the sysinfo plug-in. I;ve tried to modify it and adapt it to fit what I guessed to be the strtcure for panels in .23.8 but I get the following error
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.InvalidCastException: Specified cast is not valid.
at GBPVR.Public.SkinHelper.getNamedImageNonCached(String name, Hashtable parameters)
at GBPVR.Public.SkinHelper.getNamedImage(String name, Hashtable parameters)
at DVD2MPEGPlugin.DVD2MPEGTask.renderPanel()
at bv.a(Boolean& A_0)
at n.v()
at bv.b(String A_0)
at n.a(Message& A_0)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
My render panel routine is
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
public Image renderPanel()
{
Hashtable args = new Hashtable();
// setup skin helper
XmlDocument document = new XmlDocument();
document.Load(PluginHelperFactory.getPluginHelper().GetSkinRootDirectory() + "\\panels\\dvdtompeg.xml");
SkinHelper myskinHelper = new SkinHelper(document, PluginHelperFactory.getPluginHelper().GetSkinRootDirectory() + getSkinSubdirectory());
string conversionState=" ";
switch (currentRipState)
{
case RippingState.Besweet:
conversionState = "Converting DVD audio";
break;
case RippingState.Decrypt:
conversionState = "Decrypting DVD";
break;
case RippingState.Mplex:
conversionState = "Building MPEG file";
break;
}
args["@ConversionState"] = conversionState;
DateTime currentTime = DateTime.Now;
args["@Time"] = currentTime.ToShortTimeString();
args["@Date1"] = currentTime.DayOfWeek;
args["@Date2"] = currentTime.ToShortDateString();
Image offScreenBmp = myskinHelper.getNamedImage("DVDtoMPEGPanel",args);
Graphics offScreenDC = Graphics.FromImage(offScreenBmp);
offScreenDC.DrawImage(offScreenBmp, 500, 100);
offScreenDC.Dispose();
return offScreenBmp;
}
[/QUOTE]
Any ideas what I am doing wrong?
Thanks
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.InvalidCastException: Specified cast is not valid.
at GBPVR.Public.SkinHelper.getNamedImageNonCached(String name, Hashtable parameters)
at GBPVR.Public.SkinHelper.getNamedImage(String name, Hashtable parameters)
at DVD2MPEGPlugin.DVD2MPEGTask.renderPanel()
at bv.a(Boolean& A_0)
at n.v()
at bv.b(String A_0)
at n.a(Message& A_0)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
My render panel routine is
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
public Image renderPanel()
{
Hashtable args = new Hashtable();
// setup skin helper
XmlDocument document = new XmlDocument();
document.Load(PluginHelperFactory.getPluginHelper().GetSkinRootDirectory() + "\\panels\\dvdtompeg.xml");
SkinHelper myskinHelper = new SkinHelper(document, PluginHelperFactory.getPluginHelper().GetSkinRootDirectory() + getSkinSubdirectory());
string conversionState=" ";
switch (currentRipState)
{
case RippingState.Besweet:
conversionState = "Converting DVD audio";
break;
case RippingState.Decrypt:
conversionState = "Decrypting DVD";
break;
case RippingState.Mplex:
conversionState = "Building MPEG file";
break;
}
args["@ConversionState"] = conversionState;
DateTime currentTime = DateTime.Now;
args["@Time"] = currentTime.ToShortTimeString();
args["@Date1"] = currentTime.DayOfWeek;
args["@Date2"] = currentTime.ToShortDateString();
Image offScreenBmp = myskinHelper.getNamedImage("DVDtoMPEGPanel",args);
Graphics offScreenDC = Graphics.FromImage(offScreenBmp);
offScreenDC.DrawImage(offScreenBmp, 500, 100);
offScreenDC.Dispose();
return offScreenBmp;
}
[/QUOTE]
Any ideas what I am doing wrong?
Thanks