Y
Yevgeny Barkovsky
Hello!
Is the standard procedure to set CommandBar button image don't applicable
for Visio 2003?
When I try to use code listed below, I have "Unspecified error" exception.
All images referenced in the code is embedded 16x16 images.
<skipped command bar button creation>
System.Reflection.Assembly ThisAssembly;
ThisAssembly = System.Reflection.Assembly.GetExecutingAssembly();
System.IO.Stream objStreamPic, objStreamMask;
objStreamPic =
ThisAssembly.GetManifestResourceStream("VisioTestProject.settings.bmp");
objStreamMask =
ThisAssembly.GetManifestResourceStream("VisioTestProject.Settings_mask.bmp")
;
stdole.IPictureDisp iPic, iMask;
iPic =
LocalAxHost.IPictureDisp(System.Drawing.Image.FromStream(objStreamPic));
iMask =
LocalAxHost.IPictureDisp(System.Drawing.Image.FromStream(objStreamMask));
addedCommandBarButton.Picture = iPic;
addedCommandBarButton.Mask = iMask;
All code before "addedCommandBarButton.Picture = iPic;" works fine, no nulls
as iPic and iMask values....
Is the standard procedure to set CommandBar button image don't applicable
for Visio 2003?
When I try to use code listed below, I have "Unspecified error" exception.
All images referenced in the code is embedded 16x16 images.
<skipped command bar button creation>
System.Reflection.Assembly ThisAssembly;
ThisAssembly = System.Reflection.Assembly.GetExecutingAssembly();
System.IO.Stream objStreamPic, objStreamMask;
objStreamPic =
ThisAssembly.GetManifestResourceStream("VisioTestProject.settings.bmp");
objStreamMask =
ThisAssembly.GetManifestResourceStream("VisioTestProject.Settings_mask.bmp")
;
stdole.IPictureDisp iPic, iMask;
iPic =
LocalAxHost.IPictureDisp(System.Drawing.Image.FromStream(objStreamPic));
iMask =
LocalAxHost.IPictureDisp(System.Drawing.Image.FromStream(objStreamMask));
addedCommandBarButton.Picture = iPic;
addedCommandBarButton.Mask = iMask;
All code before "addedCommandBarButton.Picture = iPic;" works fine, no nulls
as iPic and iMask values....