atl

icon overlay handlers for namespace extension

南笙酒味 提交于 2019-12-23 04:06:39
问题 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

Search Outlook Contact using COM?

a 夏天 提交于 2019-12-23 03:11:09
问题 I want to add support for searching for local Outlook contacts to my ATL/WTL app. Does anyone know of the Outlook COM interface (Office 2003 or greater) allows you to search for contacts? I already have LDAP lookup support but users want to be able to search their private contacts as well. Any information would be welcome. 回答1: To get access to the contacts you first have to get a Namespace object using the Application's GetNamespace function, passing "MAPI" as the namespace name. Then you

In what situations is the ATL CSimpleArray a better choice than CAtlArray

断了今生、忘了曾经 提交于 2019-12-23 02:38:43
问题 The documentation says that CSimpleArray is for dealing with small numbers of objects. What is small in this context? Is CSimpleArray ever a good choice or should I always use a different collection class such as CAtlArray? 回答1: "Small" here is a rule of thumb, which stems from the way the two classes manage their memory internally. Basically, CAtlArray provides more fine-grained control of the memory it uses, and CSimpleArray deals with memory simply but naively. Specifically, when an

COM interface created by ATL inherits IDispatch but late binding does not work

无人久伴 提交于 2019-12-22 14:14:38
问题 This my IDL file. IFrame is a dual interface and inherits both IDispatch and IUnknown. [ object, uuid(C5AD0517-37FC-479C-9C7A-A063B17E4A2E), dual, nonextensible, pointer_default(unique) ] interface IFrame : IDispatch{ }; [ uuid(F7D50952-4AF1-491B-B0AA-35083AEFA998), version(1.0), ] library bdsCOMLib { importlib("stdole2.tlb"); [ uuid(9C2E7E2D-A39C-4FE7-BEEB-3BF65F9D4C05) ] coclass Frame { [default] interface IFrame; }; }; And this is the CFrame class declaration which is suppose to implement

Never ending WM_PAINT loop with ATL CWindowImpl

感情迁移 提交于 2019-12-22 12:20:13
问题 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,

Why the option to use attributes in new ATL projects was removed from Visual Studio 2008?

扶醉桌前 提交于 2019-12-22 09:57:23
问题 This is the text from MSDN comment: "According to the book ATL Internals (2ed) the use of attributes is deprecated and should not be used in new ATL projects." But WHY?!! 回答1: In ATL these attributes were a compiler trick. They were not a core part of the platform like attributes in C#. They were also more confusing to debug than macros's and the method of dumping generated attribute code was a hassle. I suspect another issue is likely to have been C++ compiler compatibility and standards

LoadLibrary project.dll failed. The specified module could not be found

亡梦爱人 提交于 2019-12-22 05:05:25
问题 When I try to register the 32 bit version of my C++ / ATL project with regsvr32 project.dll i'm getting this error: LoadLibrary("project.dll") failed - The specified module could not be found project.dll is my dll built using ATL on Visual Studio 10. The 64 bit version registered fine. What am I missing? 回答1: I have observed this exact same error, but the solution was not installing the redistributable. All the dependent DLLs were present on the system 1 according to depends.exe. In my case,

Handling ATL/ActiveX events from within JavaScript

只谈情不闲聊 提交于 2019-12-21 06:23:20
问题 I have an ATL ActiveX control that raises three events (Connected, Authenticated, Disconnected) which need to be handled in IE/JavaScript. So far as I can tell, I'm doing everything right, specifically: (1) I've told ATL to implement the IProviderClassInfo2 interface, as described here. (2) I've implemented connection points within my ATL project by following the directions here. I now have a CProxy_IMyControlEvents class, with the appropriate Fire_Authenticated(), Fire_Connected() and Fire

Shell Namespace Extension. C#. C++, MFC, AT—what to use?

泪湿孤枕 提交于 2019-12-21 05:22:18
问题 We need to create a Shell Namespace Extension. I left windows programming in 2005, that time I had to create simple shell extensions, but built very complex COM servers (in-process and out-of-process) and desktops applications. We used ATL and MFC libraries. The time has passed and now I need to come back to visual studio / windows programming. I was expecting to be able to forget all about ATL, MFC an C++, an create applications in de CLR with C#. I remember it was really very difficult to

Crash in CAtlStringMgr::GetInstance under Windows XP

不想你离开。 提交于 2019-12-21 05:01:20
问题 I've written a DLL that creates an ATL CString object. I compile it with Visual Studio 2015 using the "Visual Studio 2015 - Windows XP (v140_xp)" platform toolset. The DLL is loaded using LoadLibrary/GetProcAddress. It crashes under Windows XP in CAtlStringMrg::GetInstance when allocating the string object. The same application works well on Windows Vista and later. Here is the disassembly: static IAtlStringMgr* GetInstance() { #pragma warning(push) #pragma warning(disable: 4640) static