Addins Bitmaps

I know that there are several posts about people having issues with getting the bitmaps to work but I could not get a strait answer out of any of them. So i decided to make my own post.

I started off with the addin template that you can get from solidworks web site.

This is the code for getting the image paths as strings.

<p></p><p>cmdGroup = iCmdMgr.CreateCommandGroup(1, Title, ToolTip, <span style="color: #a31515;">""</span>, 3)</p><p>cmdGroup.LargeIconList = iBmp.CreateFileFromResourceBitmap(<span style="color: #a31515;">"AssemblyPricing.ToolbarLarge.bmp"</span>, thisAssembly)</p><p>cmdGroup.SmallIconList = iBmp.CreateFileFromResourceBitmap(<span style="color: #a31515;">"AssemblyPricing.ToolbarSmall.bmp"</span>, thisAssembly)</p><p>cmdGroup.LargeMainIcon = iBmp.CreateFileFromResourceBitmap(<span style="color: #a31515;">"AssemblyPricing.MainIconLarge.bmp"</span>, thisAssembly)</p><p>cmdGroup.SmallMainIcon = iBmp.CreateFileFromResourceBitmap(<span style="color: #a31515;">"AssemblyPricing.MainIconSmall.bmp"</span>, thisAssembly)</p>

And everything was working good until I tried to insert my own pictures then it stopped working. I even tried to switch it back to the original way with original pictures, and nothing. cmdGroup.... always comes back "". I have played with that for like a long time and nothing just cant get it to work.

So then after reading a few posts and some more playing I realized that it worked to just do this:

<p>cmdGroup = iCmdMgr.CreateCommandGroup(1, Title, ToolTip, <span style="color: #a31515;">""</span>, 3)</p><p>cmdGroup.LargeIconList = <span style="color: #a31515;">"C:\\Documents and Settings\\LM Cad\\My Documents\\LM-SoftWorks\\ToolbarLarge.bmp"</span></p><p>cmdGroup.SmallIconList = <span style="color: #a31515;">"C:\\Documents and Settings\\LM Cad\\My Documents\\LM-SoftWorks\\ToolbarSmall.bmp"</span></p><p>cmdGroup.LargeMainIcon = <span style="color: #a31515;">"C:\\Documents and Settings\\LM Cad\\My Documents\\LM-SoftWorks\\MainIconLarge.bmp"</span></p><p>cmdGroup.SmallMainIcon = <span style="color: #a31515;">"C:\\Documents and Settings\\LM Cad\\My Documents\\LM-SoftWorks\\MainIconSmall.bmp"</span></p>

Is there anything wrong with my last example that I should not do it that way ?

Why does the first example cause so much trouble ?

What is the main reason people cant get the first example to work ?

SolidworksApi macros