Zaki Mirza’s Blog

Icon

… About software and beyond!

Visual Studio Add-in : Creating Context Menus

Note: I assume basic knowledge of what Visual Studio Add-ins are and how to create a sample add-in and tweak it.

There are several articles around the internet that will get you up and started with creating a visual studio add-in (sorry to say, most of them are just rip-offs of the stock-msdn-walk-through on how to create a visual studio add-in from the extensibility wizard). I present here my findings (the hard way, due to lack of proper documentation of these things).

So you have decided to create a visual studio add-in and know what you want to add where. Let’s take the simplified form of what I created and while we do this, we will come across issues that you might not find answer of elsewhere (at least I couldn’t).

Most add-ins require a Menu Items to be added in the main toolbar. Now I’m not going to tell you about how to do that since there are several articles on that already (heck even the walk-through that comes with MSDN tells you how to do that). I’m going to tell you how to add a button anywhere in the visual studio environment (say, on a context menu).

Read the rest of this entry »

Filed under: programming, Troubleshooter, visual studio, , , , , ,

Intellisense, UI Frameworks and Efficiencies – Discussions with Steve Teixeira

Ive been following Steve’s Teixeira’s (Group Program Manager for Visual C++) blog for a while now. A couple of months ago, i started a discussion with Steve Teixeira –  about intellisense support in Visual Studio .Net 2005 in C# as compared to Visual C++.

Later on his Channel9 video blogpost about vc++ product strategy, i asked about performance degradation in .Net UI frameworks compared to win32 API and MFC stuff. Steve put his point of view on that which started a debate about UI frameworks that have emerged since the advent of .Net Framework including WinForms and WPF. The discussion took a pace which you can see on his post’s comments. The discussion continued with steve’s response to comments on the earlier discussion in response to my question.

I think this kind of discussion breeds good interaction between the people in the business and their customers and users. Microsoft’s recent initiatives to get things right again with customers by starting channel9 and on10 and many different contests and has somewhat saved its reputation. Lets see if Microsoft can turn it around towards up again.

Also, these kinds of discussions are where blogs show their true potential of information sharing. Yes there have been forums which have served the purpose since ages. But i think blogs serve a different purpose than forums. While forums are for discussion, blogs are more about rapid information sharing. Things like these would take ages to make it to the market in a book that are now discussed on blogs by various people around the blogosphere.

Filed under: Blog Log, C++, software, visual studio

Setting up SDL-OPENGL in Visual Studio

And this CG assignment’s been giving some people pain in the gut so i thought okay why not share this with others. hopefully they’ll learn from it. So here goes.

Well the problem lies in the fact that people cant setup SDL and OpenGL together in Visual Studio (6,7,8).

Here are the steps you can follow to make it all work:

Downloading and setting up SDL:

1. For the Easiest way to do this, (on your home PC) download the sdl libraries and headers from www.libsdl.org . extract the file (in my case its: SDL_devel-1.2.11-VC6.zip). hunt the folder where you installled the visual studio. Find the folder (VC98 on VC6… VC7 on .net 2003 and vc8 on .net 2005).

2. in the include folder, create a folder called “sdl” and copy the contents of the “sdl_devel-1.2.11/include” folder ( where you jus extracted the sdl headers). These will be many header files. in other words copy *.* from sdl_devel-1.2.11/include to vc6/include. 🙂

3. in the lib folder (of visual studio) copy *.lib of the “lib” folder in sdl_devel-1.2.11 folder.

4. copy the sdl.dll file in the sdl_devel-1.2.11/lib folder to your windows/system32 folder.
Creating The SDL-OPENGL Project:

1. fireup Visual Studio of your choice.

2. Create a new Windows 32 Console Application. Name it .. i_suck :p

3. Click finish. The visual studio will create a default cpp file with the main() function declared in it.

4. In VC6 goto Project>Settings, in VC7 and VC8 right click the project in the solution explorer and click properties.

5. Under Linker>Input option: include the following libraries:
opengl32.lib glu32.lib sdl.lib sdlmain.lib

6. (OPTIONAL STEP) in the Linker>System option (im not sure if this is in VC6, but it is in VC7. This step is optional. Only if you do not want to show the console window with the graphics window) Set the subsystem to windows (or add /SUBSYSTEM:WINDOWS to the commandline option in the linker). in the linker>advanced option, set the entry point to “mainCRTStartup” or add “/ENTRY:mainCRTStartup” to commandline option of linker.

7. In c/C++ > Code Generation option, set the Runtime Library option to MULTI-THREADED DEBUG DLL.

8. Click ok and the project is setup for opengl and sdl.

The Code:

1. In you code, include the following files:
#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include <sdl/sdl.h>

Note that the ordering of the file should be right. because gl.h file requires that windows.h be included beforehand.

2. build your code. it should be successful. if it isnt, reconsider the above steps.
The Coding Part:
Do it yourself :p. Read the SDL Documentation that came with the SDL libraries and headers. Its right there in the doc folder :p. And ah yes, it will be very comfy once you switch to Visual Studio .net 2003 (and even more to .net 2005, but .net 2003 is more stable. Thats from my experience and mishi and umar manzoor recommend that as well). I have tested these steps on .Net 2003. ( dunno about VC6, i left using it ages ago). Any problems you find drop in a comment. Yes i do take donations as well :p
 

Filed under: opengl, sdl, Troubleshooter, visual studio

Blog Stats

  • 104,198 landed here so far...
May 2017
M T W T F S S
« Jan    
1234567
891011121314
15161718192021
22232425262728
293031  

tweet

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

RSS Google Shared Items

  • An error has occurred; the feed is probably down. Try again later.

RSS Google Reader Starred Items

  • An error has occurred; the feed is probably down. Try again later.

Top Clicks

  • None