Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
S

sns

@sns
About
Posts
8
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to call GetIPictureFromPicture(Image image) method using C#.
    S sns

    using System; namespace OffAutomation { /// /// Summary description for Class1. /// public class ImageConverter: System.Windows.Forms.AxHost { public ImageConverter():base("59EE46BA-677D-4d20-BF10-8D8067CB8B33") { // // TODO: Add constructor logic here // } public static stdole.IPictureDisp ImageToIpicture(System.Drawing.Image image) { return (stdole.IPictureDisp)ImageConverter.GetIPictureDispFromPicture(image); } } } this is the way u have to write a class... and call like this Image img = System.Drawing.Image.FromFile(@"F:\yicon.ico"); stdole.IPictureDisp obj = OffAutomation.ImageConverter.ImageToIpicture(img);

    C# csharp tutorial

  • Point out the error
    S sns

    Hi, Thanx for the help given. i implemented the same method earlier, but im getting the same error. still im not getting the reason for that error, bcoz both methods OleloadPictureFile as well as GetIPictureDispFromPicture gives the proper image, the only thing is im not able to assign this to a commandbarbutton. im using shared addins through which im communicating to Microsoft Office 2000, in that im adding an customized commandbarbutton. I have referred Microsoft Office 9.0 object Library and stdole for picture. To the commandbarbutton im able to add events, text and other so many properties except Picture and Mask... Can u tell the reason why this error is coming, is any reference missing?. regards, sns:confused:

    C# help csharp asp-net json

  • How to call GetIPictureFromPicture(Image image) method using C#.
    S sns

    Can anybody tell how to call GetIPictureFromPicture(Image image) method using C#. regards, sns

    C# csharp tutorial

  • Point out the error
    S sns

    im happy to hear that u r also trying to do same thing what im trying,so i'll be getting some help regarding this. this how u have to declare an API [DllImport("oleaut32.dll", CharSet = CharSet.Unicode, PreserveSig = true, EntryPoint = "OleLoadPictureFile")] static extern void OleLoadPictureFile(Object varObj,[ MarshalAs(UnmanagedType.IDispatch )] out Object oOut); so when u r referring this automatically u can call the method, in query itself i have specified how to call, u can refer the same. regarding help even i was not able to locate the same, no documentation, the thing is if it is VB so many documents available, but for C# no help. for stdole u have to add a reference to stdole. try this. in case any pbm reply to me. Thanks. regards, sns

    C# help csharp asp-net json

  • Point out the error
    S sns

    i tried out all posiblities, and i think the out object of OleLoadPictureFile() is not returning correct format, because when i loaded with someother bmp and tried to get the type it is giving Object refernce not set to an instance of an object... dont know the reason, the same error is not coming for a1.bmp when i tried to read the type of pic. can u suggest me someother method to load picture or with the existing one with change of some properties... looking for a postive reply from u. Thanking you. regards sns

    C# help csharp asp-net json

  • Point out the error
    S sns

    Actually what i understood from handle means it will return -1 if it is an error. am i correct? if so im getting 8 digit +ve number when i read the handle. im not able to locate still whats an error. regards, sns

    C# help csharp asp-net json

  • Point out the error
    S sns

    an error. am i correct? if so im getting 8 digit +ve number when i read the handle. im not able to locate still whats an error. regards, sns

    C# help csharp asp-net json

  • Point out the error
    S sns

    hi friends, i want to add an image to commandbarbutton in C#. i have added appropriate code but im getting an error saying that "object reference not set to an instance of an object" when im trying to assign an picture to commanbarbutton.Picture property. here is my sample code: CommandBars objCommandBars; CommandBar objCommandBar; object str = "MyToolBar"; objCommandBars = (CommandBars)applicationObject.GetType().InvokeMember("CommandBars", BindingFlags.GetProperty , null, applicationObject ,null); objCommandBars["MyToolBar"].Delete(); objCommandBars.Add(str,omissing,omissing,omissing); objCommandBars["MyToolBar"].Position = MsoBarPosition.msoBarFloating; cmdOpenI = (CommandBarButton)objCommandBar.Controls.Add(1,omissing,omissing,omissing,omissing); cmdOpenI.Caption = "Test"; cmdOpenI.Tag = "Test"; String strFile = "F:\\a1.bmp"; Object lpDisp = null; try { OleLoadPictureFile((Object) strFile, out lpDisp); //API relevant to LoadPicture in VB stdole.StdPicture pic = (stdole.StdPicture)lpDisp; if (pic != null) { cmdOpenI.Style = MsoButtonStyle.msoButtonIconAndCaption; cmdOpenI.Picture = (stdole.IPictureDisp)pic;// here only im getting an error "object reference not set to an instance of an object" } } catch(Exception exp) { System.Windows.Forms.MessageBox.Show(exp.Message); } cmdOpenI.Visible = true; cmdOpenI.Click += new Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler(OpenIntranet_Click); objCommandBars = null; objCommandBar = null; if i set the commandbutton type as 2,3 otherthan button type 1 im not getting an error. but i want the button type to be 1. can anybody help me to achieve the task. Thanks in advance regards, sns

    C# help csharp asp-net json
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups