Search the web
Sign In
New User? Sign Up
vsnetaddin · Visual Studio.NET Add-ins
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
VCProject::get_Platforms   Message List  
Reply | Forward Message #3849 of 3878 |
The return value from VCProject::get_Platforms is incorrect in my C++
VS 2005 addin. Can someone tell me what I'm doing wrong?

/////////////////////////////////////////////////////////////////
EnvDTE::_Solution *sln;
EnvDTE::Projects *prjs;
EnvDTE::Project *prj;
VCProjectEngineLibrary::VCProject *vcp;
hr = m_pDTE->get_Solution(&sln);
if ( SUCCEEDED(hr) )
{
hr = sln->get_Projects(&prjs);
if ( SUCCEEDED(hr) )
{
hr = prjs->Item(CComVariant(1), &prj);
IDispatch *disp;
if ( SUCCEEDED(hr) )
{
vcp = VCProjectEngineLibrary::VCProject *)prj;
hr = vcp->get_Platforms(&disp);
VCProjectEngineLibrary::IVCCollection *plats
=(VCProjectEngineLibrary::IVCCollection *)disp;

//////////////////////////////////////////////////////////////////////

If, in the debugger, I expand the value returned in disp, the vtable
clearly is wrong. In fact the memory pointed to by disp contains a
Unicode string containing the current project name, e.g. myproject.vcproj.

Thanks
green




Thu Jan 3, 2008 12:31 am

greeneyes_2399
Offline Offline
Send Email Send Email

Forward
Message #3849 of 3878 |
Expand Messages Author Sort by Date

The return value from VCProject::get_Platforms is incorrect in my C++ VS 2005 addin. Can someone tell me what I'm doing wrong? ...
greeneyes_2399
Offline Send Email
Jan 3, 2008
12:31 am

Wouldn't you know it... as soon as I posted my message, a light bulb went off in my head. The problem is the cast between EnvDTE::Project * and...
greeneyes_2399
Offline Send Email
Jan 3, 2008
12:52 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help