none
hidden project

    Pertanyaan

  • Is it possible to have a project in the solution hidden?  What I am looking to do is create a project and load it into the solution, but have it be invisible to the user.  My project would handle the loading and building of the hidden project.

    Thanks,

    Mike

    25 April 2006 14:05

Jawaban

  • Hello Mike,

    It is actually very simple to make your project a hidden virtual project. One you have created your project you must query for the SVsSolution service and then call

    HRESULT AddVirtualProjectEx([in] IVsHierarchy *pHierarchy, [in] VSADDVPFLAGS grfAddVPFlags, [in] REFGUID rguidProjectID)

    Omitting the value ADDVP_AddToProjectWindow from the flag of type VSADDVPFLAGS will turn your project into a hidden virtual project.

    The SVsSolution service also contains a method where you can get to the list of hidden project in a solution.

    HRESULT GetProjectEnum([in] VSENUMPROJFLAGS grfEnumFlags, [in] REFGUID rguidEnumOnlyThisType, [out] IEnumHierarchies **ppEnum);

    Thanks,

    Ole

    25 April 2006 17:06

Semua Balasan

  • Hello Mike,

    It is actually very simple to make your project a hidden virtual project. One you have created your project you must query for the SVsSolution service and then call

    HRESULT AddVirtualProjectEx([in] IVsHierarchy *pHierarchy, [in] VSADDVPFLAGS grfAddVPFlags, [in] REFGUID rguidProjectID)

    Omitting the value ADDVP_AddToProjectWindow from the flag of type VSADDVPFLAGS will turn your project into a hidden virtual project.

    The SVsSolution service also contains a method where you can get to the list of hidden project in a solution.

    HRESULT GetProjectEnum([in] VSENUMPROJFLAGS grfEnumFlags, [in] REFGUID rguidEnumOnlyThisType, [out] IEnumHierarchies **ppEnum);

    Thanks,

    Ole

    25 April 2006 17:06
  • Thanks for the help Ole.  Do these projects have to be nested?  Any reference I could find for AddVirtualProjectEx pointed to nested examples and classes.

    Thanks,

    Mike

    25 April 2006 18:42
  • No, you can Add virtual projects as top level projects also. It's correct, we do not have samples that demonstrates that.
    25 April 2006 19:40