atl

Getting MIDL 2003 Redefinition errors

偶尔善良 提交于 2021-02-10 15:39:43
问题 I have a very simple program that I am trying to compile before I build it out any further. I am trying to learn COM so following along here, I create app.h and app.cpp file in VS 2017 and using the ATL Template. When I try to build the solution I get a lot of MIDL 200 redefinition errors. UPDATE (Based on @Roman R.'s response) Note that if I used cl /LD app.cpp on a Dev Command Line, I am able to generate app.dll correctly. The MIDL 2003 redefinition errors show up only when trying to build

Getting MIDL 2003 Redefinition errors

风流意气都作罢 提交于 2021-02-10 15:39:14
问题 I have a very simple program that I am trying to compile before I build it out any further. I am trying to learn COM so following along here, I create app.h and app.cpp file in VS 2017 and using the ATL Template. When I try to build the solution I get a lot of MIDL 200 redefinition errors. UPDATE (Based on @Roman R.'s response) Note that if I used cl /LD app.cpp on a Dev Command Line, I am able to generate app.dll correctly. The MIDL 2003 redefinition errors show up only when trying to build

SHOpenFolderAndSelectItems for explorer replacement program

橙三吉。 提交于 2021-02-06 14:07:41
问题 I maintain a explorer/file manager tool (xplorer2) that can replace windows explorer for opening folders. However I cannot trap the "open folder and select item" operation performed by SHOpenFolderAndSelectItems API. I found an old thread by some other file manager programmer which implied that the right way is to register the "explorer-like" tool as a shell window, then respond to some queries to supply interfaces and services like IWebBrowserApp that will allow the item(s) to be selected I

SHOpenFolderAndSelectItems for explorer replacement program

喜夏-厌秋 提交于 2021-02-06 14:01:31
问题 I maintain a explorer/file manager tool (xplorer2) that can replace windows explorer for opening folders. However I cannot trap the "open folder and select item" operation performed by SHOpenFolderAndSelectItems API. I found an old thread by some other file manager programmer which implied that the right way is to register the "explorer-like" tool as a shell window, then respond to some queries to supply interfaces and services like IWebBrowserApp that will allow the item(s) to be selected I

SHOpenFolderAndSelectItems for explorer replacement program

回眸只為那壹抹淺笑 提交于 2021-02-06 14:01:28
问题 I maintain a explorer/file manager tool (xplorer2) that can replace windows explorer for opening folders. However I cannot trap the "open folder and select item" operation performed by SHOpenFolderAndSelectItems API. I found an old thread by some other file manager programmer which implied that the right way is to register the "explorer-like" tool as a shell window, then respond to some queries to supply interfaces and services like IWebBrowserApp that will allow the item(s) to be selected I

How to get the method signatures for DShellFolderViewEvents

自闭症网瘾萝莉.ら 提交于 2021-01-29 21:56:09
问题 I'm trying to sink DShellFolderViewEvents using the ATL, and the only method I've been able to successfully subscribe to is DISPID_SELECTIONCHANGED . There appear to be many other events listed in the header shdispid.h , but I can't get them to fire. Not sure what I'm doing wrong (it might be ATL-related), but I thought perhaps I'm implementing event-handler functions with the wrong signatures (currently I'm just trying void functions with no arguments). The problem is that there doesn't

Template specialization with compile time constant

左心房为你撑大大i 提交于 2021-01-29 02:21:46
问题 I am trying to build a specialization for a template class with a compile time constant. The template class looks like this: template<class TNativeItem, class TComItem = void, VARTYPE _vartype = _ATL_AutomationType<TComItem>::type> class InOutComArray { private: CComSafeArray<TComItem, _vartype> _safeArray; // ... public: InOutComArray( TNativeItem* items, size_t length, std::function<TComItem(const TNativeItem&)> convertToCom, std::function<TNativeItem(const TComItem&)> convertFromCom) :

Is there a better way to declare a char-type appropriate instance of a CStringT<> than

﹥>﹥吖頭↗ 提交于 2020-03-02 08:15:33
问题 What I am trying to get at is a function that generates an instance of a CStringT<> that is appropriate for a given type of character (char or wchar_t). Here's a contrived example: #include <atlstr.h> template <typename CHAR_T> inline CStringT< CHAR_T, ATL::StrTraitATL< CHAR_T, ATL::ChTraitsCRT< CHAR_T > > > AsCString(const CHAR_T * psz) { return CStringT< CHAR_T, ATL::StrTraitATL< CHAR_T, ATL::ChTraitsCRT< CHAR_T > > >(psz); } I can certainly use the above (it appears to compile), but it

WTL学习记(二):WTL的消息处理链

ε祈祈猫儿з 提交于 2020-02-05 16:03:18
前小节简单介绍了WTL安装注意的一点小的细节并举例简述如何对自己的窗口类添加对消息的响应,这一节主要就WTL如何实现对windows窗口过程函数的封装陈述些自己的理解。 一、ATL对Windows窗口的封装 WTL的基础是ATL。WTL的框架窗口是ATL窗口类的继承。因此,先介绍一下ATL对Windows窗口的封装。 由win32 API 中创建Windows应用程序可以知道创建窗口和窗口工作的逻辑是: 1 定义一个窗口类 2 注册窗口类 3 创建该类窗口并显示和激活该窗口 4 窗口的消息处理逻辑在窗口函数中。(该函数在注册窗口类时指定) 可以得知,对于窗口的封装关键在于怎样封装窗口消息处理机制。怎样将消息传递给相应的类的实例。通常的办法是采用虚函数:将每个消息对应生成一个虚函数,这样,在窗口处理函数中,对于每个消息,都调用其对应的虚函数即可。但带来的问题是类的虚函数表过于庞大。ATL的处理机制是只定义了一个虚函数(ProcessWindowMessage())。 图示ATL封装的类的继承关系图。从图中可以看到有两个最基本的类。一个是CWindow,另一个是CMessageMap。 在ATL类中对窗口过程的实现是CWindowImpl。它派生自CWindow、CMessageMap,CWindows是对Windows的窗口API的一个封装。它把一个Windows句柄封装了起来

【华为云技术分享】【玩转Atlas200DK系列】应用开发之 交叉编译第三方库并在工程中使用(jsoncpp)

心已入冬 提交于 2020-01-29 04:33:10
在本案中,我们以jsoncpp为例来介绍如何交叉编译第三方库,并在工程中是使用; 1. 从github上下载jsoncpp源码 wget https://github.com/open-source-parsers/jsoncpp/archive/master.zip; 2. 配置源码的交叉编编译环境。在我们安装了DDK的服务器上,arm的编译器在/usr/bin目录下,所以我们在jsoncpp目录下的CMakelist.txt中添加: SET(CMAKE_SYSTEM_NAME Linux) SET(CMAKE_C_COMPILER "/usr/bin/aarch64-linux-gnu-gcc") SET(CMAKE_CXX_COMPILER "/usr/bin/aarch64-linux-gnu-g++") SET(CMAKE_FIND_ROOT_PATH /usr/aarch64-linux-gnu/) SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 3. 在源码目录下执行下述命令,即可编译得到arm的libjsoncpp.so cd jsoncpp