During the modification of an existing ATL COM object I came across an article from the "The Old New Thing" blog called "The ways people mess up IUnknown::QueryInterface" and there was a discussion in the comments section that started when one of the respondents (Norman Diamond) pointed out that that in one of the article's examples that...
I have an ATL app where I want to handle WM_POWERBROADCAST. I have a CMainDlg (CAxDialogImpl) in whose MSG_MAP I defined the handler.
BEGIN_MSG_MAP(CMainDlg)
...
MESSAGE_HANDLER(WM_POWERBROADCAST, OnPowerChange)
...
END_MSG_MAP()
However, the handler isn't invoked when I do things that should invoke it, for instance change...
I want my BHO to listen to onmousedown event of some element in a certain webpage.
I have all the code that find the specific element, and in msdn its says that I need to use the get_onmousedown event. I came up with this code.
CComQIPtr<IHTMLElement> someElement;
VARIANT mouse_eve;
someElement->get_onmousedown(&mouse_eve);
The que...
I've got an ATL method that takes a DATE type, which is really a double. I can't find the class/functions for this type. Does anyone know how to operate on this type? I just need to make it into something I can get into boost::gregorian::date (yyyy/mm/dd). Also, I would really like to know what this double represents. Thanks.
...
On certain error cases ATL invokes AtlThrow() which is implemented as ATL::AtlThrowImpl() which in turn throws CAtlException. The latter is not very good - CAtlException is not even derived from std::exception and also we use our own exceptions hierarchy and now we will have to catch CAtlException separately here and there which is lots ...
Background:
The .TLB file contains interfaces written in language 'X'. I don't have .h, .idl, .tlh, or any other header files - just the .TLB file. Language 'X' does not export compatible .h, .idl, etc.
I use the VS wizard to add an ATL simple object to my ATL project.
I want to add a method to the interface of my simple ATL object ...
I have a legacy atl app that hosts a webbrowser control in an ATL window. I create an instance of the client to host the browser using the following sequence
CComPtr<IOleObject> spOleObject;
HRESULT hr = CoCreateInstance(CLSID_WebBrowser, NULL, CLSCTX_INPROC, ID_IOleObject,(void**)&spOleObject);
spOleObject->SetClientSite(this);
GetCli...
In our COM project, we need to choose between best string class implementation so that BSTR (used for COM interfaces) and elegant string class like CString provides many string manipulation APIs.
Are there any better way to handle the strings and string operations so that it can be BSTR complaints as well as we can have naive CString op...
Hi,
I'm trying to write a COM EXE using ATL. I also have a MFC application.
Both these applications would be run in local machines. Therefore, I don't
need to run these two processes (COM EXE and MFC) separately.
Can I create a single application (process) by combining these two applications ?
Is there any possibility that I can embed...
Hi,
i have a question,
after allot of hours in googling and reading articles, i understood that namespace extenssion in windows is quite tricky (In C++ at least), now i've also seen its possible to do so in C# , but microsft does'nt officaly confirms using .net for namespace extensions...
though i have seen very nice commercial Namespa...
Who is responsible for calling CoInitialize and CoUninitialize if
1- I host a COM dll within a surrogate process (either by using dcomcnfg utility or COM+ wizard)?
2- I build a ISAPI DLL that contains COM objects?
...
Hi,
I have a native C++ dll and two classes:
classA
{
void setNumber(int number);
int getNumber();
}
classB
{
void setclassA(classA*);
classA* getclassA();
}
I have an ATL dll that wraps the native C++ dll and two interfaces: InterfaceForClassA , InterfaceForClassB .
InterfaceForClassA :
STDMETHODIMP CInterfaceForClassA::createClass...
Is there a way to somehow Embed a WTL destop application in ATL ActiveX (ie extension)?
What I'm trying to achieve is to create an ActiveX control with office files Viewer.
As a base I have a desktop WTL application (written some time ago) which uses OOo v3 API to display documents.
I have created an ActiveX project, linked necessar...
I have a custom button control created using ATL. This control is used by some composite controls and lots of dialog boxes. I just added some new properties to the button control and found that I then had to update all the controls and dialogs that used it. This is a really poor situation so I wondered if I could be doing something be...
I have a Windows service built upon ATL 7's CAtlServiceModuleT class. This service serves up COM objects that are used by various applications on the system, and these other applications naturally start getting errors if the service is stopped while they are still running.
I know that ATL DLLs solve this problem by returning S_OK in Dl...
Hi,
I need to design an ATL inproc server that besides exposing methods and properties, also can fire events (source) and serve as a sink for a third party COM control that fires events. I would assume that this is a fairly common requirement. I can also foresee several "gotchas" that I would like to read up on before commencing the ...
I have a VB6 dll that is loaded by a VB6 frontend. This VB6 dll calls a C++ ATL dll via its COM interface. So, I can run from code in VB6 and I can debug in C++ also, however I can't seem to step through the VB6 code and then get into the C++ code. I feel that this should be possible. Currently I am doing the following steps
Start VB6 ...
Hello there.
I have a Win32 C++ Application. There is the _tWinMain(...) Method with GetMessage(...) in a while loop at the end. Before GetMessage(...) I create the main window with
HWND m_MainHwnd = CreateWindowExW(WS_EX_TOOLWINDOW | WS_EX_LAYERED, CAxWindow::GetWndClassName(), _TEXT("http://www.-website-.com"), WS_POPUP, 0, 0, 1024, ...
I have captured total desktop using CPP, COM and DirectShow. But how can I capture particular window only?
...
Hi,
I have created an ATL Project with all default options using VC++ 2008.
I have added Simple ATL object (interface IDemo) and some interface moethos inside the simple object.
I want to use MFC classes (e.g. CDatabase, CRecordset and lots more) inside my ATL project.
How can I achieve this?
Thanks.
...