Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
tools
vsnet.act
vsnet.debugging
vsnet.documentation
vsnet.enterprise.tools
vsnet.general
vsnet.ide
vsnet.jlca
vsnet.servicepacks
vsnet.setup
vsnet.vsip
vsnet.vss
vsnet.vstools.office
vstudio.development
vstudio.extensibility
vstudio.general
vstudio.helpauthoring
vstudio.setup
vstudio.sourcesafe
  
 
date: Thu, 22 May 2008 18:44:08 +0100,    group: microsoft.public.vstudio.extensibility        back       


Build events in non-English IDE   
I have written an add-in in non-MFC ATL C++ for use with DevStudio VS2005 
and 2008.  It responds to the various Build Events which are fired when one 
builds their solution.  At least it does for me but dioes not for some users 
in Spain/Germany using country-specific editions of VS2005.  Below is the 
class which implements the interface.

Why should it work for me (and many others) but not for my foreign users. 
Or could the regional setting be a red herring, and could it be a Service 
Pack issue with Visual Studio or windows?

class CBuildEventsSink:
 public IDispEventImpl<1, CBuildEventsSink, 
&__uuidof(EnvDTE::_dispBuildEvents), &EnvDTE::LIBID_EnvDTE, 7, 0>
{
public:
 /// Construct with a reference to our owner
 CBuildEventsSink(CDTEAddIn *pParent);

#ifndef DOXYGEN_INVOKED        // Shield the macros from doxygen...
 BEGIN_SINK_MAP(CBuildEventsSink)
  SINK_ENTRY_EX(1, __uuidof(EnvDTE::_dispBuildEvents), 3, BeforeBuildStart)
  SINK_ENTRY_EX(1, __uuidof(EnvDTE::_dispBuildEvents), 4, AfterBuildFinish)
  SINK_ENTRY_EX(1, __uuidof(EnvDTE::_dispBuildEvents), 5, 
BeforeProjConfBuildStart)
  SINK_ENTRY_EX(1, __uuidof(EnvDTE::_dispBuildEvents), 6, 
BuildProjConfFinish)
 END_SINK_MAP()
#endif // not DOXYGEN_INVOKED

public:
 void __stdcall BeforeBuildStart(EnvDTE::vsBuildScope Scope, 
EnvDTE::vsBuildAction Action);
 void __stdcall AfterBuildFinish(EnvDTE::vsBuildScope Scope, 
EnvDTE::vsBuildAction Action);
 void __stdcall BeforeProjConfBuildStart(BSTR sProject, BSTR sProjectConfig, 
BSTR sPlatform, BSTR sSolutionConfig);
 void __stdcall BuildProjConfFinish(BSTR sProject, BSTR sProjectConfig, BSTR 
sPlatform, BSTR sSolutionConfig, bool bSuccess);

private:
 CDTEAddIn *m_pParent;
}; // End CBuildEventsSink.
date: Thu, 22 May 2008 18:44:08 +0100   author:   Jordan Walters

Re: Build events in non-English IDE   
"Jordan Walters"  wrote in message 
news:24F30E18-109A-4100-B1B9-147A3577D453@microsoft.com...
>I have written an add-in in non-MFC ATL C++ for use with DevStudio VS2005 
>and 2008.  It responds to the various Build Events which are fired when one 
>builds their solution.  At least it does for me but dioes not for some 
>users in Spain/Germany using country-specific editions of VS2005.  Below is 
>the class which implements the interface.
>
> Why should it work for me (and many others) but not for my foreign users. 
> Or could the regional setting be a red herring, and could it be a Service 
> Pack issue with Visual Studio or windows?

I found the solution.  I changed the 7 to an 8 in the _dispBuildEvents 
interface.

class CBuildEventsSink:
public IDispEventImpl<1, CBuildEventsSink,
&__uuidof(EnvDTE::_dispBuildEvents), &EnvDTE::LIBID_EnvDTE, 8, 0>


>
> class CBuildEventsSink:
> public IDispEventImpl<1, CBuildEventsSink, 
> &__uuidof(EnvDTE::_dispBuildEvents), &EnvDTE::LIBID_EnvDTE, 7, 0>
> {
> public:
> /// Construct with a reference to our owner
> CBuildEventsSink(CDTEAddIn *pParent);
>
> #ifndef DOXYGEN_INVOKED        // Shield the macros from doxygen...
> BEGIN_SINK_MAP(CBuildEventsSink)
>  SINK_ENTRY_EX(1, __uuidof(EnvDTE::_dispBuildEvents), 3, BeforeBuildStart)
>  SINK_ENTRY_EX(1, __uuidof(EnvDTE::_dispBuildEvents), 4, AfterBuildFinish)
>  SINK_ENTRY_EX(1, __uuidof(EnvDTE::_dispBuildEvents), 5, 
> BeforeProjConfBuildStart)
>  SINK_ENTRY_EX(1, __uuidof(EnvDTE::_dispBuildEvents), 6, 
> BuildProjConfFinish)
> END_SINK_MAP()
> #endif // not DOXYGEN_INVOKED
>
> public:
> void __stdcall BeforeBuildStart(EnvDTE::vsBuildScope Scope, 
> EnvDTE::vsBuildAction Action);
> void __stdcall AfterBuildFinish(EnvDTE::vsBuildScope Scope, 
> EnvDTE::vsBuildAction Action);
> void __stdcall BeforeProjConfBuildStart(BSTR sProject, BSTR 
> sProjectConfig, BSTR sPlatform, BSTR sSolutionConfig);
> void __stdcall BuildProjConfFinish(BSTR sProject, BSTR sProjectConfig, 
> BSTR sPlatform, BSTR sSolutionConfig, bool bSuccess);
>
> private:
> CDTEAddIn *m_pParent;
> }; // End CBuildEventsSink.
>
date: Sun, 25 May 2008 10:47:43 +0100   author:   Jordan Walters

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us