atl

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

∥☆過路亽.° 提交于 2019-12-06 08:47:50
问题 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

CoCreateInstance does not start or connect to ATL COM service

岁酱吖の 提交于 2019-12-06 08:11:32
问题 I have a ATL COM service exe (MyService.exe), which compiles and runs fine. If I install this service (via MyService.exe /Service), it is successfully installed into the SCM. I can start the service through the SCM and it runs fine, under the LOCALSYSTEM account. My problem arises when I attempt to create an instance of a COM class defined by the service. My test harness application (MyServiceTest.exe), calls the following: ::CoInitialize(NULL); ::CoInitializeSecurity(NULL, NULL, NULL, NULL,

Sample ATL Dialog Window

蓝咒 提交于 2019-12-06 07:10:45
问题 Can anyone help me find an up-to-date, working ATL project which has a main window and some components in it? Please, for the love of god, don't tell me to use WTL/Qt or others. I need ATL. There's no up-to-date project about it. I just need a main window, that's all. I can figure out the rest. Thanks in advance. 回答1: OK, for the love of god: Visual Studio 2010 C++/ATL EXE project from template + dialog window. Source: Trac: AtlDialogSample SVN: AtlDialogSample This is of your primary

Tab key doesn't work in IWebbrowser2

孤者浪人 提交于 2019-12-06 05:29:15
I am using an ActiveX control to implement an embedded browser in an ATL app (IWebbrowser2). The problem is, that I can't jump between text fields using the tab key. Pressing the tab key just does nothing. Pressing the Enter key submits the form as expected. The problem exists e.g. on the facebook login site. How can I make the tab key work properly? Must I activate something in the ATL control to make this work? Thank you! Fabian This article describes a way how to use IWebBrowser2 in C: http://www.codeproject.com/KB/COM/cwebpage.aspx In some comments below it, people have exactly the same

Add ATL Simple Object in Visual Studio 2017

廉价感情. 提交于 2019-12-06 04:16:34
问题 I am working with an old ATL/COM project in Visual Studio 2017. In previous versions of Visual Studio you could select "Add Class" and then select the option "Add simple ATL object" to add a COM class to the project. This option appears to be completely missing in Visual Studio 2017. Has the option been moved? Have I missed an installation option? Does Visual Studio fail to recognize my project as an ATL project? (It was created with a much older version.) Or is this the end of the road for

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

ぐ巨炮叔叔 提交于 2019-12-06 03:35:35
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?!! 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-adherence. Attributes didn't make for more beautiful C++ code, and perhaps this syntax may be used in a future

What is Microsoft using as the data type for Unicode Strings?

旧城冷巷雨未停 提交于 2019-12-06 03:17:36
问题 I am in the process of learning C++ and came across an article on the MSDN here: http://msdn.microsoft.com/en-us/magazine/dd861344.aspx In the first code example the one line of code which my question relates to is the following: VERIFY(SetWindowText(L"Direct2D Sample")); More specifically that L prefix. I had a little read up, and correct me if I am wrong :-), but this is to allow for unicode strings, i.e. to prep for a long character set. Now in during my read up on this I came across

VC编译错误:LIBCMT.lib(crt0.obj) : error LNK2001: un...

三世轮回 提交于 2019-12-06 01:45:23
错误信息:LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main 在ATL . server工程中加入一个自己开发的dll库,结果导致上述问题。dll的入口函数问题。 解决办法就是, 去掉编译器选项的_ATL_MIN_CRT宏定义 。 转 : 有的时候, 在ATL控件中可能需要使用C/C++运行库, 这个时候由于默认的ATL工程中定义了宏_ATL_MIN_CRT,那么,可能阻止了release工程的编译, 出现类似于下面的错误 MSVCRT.lib(MSVCRT.dll) : error LNK2005: _free already defined in StdAfx.obj MSVCRT.lib(MSVCRT.dll) : error LNK2005: _malloc already defined in StdAfx.obj MSVCRT.lib(MSVCRT.dll) : error LNK2005: _realloc already defined in StdAfx.obj MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _free already defined in StdAfx.obj; second definition ignored

How to debug a COM C++ Out of Process Server ? (client: Excel vba)

我是研究僧i 提交于 2019-12-06 00:31:18
I don't know how to debug a COM ATL C++ out of process exe server with Visual Studio 2015. For a COM ATL DLL there is no problem, the breakpoints are automatically triggered when I call the COM dll. However when I try to debug an EXE server, the debugger didn't break. Indeed the exe server is only loaded at demand and the debug symbols of the exe server are not loaded when the client starts. My client, that call the COM server, is Excel VBA (I have added the reference to the com exe, in the VBA editor, via Tools/References). To debug it, I set the path to Excel.exe in the Visual Studio Debug

How to implement a simple add-in for MS Excel on C++

无人久伴 提交于 2019-12-05 20:35:19
I need a help for implementing add-in for Excel 2010 or higher on C++, the only functionality of this add-in is renaming of current Excel sheet. The add-in should create new custom tab on the Ribbon with name: “Test Add-in”, this tab contains group with name “My Functionality”, this group contains large button with some picture with name “Rename Current Sheet”. After clicking on the button, I should show the following dialog: User can enter new name, click ok and after this, the name of current sheet will be changed. I understand that I need to use #import directive for getting references to