Jie Long

I add a VSP tool window to my current project. When I set a break point in the .cpp files of my tool window. It doesn't work. Only break points in my original project work well. Is there anything else I should do Thanks.

Jie



Re: Visual Studio Extensibility How can I debug my VS packages?

Craig Skibo - MSFT

How are you running devenv.exe Do you have it set to be the prgram that launches, are you attaching Can you provide more information about how you are setting up your development environment

Craig






Re: Visual Studio Extensibility How can I debug my VS packages?

Jie Long

Thank you for answering anf asking, Craig. I partly solved this problem. Now the question is extended to how to communicate between the toolwindow generated by VS packages and my project For example, my project is used to read and display an image in MFC. When the image is loaded and displaying in the MFC window, I want to make this image also display in my VS toolwindow at the same time.

Now the whole debuging steps are as following:

1 Launch VS 2005

2 Load MyProject.sln

3 Set a breakpoint in VsPackages.cs

4 run and debug

5 VS 2005 exp Hive lauches automatically. It stops at the breakpoint. Click run. (We can notice that the toolwindow created by MyProject.sln appears in VS 2005 exp Hive )

6 Open ImageProject.sln in this exp Hive

7 run and debug (We can only debug the ImageProject here)

8 MFC window appears. We open a .bmp files and the picture will display in the MFC window.

9 Questions:

(1) What should I do first to inform the toolwindow (in MyProject.sln) to display this image(In ImageProject.sln )





Re: Visual Studio Extensibility How can I debug my VS packages?

Craig Skibo - MSFT

When VS runs, it puts an item moniker into the Running Object Table which contains the ProgID of VS combined with the process ID. You can use this within your MFC app to find the DTE object of VS. Next, index the Windows collection with DTE.Windows.Item(...) and pass in the GUID you used when creating the ToolWindow. With the Window object, call Window.Object. This will return the programmatic interface of your tool window. Expose a method on the tool window, then call that method passing in the filename of the bitmap.

Craig






Re: Visual Studio Extensibility How can I debug my VS packages?

Jie Long

Thank you very much! It's very helpful! But what do you mean by "Expose a method on the tool wimdow" How can I get the method of loading the image in VS package solution Because there are two individual solutions here, one is the MFC app, another is the VS package solution, I know how to call the tool window in MFC app by your answer but I'm still not sure about how to call the MFC methods in tool winow solution Use the item moniker again