toolbarBtn.Picture = Pic;

Y

Yael

I created a com add-in for outlook 2003 in vs.net 2003 c#.
if I calling
stdole.IPictureDisp Pic =
MatarotHost.ImageToIPicture(Image.FromStream(imgStreamPic));
And I don't have a vs.net installed in a computer:
I don't get errors, but I can't see the button add-in
The add-in not arrive to this part of the code
OnStartupComplete()
else - everything running OK!
Thanking you in anticipation
Yael
Maybe I need to use somewhere Aximp.exe???
==================================
internal class MatarotHost : AxHost
{
public MatarotHost() :
base("02FD5840-C1A3-448E-8310-98611DF58281"){MessageBox.Show("base");}
public static stdole.IPictureDisp ImageToIPicture(Image image)
{ //only with vs.net installed display this msg!!!
MessageBox.Show("GetIPictureDispFromPicture");
return (stdole.IPictureDisp)AxHost.GetIPictureDispFromPicture(image);
}
}

string ns = this.GetType().Namespace;
Assembly CurrentAssembly = this.GetType().Assembly;
System.IO.Stream imgStreamPic =
CurrentAssembly.GetManifestResourceStream(ns+"." + "matarotqm.bmp");
//problem from this line!!!
stdole.IPictureDisp Pic =
MatarotHost.ImageToIPicture(Image.FromStream(imgStreamPic));
this.toolbarBtnWeb.Picture = Pic;

==================================
 
Y

Yael

the problem is with return stdole.IPictureDisp in this method if the computer
don't have vs.net installed.
 
K

Ken Slovak - [MVP - Outlook]

Are you deploying stdole.dll with your code? End users don't need VS
installed but you definitely need to deploy stdole. That was mentioned many
posts ago.
 
K

Ken Slovak - [MVP - Outlook]

No, not referenced, deployed. Are you deploying stdole.dll with your
application? If not then do so.
 
Y

yael

You mean I need to add to the computer thatI want to run my add-in the
stdole.dll ?
where should I put this dll?
in the folder of setup.exe, setup.ini, end the addinname.msi?
 
K

Ken Slovak - [MVP - Outlook]

I usually deploy it to the installation folder. That way a versioning
difference with anything that is in the GAC won't matter. Without that DLL
deployed on the target machine AxHost won't work there if you want
IPictureDisp objects.
 
Y

yael

Thank you Ken,
I added this dll into the installation folder, but it still not working.
How the add-in know to go to this location of stdole.dll?
Am I have to compile my add-in after I add the dll?
If yes, every compiling create me new Release folder..so the dll delete.
 
K

Ken Slovak - [MVP - Outlook]

I just put stdole in the installation folder and don't register it. I only
do that if I'm doing an Outlook 2003 addin, it's not necessary if I'm doing
an Outlook 2007 addin (nor is deploying extensibility.dll).

I add the dll to the file system in the setup project and that's it. Of
course I have to compile the setup project to make anything you add work in
the setup.exe or msi.

That's about all I can think of.

Did you ever post this question in a .NET group since the problem you're
having with AxHost isn't really an addin problem per se but a .NET problem.
In a .NET group you might get more answers than in the Outlook groups you've
been posting in.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top