atl

How to return positive error code from ATL to VB6?

有些话、适合烂在心里 提交于 2019-12-07 03:58:47
问题 I have checked out the answer at: How can I return both an error string and error code to VB6 from an ATL activex control? I am able to return custom negative error codes, ie with the severity bit set, and a custom error message. But, I would like to be able to generate a code that VB6 will present as a positive # for Err.Number that the user will find easier to use. I'm pretty sure that it can be done since Microsoft's DAO 3.6 DLL is able to. For example, it returns Err.Number= 3078 with Err

How do I add MFC ActiveX control to an existing activex project

我的梦境 提交于 2019-12-07 03:46:30
问题 In visual studio 2008 I can create an MFC activex project and it presents a wizard to create a single activex control. I now want to create new controls within this project. I can't find any way to do this. 回答1: I just found that the templates and scripts to generate the ActiveX control code are located in : Microsoft Visual Studio 9.0\VC\VCWizards\AppWiz\MFC\Control\ There is probably some way to modify that so that it could add a control to an existing project. 回答2: I couldn't find a way to

VS2008出现atlcom.h(431) : error C2146

人走茶凉 提交于 2019-12-06 21:53:47
从一个vc6程序转换过来的,碰到了atlcom.h(431) : error C2146,网上一般的做法都是下载vs2008的atl安全升级包,300多m,我这龟速网络可得一天啊……后来,一想,我装了vs2010,vs2010是不是包含这些玩意了,就把程序又转成vs2010了,果然ok~哈哈 参考文章: http://blog.csdn.net/fishneu/article/details/6109383 vs2008补丁VS90SP1-KB971092-x86下载地址: http://www.microsoft.com/downloads/en/details.aspx?familyid=294de390-3c94-49fb-a014-9a38580e64cb&displaylang=en 来源: oschina 链接: https://my.oschina.net/u/52594/blog/48549

Compile ATL project with only Windows SDK 7.1

不想你离开。 提交于 2019-12-06 21:30:06
问题 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? 回答1: ATL is now freely available as a part of Windows Driver Kit: http:/

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

做~自己de王妃 提交于 2019-12-06 15:04:13
问题 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

icon overlay handlers for namespace extension

随声附和 提交于 2019-12-06 14:50:59
I am developing namespace extension which gives a virtual view of files on a server. In this view, I need to provide different states(in use, offline, out of sync, etc) of a file using overlay icons. I was read through article implementing overlay handler, and thought I will try to handle this in one of our overlay handlers, which implement IShellIconOverlayIdentifier interface. I see that IShellIconOverlayIdentifier::IsMemberOf(), and other functions are called only when I access files on normal filesystem, i.e., c:\, d:\ etc. When I browse a namespace extension, these calls are not called at

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

人走茶凉 提交于 2019-12-06 14:15:49
问题 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

How to create a splitter in ATL/WTL?

随声附和 提交于 2019-12-06 13:51:56
I want to place the elements of my (resizable) dialog in one of two panes. How do I create a splitter for the panes, using WTL? I found CSplitterImpl and CSplitterWindowImpl , but I can't figure out how to use them with my dialogs. WTLExplorer sample from WTL should get you the idea, see \Samples\WTLExplorer. If you'd like more, there's a lot around, e.g. http://www.viksoe.dk/code/splitterbar.htm 来源: https://stackoverflow.com/questions/7324153/how-to-create-a-splitter-in-atl-wtl

Never ending WM_PAINT loop with ATL CWindowImpl

前提是你 提交于 2019-12-06 11:16:27
I have a very simple Win32 application that uses CAtlExeModuleT. The module simply creates a class CTestWindow derived from CWindowImpl. It just has a single message handler for WM_PAINT. After I create the window and display it, the OnPaint method (WM_PAINT message) is called infinitely and there by consumes 100% CPU. The code that creates the window is very simple: m_pMainWnd = new CTestWindow(); if(NULL == m_pMainWnd->Create(NULL, CWindow::rcDefault, _T("Test Window"), WS_OVERLAPPEDWINDOW, 0, hMenu)){ DWORD dwErr = GetLastError(); return E_FAIL; } m_pMainWnd->ShowWindow(nShowCmd); The

How to suppress “There are still active COM objects in this application” error when closing application?

狂风中的少年 提交于 2019-12-06 09:50:39
问题 I've written a few ATL COM objects that are used for drag-and-drop within my C++ Builder application. Due to reasons beyond my control, my application still has active COM objects when the user attempts to close it. This is because other COM clients that use my objects seem to cache my COM objects and don't release them - as a result, my COM objects still have a reference count greater than zero when the user clicks the "X" to close my program. This results in the user getting an unfriendly