com

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

Correct way to stop asynchronous ISearchJob

吃可爱长大的小学妹 提交于 2021-02-10 06:33:12
问题 I am going to use WUA API and begin execution of an asynchronous search for updates in this way: CComPtr<SearchCallbackImpl> iscc_; <<-- Note you need to CreateInstance CComPtr<ISearchJob> pUpJob_; pUpJob_ = NULL; pUpSearcher_->BeginSearch( CComVariant(criteria.c_str()).bstrVal, iscc_, CComVariant(L"Scanning"), &pUpJob_); When I need to stop my program, but ISearchJob has not completed yet, I use this code: if (pUpJob_) { CComVariant isStopped; pUpJob_->get_IsCompleted(&isStopped.boolVal); if

Error notification from COM event handler, using interop

帅比萌擦擦* 提交于 2021-02-10 06:09:50
问题 I'm consuming a com object in c#, using com-interop. I provide an event handler to the object, which it calls after doing its thing. Here's the problem. I have some sanity-check code in the handler that throws an exception if all is not well with the world: _comObj.OnRequestCompleted += (int requestID, RequestStatus status) => { if (<sanity check fails>) throw new Exception("This is insane!!!"); ... } The com object is apparently swallowing those exceptions, because I never see them in my app

COM object VARIANT parameters in comtypes (python)

纵饮孤独 提交于 2021-02-09 11:42:13
问题 I am trying to use comtypes 1.1.0 package to access COM object within python 2.7.6.1 and I have a basic problem to get correct data from COM object method due to return VARIANT type >>> from comtypes.client import CreateObject >>> fm1 = CreateObject("MCB.PCM") >>> fm1.ReadVariable("dwt") (<comtypes.automation.LP_tagVARIANT object at 0x06A541C0>,<comtypes.automation.LP_tagVARIANT object at 0x06A54210>, <comtypes.automation.LP_tagVARIANT object at 0x06A54260>, True) How to convert VARIANT

COM object VARIANT parameters in comtypes (python)

蹲街弑〆低调 提交于 2021-02-09 11:42:11
问题 I am trying to use comtypes 1.1.0 package to access COM object within python 2.7.6.1 and I have a basic problem to get correct data from COM object method due to return VARIANT type >>> from comtypes.client import CreateObject >>> fm1 = CreateObject("MCB.PCM") >>> fm1.ReadVariable("dwt") (<comtypes.automation.LP_tagVARIANT object at 0x06A541C0>,<comtypes.automation.LP_tagVARIANT object at 0x06A54210>, <comtypes.automation.LP_tagVARIANT object at 0x06A54260>, True) How to convert VARIANT

Pythoncom PumpMessages from different thread

*爱你&永不变心* 提交于 2021-02-09 08:25:09
问题 I want to do something similar to what is asked here, but using threading like here. Using also the answer from here, I got my code working, only that an ItemAdd event is not recognised (actually, I think it is, but in the other thread, which is why there is no output). """Handler class that watches for incoming mails""" import ctypes # for the WM_QUIT to stop PumpMessage() import logging import win32com.client import sys import threading import time import pythoncom # outlook config CENTRAL

Reading and writing Windows “tags” with Python 3

时间秒杀一切 提交于 2021-02-08 07:37:26
问题 In Windows image files can be tagged. These tags can be viewed and edited by right clicking on a file, clicking over to the Details tab, then clicking on the Tags property value cell. I want to be able to read and write these tags using Python 3. This is not EXIF data so EXIF solutions won't work. I believe it's part of the Windows Property System, but I can't find a reference in Dev Center. I looked into win32com.propsys and couldn't see anything in there either. I wrote a program that does

Registration free COM: VB6 Executable referencing VB6 DLL

时光总嘲笑我的痴心妄想 提交于 2021-02-07 20:52:25
问题 So, I've got a single VB6 executable that references multiple VB6 COM DLLs. Is it possible for me to generate, on-the-fly, a manifest for the executable as well as a manifest for each of the referenced DLLs? If so, then how? I would like to perform this operation as part of our build process without having to register the COM DLLs as part of the process. NOTE: All the reg-free COM examples that I've found so far involve .NET interop, which is not a requirement for what I'm doing. [EDIT] After

Registration free COM: VB6 Executable referencing VB6 DLL

二次信任 提交于 2021-02-07 20:48:47
问题 So, I've got a single VB6 executable that references multiple VB6 COM DLLs. Is it possible for me to generate, on-the-fly, a manifest for the executable as well as a manifest for each of the referenced DLLs? If so, then how? I would like to perform this operation as part of our build process without having to register the COM DLLs as part of the process. NOTE: All the reg-free COM examples that I've found so far involve .NET interop, which is not a requirement for what I'm doing. [EDIT] After