Edit RC file from add-in - visual-studio-addins

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

Related

Cannot edit CodeMirror or Ace in a taskpane of an add-in in Excel for Windows

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

How to create solution add-ins in Visual Studion 2008

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 :)

How do I add recent items to my program's jump list on the Windows 7 taskbar?

I'm using Delphi XE and would like to add "recent items" in the Windows 7 taskbar jump list for my application, like when right-clicking on Microsoft Word brings up recently opened documents.
I've found information on how to set the progress but nothing on jump-list items. Any help would be greatly appreciated.
This will happen automatically if, for instance, you only use the standard Windows file dialogs. At least my text editor, Rejbrand Text Editor, has got such a MRU list by Windows. It lists all files I have recently edited using Rejbrand Text Editor, even though I have not written any code at all for it.
I think that Windows observes the files you
open and save in your application by means of standard Windows file dialogs
open in your application by starting yourapp.exe <file name>, for instance by double-clicking a file that opens in your application
and automatically display these in the list.
If you want to control the task bar button and menu programmatically, you can use the Windows API. Delphi-specific examples are found in this blog post.
In my opinion the best way to do this is to make the following simple API call:
SHAddToRecentDocs(SHARD_PATH, PChar(FileName));
This not only deals with Windows 7 jump lists but also adds your file into the system's list of recently used documents which has an effect on early versions of Windows too.
Call the function whenever you open or save a file.
For your convenience, a link to the documentation of SHAddToRecentDocs().
Here are some resources that I have found useful when making my programs vista ready
http://code.google.com/p/theunknownones/wiki/TaskbarListComponents
http://www.installationexcellence.com/articles/VistaWithDelphi/Index.html
http://www.theabsolute.net/sware/delphivista.html

Modifying old Win32 application without source code (possibly written using Borland tools)

I have a quite old Windows application (1998) which is no longer maintained by the author and I don't have its source code. This application in one of its windows has a dropdown list widget where the user can choose one of the 4 predefined values (numbers). I need to add new predefined values there or change the widget to something that lets me introduce any value (some edit field or editable combobox).
Some other data about the application:
Probably written using some Borland tools, I guess it uses BDE and Paradox as its database.
There is a file with .mme extension in the directory. I unpacked it and it contains 5 files: .data, .rdata, .rsrc, .sdata, .text. I viewed them in a hex editor and they contain some text data but I don't know how to look for those predefined values. Since they are numbers it's probable that I will find just some other numbers.
I tried using RedEdit and XN Resource Editor but they show only the icon and version info.
I know my question is kind of vague, but if I don't find any solution to this I will have to rewrite the whole program, so I'm asking just in case there is a solution.
It might be possible to write another app that looks for this program, gets a handle to the window owning the drop-down box (if t's a native windows component), and then gets a handle to the drop-down box and use the Windows SendMessage API to manipulate the contents of the drop-down box.
http://msdn.microsoft.com/en-us/library/ms632595(v=VS.85).aspx
http://msdn.microsoft.com/en-us/library/ms644950(v=vs.85).aspx
It might require so much effort that it may be better to just rewrite the app!
If it is written with Borland tools, you can probably find out which one by searching the EXE for the string "Borland" - there should be a copyright string somewhere.
Once you know, find someone with Borland tools experience and have her find out if those numbers in the drop-down list happen to come out of a database table. If they do, try modifying that table, if not, rewrite the app :)

Writing a DLL for Excel in Delphi

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

Resources