Visual Studio 6 Custom Toolbar - vb6

I have a legacy VB6 app that I still need to support. I also have a new PC and I would like to copy my custom toolbar that I created on my old PC. Does anybody know where Visual Studio 6 custom toolbars are persisted to?
Thanks

I think you are talking about an addin. Addins written in VB6 for VB6 use a reference to Microsoft Visual Basic 6.0 Extensibility. You compile the application as an ActiveX EXE and as such it can be placed anywhere on the hard drive. You can look at vbaddin.ini for the *addin.*Connect setting where addin will be the addin name. Unfortunately this is not the file name or path, but it should be close enough to help you search the the application.

I don't know where that is stored, but you could try running Process Monitor from SysInternals, and see what VB6 writes to files and the registry when you change your custom toolbar. To be honest though, it'll probably be quicker to set the toolbar up by hand.

Related

How to code in Visual Studio 6.0 without UI editor

I'm new to Visual Basic. I have done some tutorials in Visual Studio 2010 and I am working with Visual Basic 6.0.
I don't know where I can write code the way I did in VB 2010. Instead of the code editor that was available in Visual Studio 2010, I get a UI editor, where I can add buttons. How can I simply write some Visual Basic code?
In VB6, there is a code view. If you double click the button it will take you to the click event in the code view for instance.
If you create modules.. (.bas file extension), you can write stand alone code. It's also possible to create an activex dll project to write code components. I used to do this, register them with com and then call them from ASP pages on NT4 servers back in the day.
VB6 predates the .NET framework though. It's much different than what you've learned in Visual Studio 2010. None of the .NET libraries are there and there are some syntax differences as VB.net is more strict than VB6 is.
You code use other editors alongside VB 6's editor like Notepad ++ and Sublime Text if you are really good in VB othersise just stick to it. Its very cool and people are making world class apps with vb6 check planetsourcecode.com you see wonders

How does VSTO work in Visual Studio 2010?

Few question about VSTO project I don't understand:
Registration - unlike native Office Plugin, where I've an installation project, how does the deployment work in managed add-in? After building the project, I do have the necessary entries in the registry that define the plugin (HKCU\Software\Microsoft\Office\Outlook\Addins...). Where is the code that perform this registration?
Also, why in the HKCU? I'd like the plugin to be defined for all users (in HKLM). How do I change that?
How does Visual Studio know to start Outlook, when I press F5? In the property page for the project, under the debugging tab, the 'Start Option' is set to 'Start project'. Who tells Visual Studio that starting the project means starting Outlook?
Looking for more materials about VSTO. Can you recommend a resource?
A few answers
1. Basically the same for a managed project except that the Reg entries point to the .MANIFEST file, which in turn identifies the dll of the addin assembly.
Ohhh. this is a LONG story, there's lots of info on the web about it. Google "registering an addin for all users".
Short version is that it's possible, but requires some really weird and difficult to explain registry shinanigans.
If you've created an Outlook addin property, then by virtue of that project type, VS knows what to do on start.
I've never found a good definitive source for vsto material. Google's been my best friend for that kind of info. Andrew Coates has a pretty decent list here though
http://blogs.msdn.com/b/acoat/archive/2007/08/02/vsto-resources.aspx
I have no explicit information but currently I'm working through http://msdn.microsoft.com/en-us/library/ff937654.aspx which so far has been a great source of information. Please let me know if this worked out for your Outlook project.

How do I set permissions on my VSTO outlook add-in?

I am trying to distribute my Outlook Add-In to the rest of the company.
I'm using Visual Studio 2008 Professional and Outlook 2003. In VS I used an installed template for Outlook 2003. It created a solution with BOTH a project and an installer.
I use the project and created an Add-In. It works GREAT on my PC in development. Now, I want to distribute it. Here's where things go haywire. The nice little installer they provide DOESN'T ACTUALLY WORK.
The installer runs and places the files where they are to go, but the add-in doesn't run. Instead it gets errors about not having permissions. The installer didn't automatically set the security settings for you.
No problem. You just have to set those settings... right? But no where can I find a simple list of those settings.
I've been to http://msdn.microsoft.com/en-us/library/bb332051.aspx a thousand times from almost every possible link on the web. I've read every Microsoft paper that I can find on VSTO add-Ins. Unfortunately everything seems to reference some magic script... "Just include the sample code..."
[rant] IF A SECTION OF CODE OR AN ENTIRE SOLUTION IS REQUIRED TO DISTRIBUTE YOUR CODE IT IS NOT SAMPLE!! IT IS REQUIRED !!! [/rant]
There. I feel better.
Since I installed VS2008, I don't have the directory:
C:\Program Files\Microsoft Visual Studio 2005 Tools for Office SE Resources\Samples
No problem, right? Just DL it from microsoft. I've downloaded every "vstor.exe" that I can get my hands on. They all offer to "repair or uninstall" my current installation, but no matter what I choose, the vstor.exe crashes.
HELP!!!
I just want to know what I need to do (the manual steps, if necessary!!!!!) to get my friggin app distributed.
No magic "include this gizmo". No fifty-thousand page diatribes.
Anyone know how this is ACTUALLY done?!
I got it to work.
I was able to get a "sample code" update from Microsoft that allowed me to follow the walk-through.
I still think that's utterly ridiculous to HAVE to use sample code to easily distribute your app. However it is working at the moment.
The link I used was given to me by anonymous use on a different board. Whoever you are THANK YOU!!!!
Here is the link I was given:
http://www.microsoft.com/downloads/details.aspx?familyid=6991E869-8D5B-45F4-91E7-B527BD236F4C&displaylang=en
This allowed me to actually get my hands on that mysterious "sample" code even though I use VS2008 Professional.

How to use VB6 debugger on Outlook property page OCX?

Using VB6, I have created an Outlook plugin, that has a property page. The property page is an OCX control.
When I compile the project to an OCX file, and then run OUTLOOK, things work fine: I am able to see my OCX as a tab in the Outlook options.
However, when I try to debug by running the OCX in VB6 I get an error. My debugging is started like this:
1) Debug options set to Wait for components to be created"
2) F5-RUN project in VB6.
3) Start Outlook.
4) Get the error: "Cannot display "MyOcx" page. This page will remain visible, but is not available. An OLE registration error occurred. The program is not correctly installed. Run Setup again for the program"
I suspect this is because, when debugging, the OCX is being created out-of-proc and Outlook doesn't like that.
Is there a good technique to use the VB6 debugger on the OCX in this scenario?
The VB6 debugger is sometimes flaky when debugging DLLs or OCXs.
You could try Windbg, a free standalone debugger from Microsoft. Compile your VB6 OCX into native code with no optimisation and "create symbolic debug info" (i.e. create PDB files), and you will be able to debug your OCX in-process in Outlook. Here's a 2006 blog post by a Microsoft guy about using Windbg with VB6, and 2004 blog post by another Microsoft guy with a brief introduction to Windbg.
You could also use the Visual Studio 2008 debugger with VB6 and PDB files, e.g. with Visual C++ Express Edition (which is free). EDIT see Kris's answer for more details.
EDIT: Both Windbg and Visual Studio expect the source code to be in exactly the same path on the debug machine as it was on the build machine when the OCX was built. The easiest way is to build and debug on the same machine. Otherwise you might need to fiddle with SUBST to create virtual drives - or I'm told the serious way is to use a Symbol Server.
(Les serious) you could do without those newfangled interactive debuggers, just log to a file, or with DebugMessage calls from your VB6.
The only way you are really going to be able to Debug this is In Process as MarkJ said. Using the free Visual Studio 2008 C++ Express Edition (or even better, Visual Studio 2008 Professional if you have it, and it is available for a 90 day trial) and a PDB.
To make sure you are creating the PDB, go into Visual Basic, check the P)roject / P)roperties and click on the Compile tag. Make sure "Create Symbolic Debug Info" is checked.
Next start up Outlook, and attach to that process from Visual Studio (T)ools / Attach To Process. Make sure your Ocx is shown in the modules window, and then load the PDB (right click on the Ocx in the modules window). You will probably have to add the source code in the Solution Properties (for more details on how to do that, read this post).
It's a bit of a pain in the butt the first time, but once you can do it, it becomes pretty easy, and is far easier than trying to determine what is going on from a log.
I don't have much idea on the OCX.
However, you can use a tool which was part of visual studio named something like "activex control test tool".
As far as I know (based on my understanding of documentation), OCX is created in-proc.

Visual Studio 2008 Plug-in / Add-in development - Getting Started

In relation to this stackoverflow question, how would I go about creating my own Visual Studio 2008 plug-in?
I've checked the Visual Studio Developer Centre on MSDN, but the amount of info is overwhelming. There are loads of project types, and I don't even know where to start.
Where should I start looking if I want to write something which meets the following requirements:
A plug-in that runs like a "service" in Visual Studio, and is able to poll Visual Studio for information, and handle Visual Studio events.
The info I'd like to access from VS are things like, what projects are currently open, who has them open, and other solution/project file based info.
The events I'd like to be able to handle are things like, the opening/closing/editing/creating/deleting of Solutions / Projects / individual files.
I'd also like to be able to handle any interaction with VS on a per solution basis. So, I'd like to handle any interaction with files, even code editing, but also, just other interaction, like with the menus, or just the IDE itself.
As well as these, I'd also like to be able to store data somewhere. Where is this usually done? Can I add Metadata to the Solution file? Or, does it make sense to save this info to a small local instance of a database, that is somehow attached to the solution..?
I just need a push in the right direction, is any of this possible? What part of the Visual Studio Developer Centre should I focus on? What APIs should I check out?
cheers!
An add-in can do most of that. There's a template in VS2008 for creating a base add-in.
I have an add-in that you can download that hooks into the solution/project load events etc - it is free and comes with source code ( http://www.huagati.com/projectloader/download/huagatiprojectloader.zip ). This particular add-in detects when projects/solutions are loaded and pre-loads referenced assemblies to work around a CLR bug that can cause VS2008 to crash. Anyway, the source code for it shows how to detect some of the events you're looking for.
Other than that, the definitive resource on add-in development and all the little quirks and tricks involved is Carlos Quintero's blog ( http://msmvps.com/blogs/carlosq/ ) and the "howto" article series on his website ( http://www.mztools.com/resources_vsnet_addins.aspx ).
Craig Skibo's blog ( http://blogs.msdn.com/craigskibo/ ) also has some useful tips.
You want:
Visual Studio Extensibility Developer Center
VSX Forum
Visual Studio 2008 SDK
Professional Visual Studio Extensibility by Keyvan Nayyeri
Buy the book, if nothing else.

Resources