atl

Compile ATL project with only Windows SDK 7.1

此生再无相见时 提交于 2019-12-05 03:42:37
I have a project which needs to be compiled. It is compiled on our build server which I have only installed Windows SDK 7.1 on. I would like to not have to install an actual Visual Studio on this machine, but am getting an error "cannot find atlstr.h" file which I've just read is part of ATL which is part of Visual Studio. Is there any way I can get this to compile without installing Visual Studio on the build server? ATL is now freely available as a part of Windows Driver Kit: http://msdn.microsoft.com/en-us/windows/hardware/gg487438.aspx No. ATL is a fundamental part of the non-free versions

How can I return both an error string and error code to VB6 from an ATL activex control?

倖福魔咒の 提交于 2019-12-05 01:05:51
问题 I'm trying to return a detailed error to VB6 using CComCoClass::Error, but it seems I can only return an error code /or/ a message - but not both. return Error(_T("Not connected"), __uuidof(IMyInterface), HRESULT_FROM_WIN32(ERROR_CONNECTION_INVALID)); results in a generic "Method 'Request' of object 'IMyInterface' failed" error message in Err.Description on the VB6 side (but ERROR_CONNECTION_INVALID in Err.Number), while return Error(_T("Not connected")); results in the appropriate error

How to communicate between two COM objects using Running Object Table (ROT)?

我的未来我决定 提交于 2019-12-04 20:06:27
问题 I have two COM objects written in C++ and ATL. There are in one library and I know their IIDs and CLIDs. I can't find an example of doing this simple communication between two simple COM objects. How to create IMoniker and how to add it to ROT? And then, how to retrieve pointer of this object,in other COM in different process/thread? Does anyone can provide a small example? EDIT : More info: I'm writing an add-on for IE. There are two COM object completely unrelated that IE load for different

Handle HTMLElementEvents2 when DWebBrowserEvents2 has been handled using ATL's macros

感情迁移 提交于 2019-12-04 18:38:23
I'm creating a Browser Helper Object using VS2008, C++. My class has been derived from IDispEventImpl among many others class ATL_NO_VTABLE CHelloWorldBHO : public CComObjectRootEx<CComSingleThreadModel>, public CComCoClass<CHelloWorldBHO, &CLSID_HelloWorldBHO>, public IObjectWithSiteImpl<CHelloWorldBHO>, public IDispatchImpl<IHelloWorldBHO, &IID_IHelloWorldBHO, &LIBID_HelloWorldLib, /*wMajor =*/ 1, /*wMinor =*/ 0>, public IDispEventImpl<1, CHelloWorldBHO, &DIID_DWebBrowserEvents2, &LIBID_SHDocVw, 1, 1> { . . . BEGIN_SINK_MAP(CHelloWorldBHO) SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID

How to get complete HTML body using browser helper object (BHO) in case of DHTML/AJAX page?

余生颓废 提交于 2019-12-04 18:15:36
I'm writing a BHO that analyze the HTML taken from the 'onDocumentComplete' event of 'DWebBrowserEvents2' . Currently it works fine, unless I have a DHTML/AJAX page, where HTML handle is delivered too soon. For sample, I tried using it on 'http://www.google.com' . From the 'onDocumentComplete' event I can get most of the page but in the topmost link/anchors, the 'href' for maps, videos, orkut etc. is not available (normally it is javascript:void(0) ). Has anyone any ideas how to capture it when the page is fully loaded rather than just when the frame/body is loaded? Thanks, UPDATE It seems

How to write simple background thread in CWorkerThread

孤街醉人 提交于 2019-12-04 16:37:51
I'm trying to asynchronously run function in my add-on for Internet Explorer (I'm writing BHO in VC++). As suggested here I'm trying to use CWorkerThread. I've been trying to figure it out for hours but still have no idea how to do it. I don't have much experience in ATL. The lack of a good documentations or tutorials on Internet is killing me. I'm creating class by Add->Class and choosing ATL Simple Object (that's how you add classed to ATL project right?). But how to implement this IWorkerThreadClient? I thought that choosing Add->Implement Interface in Class View would be good but there is

How exactly do I config DCOM to load my DLL into a separate process?

十年热恋 提交于 2019-12-04 15:05:23
I'm trying to force an existing native C++ ATL in-proc COM server into a separate process. I hope DCOM can do this for me without changing the COM server. I started with a usual registry setup - I have a HKCR\CLSID{classId} entry and an InProcServer32 key there specifying the path to the .dll file. I generated an application id (GUID) and added it here and there. Specifically I added a string value "AppId" under HKCR\CLSID{classId} equal to the application id. I also added a HKCR\AppId{applicationId} key and a string value "DllSurrogate" equal to an empty string. I thought it would be enough

Using MFC in Windows service?

懵懂的女人 提交于 2019-12-04 13:53:23
问题 I'm starting to develop a Windows service. I want to use some classes from my own, that has little dependencies to some MFC classes like CString, CSocket, CArchive, CMemFile and CObject. MSDN says you need to be very careful about which pieces of MFC you use in the Windows service, but don't specifies it and don't describes the problems that can occur. My questions are: what pieces of MFC can be used? what problems can I expect, by using MFC? which parts of Windows service are critical for

Javascript post message event handler in ATL C++ BHO

时光总嘲笑我的痴心妄想 提交于 2019-12-04 13:30:18
On a webpage I have a button with JavaScript post message. In my BHO IE add-on I need an event listener for this message event. Any clue how this can be done? My OnDocumentComplete is as below. Can you give some more pointers where we can write code for handling this event. I want to make a REST API call from this message handler. TestScript.h: // TestScript.h : Declaration of the CTestScript #pragma once #include "resource.h" // main symbols #include "TestBHO_i.h" #include <mshtml.h> // DOM interfaces #if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS

Detect clicking inside listview and show context menu

有些话、适合烂在心里 提交于 2019-12-04 12:47:18
I have a listview created as a resource and loaded on a dialog window. I want to detect and show a context menu only when items within the listview have been clicked. MESSAGE_HANDLER(WM_CONTEXTMENU,OnContextMenu) LRESULT OnContextMenu(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { int iSelected = -1; int iFocusGroup = -1; iSelected = SendMessage((HWND)wParam, LVM_GETNEXTITEM, -1,LVNI_SELECTED); iFocusGroup = ListView_GetFocusedGroup((HWND)wParam); if( iSelected != -1 && iFocusGroup == -1) { hPopupMenu = CreatePopupMenu(); Insert Menu(hPopupMenu, 0, MF_BYCOMMAND | MF_STRING | MF