07-04-2011 04:49 PM
As a .NET newbie, it seems that examples posted on this topic assume knowledge that may not be there on the part of the reader (a common problem with high level knowledge, when explaining things you just take for granted). I've been playing with adding a button in a plugin, using the examples given and it just isn't working for me.
Does anyone have a working example that includes all Subs, Functions and qualifiers, such as the urn, image files/icons, etc. so I don't have to guess?
I've been around and around in circles in the SDK documentation, which is not particulary useful as it has no actual working code examples for this.
07-05-2011 06:38 AM
In this thread i posted a method for adding a new button to the toolbar, in this case, the opportunity tool bar, and the event in which it was called. These two methods were added to the plug-in sample that is included in the SDK download.
If you have any specific questions regarding implementation don't hesitate to ask.
07-05-2011 10:22 PM - edited 07-05-2011 10:28 PM
Attached is a full VS 2008 project/solution in both VB.Net and C# which demonstrates how to add a toolbar icon. It may be more helpful then just posting code examples. To run, extract the VS 2008 project attached open in VS 2008/2010. By default the startup project is the VB example.
I am running Win7/64 so the "Start External program" is set to :
"C:\Program Files (x86)\ACT\Act for Windows\ActSage.exe"
If you are NOT running Win7/64 please set this to:
"C:\Program Files \ACT\Act for Windows\ActSage.exe"
Let me know if you have any issues getting this example solution to run or if you had any difficulties so I can adjust the solution for future examples.
-- Jim Durkin
07-07-2011 02:02 PM
07-07-2011 06:05 PM
It looks like when you added the code into your project you did not copy of the BMP file used in the NewToolbar or you did not set the 'Build Action" of that BMP to 'Embedded Resource'
You also may not have removed the NewToolbar on the ACT Unload event. Either way the ACT toolbar preference file has a null icon and is choking when loading its preferences.
I am guesstimating this based on the stack:
ACT is loading its menu preferences on this line;
Then ACT is loading the image on the this line:
at System.Drawing.Icon..ctor(Stream stream, Int32 width, Int32 height)
If you actually get into ACT! then TOOLS->CUSTOMIZE->RESET MENU AND TOOLBAR.
If you can not get into ACT then delete the preference file. Its something like:
These files would be found in the roaming profile folder:
Hope this helps
-- Jim Durkin
07-08-2011 02:09 PM