I'am trying to create Solution Add-in with the help of this link:
http://msdn.microsoft.com/en-gb/library/vstudio/ms165621(v=vs.80)
However, I've been loosing. I follow those instructions carefully, but I think that something important is missing from my view. So, this is the order of what I am doing, and what I am planning to get:
Create default Add-in solution with the help of Add-in wizard. Since it is planning to be a solution add-in, I remove the XML declaration file.
Check "register is as a COM object" in the properties tab.
Use regasm to register the add-in as a com object in the windows registry.
And this is where the troubles begin. As I understand, I must write the following code from the link into my OnConnect event of Add-in class file. Ok, I've done that. Build project, and everything is fine.
BUT I don't understand how to associate this add-in with solution. MSDN says:
"When Visual Studio loads a solution, it first examines the solution (.sln) file to see if it references add-ins. If so, it loads them and calls the same IDTExtensibility2 methods as a regular Visual Studio add-in."
When I'am trying to debug add-in, I've open my external solution, but nothing fires in my OnConnect event, untill I've checked the add-in in Add-in manager window.
Is it intended to be so, or I am missing something important in this steps. As I understand from descriptions, solution's add-in OnConnect must be fired at the moment, when IDE opens any solution file.
I understand that this won't help you much now, but might help someone else. I have faced the same problem last week, trying to make add-in that will load and be active only with one solution. Ended up on the same MSDN page and stuck on the same point :).
To make solution add-in follow the link provided in the question. Follow all the points listed except point number five - skip adding following line of code in your add-in logic:
EnvDTE.AddIn addin = _applicationObject.Solution.AddIns.Add("MyAddin.Connect", "MyAddinName", "My add-in description", true);
Open text editor and edit .sln. Input these lines at the end of .sln file in the global section:
Global
(...)
GlobalSection(ExtensibilityAddIns) = postSolution
MyAddin.Connect = 1;My add-in description;MyAddinName
EndGlobalSection
EndGlobal
This is exactly what _applicationObject.Solution.AddIns.Add() inputs in .sln file
Now when this solution is loaded into visual studio, while loading solution it will also load this add-in. One more thing to add here:
when add-in is loaded this way, connectMode param passed to the OnConnection function has value ext_ConnectMode.ext_cm_Solution.
Hope it helps :)
Related
I just realized that we cannot modify texts in CodeMirror or Ace in a taskpane of an add-in in Excel for Windows.
I have made a test html page with this code, and link it to a manifest file of an Excel add-in. It works well in Excel Online (in Chrome and IE), Excel for Mac. However, in Excel for Windows, 1) textarea works well; 2) We could put the focus on CodeMirror, whereas we can NOT type anything; 3) When we put the focus on Excel then back on Ace, we can NOT type anything.
I have not tested other JavaScript-based source editor, because my webpage is actually built with angularjs and I need ui-codemirror or ui-ace. I have tested them, they have the same bug, though i will not list the testing code here because I don't think it is the ui- that causes the problem.
Is anyone aware of this odd behavior? How could we fix this? Is there any workaround or alternative?
PS: I have found a comment from the author of the CodeMirror, but I don't know if (and how) it can help fix add-ins in Excel for Windows.
PS2: I just realised that, if we click on Excel, then click on a useless area (somewhere without element) in the taskpane before clicking in the Ace textarea, we could then edit its content. Does anyone know how to use this to make a workaround for the Ace textarea? This method does not work with CodeMirror textarea...
I think yo can follow this steps mentioned here.
I hope it will solve your issue as it solve the issue for that user:
https://github.com/ajaxorg/ace/issues/3375
I am trying to edit a win32 RC file from my add-in and add some strings in the string table. It seems the there is no extensibility support in VcProjectEngine for this. I have managed to edit it as re regular text file but VS prompts me to reload every time. Has someone discovered another solution?
Thanks
I made a small IDE plug-in using Open Tools API that accesses ClearCase. It has menu items "Check In", "Check Out", etc. It works OK but I want it to check out a read-only file automatically if I start typing in IDE editor or if I attempt to save the file. Do you think this is possible?
I tried a few things but gave up eventually. IOTAEditorServices.KeyboardServices has AddKeyboardBinding method which looked promising. Using it I added a notifier with binding type btPartial (and later tried btComplete) and the plug-in started detecting some shortcut key presses but not all keyboard events, far from it... Any ideas would be much appreciated!
I think a "cleaner" way is to hook up a IOTAEditorNotifier to each editor and have your IOTAEditor.Modified method called by the IDE whenever the contents of the editor is modified, whether by keyboard, mouse or programmatically from another plugin.
Here's an example which registers an IOTAIDENotifier to be notified of files being opened in the IDE so it can register its IOTAEditorNotifier instances.
I must be possible somehow: we use SourceConexion (http://www.epocalipse.com/scx.htm) here, which auto checks-out the file before you edit the source or change the form.
JVCS has IDE integration support, it is open source, maybe they have implemented this too:
http://jedivcs.sourceforge.net/
I can't seem to add a reference to a DLL file in F#. It might be a bug with Visual Studio.
I attempted to add a reference to my F# project by clicking on "Add Reference" -> "browse". I found my DLL, and when I attempted to add it, nothing happened. The window didn't even close to confirm my selection. Help please.
Are you adding a reference to a managed DLL?
Anyways, if you can, make a small repro and send it to fsbugs AT microsoft dot com.
Edit: Here's the list of known issues with the F# Sept CTP.
I think there are some known issues when the DLL is produced by Managed C++, however I don't know the details. In any case, sending a bug report to the F# team as Michael suggests is the best thing to do.
Adding a reference to the F# project never works for me, i need to debug the project, then i reference the resultant dll found in the debug folders. This usually does the trick for me.
When I reference the project it always tells me that there is no dll.
I'm using Turbo Delphi 2006.
The DLL will be called from within Excel as part of a VBA/DLL combination.
The first part of the problem is trying to find out how to pass to the DLL a reference to the current Excel session. Most other code I've seen was that it launched a separate instance of Excel apart from the one you're in.
I've seen some C++ code that creates an instance of IDispatch and then passes something in to a method of the IDispatch object, but not knowing much C++.
Any ideas?
What you describe is called writing a COM addin. You need to create an automation DLL and implement the IDTExtensibility2 interface. You will then receive the Excel Application interface as a parameter to the OnConnection method.
You will also need to register your DLL as an addin so Excel will automatically load it.
EDIT: Forgot to mention: You might want to take a look at Add-in Express. Their framework and components make getting started with the creation of Office addins ridiculuously easy. You definitely won't have to bother with the details of IDTExtensibility2. All that comes with a (well-justified) price tag, though.
Delphi comes with a set of ActiveX controls to give complete access to Excel and the other Office applications. They should be on the "Servers" tab of the Tool Palette.
If the aren't there, then select Components|Install Packages, and scroll down the list there until the very end, and select the right package.
In a default installation, they should be called:
Microsoft Office Sample Automation Server Wrapper Components
and there should be one for XP and Win2k. The XP ones will work for Vista.
Now that if if you want to automate Excel.
If you merely want to add functionality to Excel by using Delphi, I'd suggest using a COM object, as I suspect that Excel is very accepting of COM objects. Otherwise, you can create a straight DLL, and use that the same way that Excel uses any other DLL.
I do not know much about Office, but I guess you should use COM/ActiveX. Then you also get your IDispatch. See http://delphi.about.com/od/comoleactivex/OLE_COM_DCOM_Automation_ActiveX_Delphi_knowledge_base.htm