I was updating my QuickPan script for Vegas 5 in which I created the dialog box in C# as a DLL. I wanted to add a logo to the dialog box to match an my icon button on the Vegas toolbar. To add the logo, I added a System.Windows.Forms.PictureBox to the dialog and set its Image property to a bitmap. When I tried to test my dialog in Vegas I got the following error:
I know the Scripting FAQ talked about Vegas only loading certain DLL’s and if you needed others assemblies that you should specify them in your XML file but I don’t know what to specify for loading resources (i.e., there is no System.Resources.dll).
Can someone shed some light on this? Thanks,
~jr
Error: Specified cast is not valid.The line of code it’s referring to is:
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));The resource is definitely an image (bitmap) and if I call this dialog from a test EXE program it displays perfectly with the image. So I can only assume that the resource is being compiled correctly into the DLL because its there when called from a test EXE, but somehow in the Vegas hosting environment, this call is failing.
I know the Scripting FAQ talked about Vegas only loading certain DLL’s and if you needed others assemblies that you should specify them in your XML file but I don’t know what to specify for loading resources (i.e., there is no System.Resources.dll).
Can someone shed some light on this? Thanks,
~jr