473,396 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Handling in VS build events using C++

Hi,
I've been try to use ATL/COM to build a VC7 project and handle the
ProjectBuildStarted and ProjectBuildFinished events

I'm unable to hook my callbacks to handle the events as ATLAdvise call
fails.

Here are some snippets from the code:

The VCProjectEngine.IDL list the following interface:
...
dispinterface _dispVCProjectEngineEvents;
...
[
uuid(5F495F17-94D6-43D2-AF66-490AA1E04A79)
]
dispinterface _dispVCProjectEngineEvents {
properties:
methods:
...

coclass VCProjectEngineEvents {
[default] interface _VCProjectEngineEvents;
[default, source] dispinterface _dispVCProjectEngineEvents;
};

---------------------------------------------------------------------
I have a class CBuildEvents that implements dispVCProjectEngineEvents
class CBuildEvents:
public CComObjectRoot,
public _dispVCProjectEngineEvents
{
CBuildEvents() {}

BEGIN_COM_MAP(CBuildEvents)
COM_INTERFACE_ENTRY(_dispVCProjectEngineEvents)
END_COM_MAP()
...
STDMETHODIMP ProjectBuildStarted(...
STDMETHODIMP ProjectBuildFinished(...
};

I am stuck while trying to use register this class to handle the
callback
-----------
CoInitializeEx(NULL, COINIT_MULTITHREADED);
CComPtr<VCProjectEngine> ptrVCProjectEngine;

HRESULT hr;
hr = ::CoCreateInstance(CLSID_VCProjectEngineObject, NULL,
CLSCTX_SERVER, IID_VCProjectEngine, (void**) &ptrVCProjectEngine);

CComObject <CBuildEvents> * ptrBuildEvents;
CComObject <CBuildEvents>::CreateInstance(&ptrBuildEvents);

CComPtr<IUnknown> ptrEventsUnk = ptrBuildEvents;
DWORD dwCookie;

hr = AtlAdvise(ptrVCProjectEngine, ptrEventsUnk,
DIID__dispVCProjectEngineEvents, &dwCookie);

The call to AtlAdvise fails (hr = -2147220992) 0x80040200 FACILITY_ITF

...
//Cleanup..

I found a thread from Brick(MSFT) but seems like some parts of the
discussion are missing. Any pointers/suggestions appreciated. Please
let me know if this is an incorrect group to post this.

Thanks
Ashwin.
Nov 16 '05 #1
0 1345

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Marinos Christoforou | last post by:
Sorry if this has been asked before but as an inexperienced wanna-be C# programmer I wondering how to code classes to help build a standard Windows UI. For example to build a common toolbar. I...
2
by: Eric Newton | last post by:
VB's more declarative nature of handling events is golden. I'm hoping C# will acquire this type of deal, in addition to the anonymous delegates. could do same as vb (actually would be easier to...
3
by: Ashok Kumar K | last post by:
Hi all, Where can I get some insight on using the __hook, __unhook, event_source and event_receiver for specifically COM events. The documentation given in MSDN is very minimal. I have the...
2
by: luca | last post by:
I'm trying to build a Server Control, it's a calendar to manage sellers appointments (don't answer me to use and custumize Calendar Control because unluckily it's not possible for this specific...
1
by: Rea Peleg | last post by:
Hi everybody Can any one give an example for handling a tree view web control event, inside an asp.net application? I am able to build a tree view using this control on an asp.net web form (on...
12
by: scsharma | last post by:
Hi, I am working on creating a webapplication and my design calls for creating main webform which will have menu bar on left hand side and a IFrame which will contain all the forms that are shown...
9
by: Sridhar | last post by:
Hi, I have created a web page which includes a place holder. I also have a dropdown list in that webpage. when I select one of the choices in that dropdown list, It will load a user control...
2
by: weboweb | last post by:
Hail the experts!!! I'm creating a web user control which displays a hierarchical tree of items from an xml string passed to the control (from the host page) through an exposed property. This...
3
by: =?Utf-8?B?Rmxhc2hwcm8=?= | last post by:
i have googled this question but cannot find an answer. i'm running windows vista and i'm using Visual Basic Express 2008. i know the build event button SHOULD be in under the compile tag but i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.