com-interface

What is the difference between IDispatch and IUnkown in COM? [closed]

纵饮孤独 提交于 2020-05-14 13:54:46
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 years ago . I have read and saw example for COM , but I couldn't clearly get there Interface difference. 回答1: IUnknown is the primal COM interface. It provides the basic ability to "cast" a instance of a COM object to any of it's supported interfaces (QueryInterface). IDispatch builds on IUnknown adding the

What is the difference between IDispatch and IUnkown in COM? [closed]

混江龙づ霸主 提交于 2020-05-14 13:54:01
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 years ago . I have read and saw example for COM , but I couldn't clearly get there Interface difference. 回答1: IUnknown is the primal COM interface. It provides the basic ability to "cast" a instance of a COM object to any of it's supported interfaces (QueryInterface). IDispatch builds on IUnknown adding the

Is there a way to tell whether two COM interface references point at the same instance?

断了今生、忘了曾经 提交于 2019-12-11 00:48:04
问题 Given two interface references obtained from different sources. Is there a programmatic way to tell whether they're implemented by the same instance? A simple equality check of the interface references always fails. EDIT: Large parts of the original question, which turned out to be an independent problem have now been moved to a new question. 回答1: You could query for the IUnknown interface and compare these pointers. All other interface pointers are not guaranteed to return the same value

Create COM object in Qt

夙愿已清 提交于 2019-12-08 05:13:51
问题 I try to create a COM object and get the interface from the object in Qt. So Qt works as the COM client. In my example the COM server is the CANoe COM server. Here is my source code of the Qt pro file and my interface.cpp file where I try to establish the connection to CANoe: pro file: # Add more folders to ship with the application, here folder_01.source = qml/3com_interface folder_01.target = qml DEPLOYMENTFOLDERS = folder_01 # Additional import path used to resolve QML modules in Creator's

Python: Open Excel Workbook using Win32 COM Api

风流意气都作罢 提交于 2019-11-27 20:56:06
I'm using the following code to open and display a workbook within Excel: import win32com.client as win32 excel = win32.gencache.EnsureDispatch('Excel.Application') wb = excel.Workbooks.Open('my_sheet.xlsm') ws = wb.Worksheets('blaaaa') excel.Visible = True When the File 'my_sheet.xlsm' is already opened, Excel asks me whether I want to re-open it without saving. How could I check in advance whether the workbook is already opened up and in case it is, just bring it to the front? EDIT : Found out by now: if excel.Workbooks.Count > 0: for i in range(1, excel.Workbooks.Count+1): if excel

What is the best way to access a serial port from VBA?

亡梦爱人 提交于 2019-11-27 12:56:39
What is the best way to access a serial port from VBA? I have a need for some of our sales reps to be able to send a simple string over the serial port from an action button in PowerPoint. I don't commonly use VBA, especially for anything like this. Normally I would turn it into an application of some sort, but I actually don't think the idea is that bad. It will be a handy tool for them to demo this device with while on a projector and talking to other sales guys and non technical people. Also, this sales guy will have no problem making small modifications to the VBA or PowerPoint

Python: Open Excel Workbook using Win32 COM Api

不想你离开。 提交于 2019-11-26 20:22:59
问题 I'm using the following code to open and display a workbook within Excel: import win32com.client as win32 excel = win32.gencache.EnsureDispatch('Excel.Application') wb = excel.Workbooks.Open('my_sheet.xlsm') ws = wb.Worksheets('blaaaa') excel.Visible = True When the File 'my_sheet.xlsm' is already opened, Excel asks me whether I want to re-open it without saving. How could I check in advance whether the workbook is already opened up and in case it is, just bring it to the front? EDIT : Found

What is the best way to access a serial port from VBA?

淺唱寂寞╮ 提交于 2019-11-26 16:09:50
问题 What is the best way to access a serial port from VBA? I have a need for some of our sales reps to be able to send a simple string over the serial port from an action button in PowerPoint. I don't commonly use VBA, especially for anything like this. Normally I would turn it into an application of some sort, but I actually don't think the idea is that bad. It will be a handy tool for them to demo this device with while on a projector and talking to other sales guys and non technical people.