Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7787337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:37:58+00:00 2026-06-01T20:37:58+00:00

I have some code that used to work in prior versions of Visual Studio

  • 0

I have some code that used to work in prior versions of Visual Studio but crashes in the new beta and I can’t seem to figure out why.

I am trying to obtain the VCReferences object for for a VCProject. The code it supposed to work on all version of VS.

Thanks.

VCProject * GetVCProjectObject(IDispatch * aDispatch)
{  
  IID VCProject_IID;
  switch(mStudioVersion)
  {
    case VS2003:
      ::IIDFromString(_bstr_t(L"{70b6c8e7-5b3e-49c7-9937-c5f0b3168af3}"), &VCProject_IID);
      break;
    case VS2005:
      ::IIDFromString(_bstr_t(L"{238b5174-2429-11d7-8bf6-00b0d03daa06}"), &VCProject_IID);
      break;
    case VS2008:
      ::IIDFromString(_bstr_t(L"{3990034a-3af2-44c9-bd22-7b10654b5721}"), &VCProject_IID);
      break;
    case VS2010:
      ::IIDFromString(_bstr_t(L"{885c172e-5b7a-43b9-8ad0-697f48233772}"), &VCProject_IID);
      break;
    case VS11:
      ::IIDFromString(_bstr_t(L"{F900F95E-1D99-4631-BBD1-E3E1E078D58E}"), &VCProject_IID);
      break;
}

  CComPtr<VCProject> vcProject;
  aDispatch->QueryInterface(VCProject_IID, (void**)&vcProject);

  return vcProject.Detach();
}


void SomeMethod(EnvDTE::Project * aProject)
{
  CComPtr<IDispatch> pID;
  aProject->get_Object(&pID);
  CComPtr<VCProject> vcProject = GetVCProjectObject(pID);

  if (!vcProject)
    return false;

  CComPtr<IDispatch> dipsProjRefs; 
  //CRASH HERE !!!! 
  vcProject->get_VCReferences(&dipsProjRefs)
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:38:00+00:00Added an answer on June 1, 2026 at 8:38 pm

    This is from MSDN forums

    Okay, word from the C++ team is they don’t support back-compat of
    their object interfaces between VS versions, which is why they re-GUID
    them (which you already account for above).

    That means they have likely changed the v-table layout of VCProject in
    Dev11 and it no longer matches the layout in previous versions.

    Perhaps your code worked before because the GUIDs changed but the
    v-table layouts of the specific objects you are using did not.

    I don’t know if you NEED to import the TLB for some reason, but in
    theory you could special case Dev11 and define a local interface
    definition with the same v-table layout as the Dev11 VCProject class
    and the same GUID, and then when you find your code is running in
    Dev11 you would use that interface, otherwise you would use the ‘old’
    one. QI works on GUID ids and only relies on the v-table layout
    matching, so if you make sure both of those are true it doesn’t matter
    if the interface you use in your local code is actually one you
    defined yourself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code that used to work. But I today when I try
I have some working code that uses IImgCtx to load images, but I can't
I have some legacy code that was used to monitor my applications cpu,memory etc
I have some code that is using SyncEnumerator. As you can see here ,
I have some code that dynamically creates a new button through JavaScript that when
I have some code that does MemoryStream ms = new MemoryStream(); ... return Image.FromStream(ms);
I'm trying to build some image algebra code that can work with images (basically
I have written some code that used strings to represent time such as 0620,
We have some code that is making use of the new postMessage functionality in
I am taking some code that I have used for a nested listview before

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.