Help needed with add-in code that tries to find the IDE 'Workspace'
window.
I am trying to write a VC++ add-in that gathers all the function names
that appear in the Workspace window (Class view tab).
I have auto generated the add-in with help of the add-in wizard. I
have posted my code here but this generates an assertion error in
'...vc98\atl\include\atlbase.h' when run, not really surprising as I
have stumbled my way through this code.
I am finding it very difficult to find information on the subject -
any replies containing book titles/code samples/add-in info, etc would
be very useful. I have looked through the APPAUTO.H for the
IGenericWindow interface but there is no helpful info associated with
each function.
My code:
//Loop through all the windows to find the 'Workspace' window
CComPtr<IDispatch> pGenericWindow;
VERIFY_OK(m_pApplication->get_Windows(&pGenericWindow));
CComQIPtr<IGenericWindow, &IID_IGenericWindow>
pGenWindow(pGenericWindow);
bool ExitLoop=false;
while (!ExitLoop)
{
BSTR Buf;
//Get this window's title
pGenWindow->get_Caption(&Buf);
CString WindowTitle;
WindowTitle=(char *)_bstr_t(Buf, FALSE);
//Is this the "Workspace" window?
if ( WindowTitle.Find("Workspace") != -1 )
//exit loop
ExitLoop=true;
//Move on to the next window
pGenWindow->get_Next(&pGenericWindow);
}
Oh, and the workspace window is open when I run this code. Please
help!!