473,466 Members | 1,363 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Adding an "Interface" from IDL / tlb files to an existing win32COM-Object

2 New Member
Hallo,
I need helping adding an existing Interface to an object I dispatched from a COM-server via win32com in Python.

The Code for this in VisualBasic looks like that:
Expand|Select|Wrap|Line Numbers
  1. Private Obj_1 As Obj1_LIB.Impl_1
  2. Private mHelper As Object
  3. Private m_applJob As Object
  4. Private m_applModul As interface_Module //interface_Module is described in an IDL/TLB-File
  5. Private cont As Boolean
  6. Private c_applJob As New ApplicationJob.Job
  7.  
  8.  Set m_Obj_1 = CreateObject("Obj1_LIB.Impl_1")
  9. m_Obj_1.Init
  10.  
  11.  Set mHelper = CreateObject("ModulHelper.Helper")
  12. Set m_applJob = CreateObject("ApplicationJob.Job")
  13.     Set m_applModul = m_applJob
  14.  
  15.     m_applModul.method1_from_appl_module
  16.     m_applModul.method2_from_appl_module
These methods (method1/_from_appl_module) are part of the interface loaded from interface_module and not part of the m_applJob-Object. Nevertheless, m_applModul now also supports all methods from the m_applJob-Object.

So how can I do this in Python?
I tried this, which didn't work:
Expand|Select|Wrap|Line Numbers
  1. import win32com.client
  2. Obj_1 = win32com.client.Dispatch("Obj1_LIB.Impl_1")
  3. Obj_1.Init()
  4.  
  5. ModulHelp = win32com.client.Dispatch("ModulHelper.Helper")
  6. applJob = win32com.client.Dispatch("ApplicationJob.Job")
  7.  
  8. applJob._oleobj_.QueryInterface("{7DE9DB29-1794-4C3B-95EA-E1324B15BBE6}")  ##using the uuid of the interface described in the IDL
  9.  
This says "interface not supported"

I'd appreciate your help in this!
Feb 23 '07 #1
2 3569
bartonc
6,596 Recognized Expert Expert
Hallo,
I need helping adding an existing Interface to an object I dispatched from a COM-server via win32com in Python.

The Code for this in VisualBasic looks like that:
Expand|Select|Wrap|Line Numbers
  1. Private Obj_1 As Obj1_LIB.Impl_1
  2. Private mHelper As Object
  3. Private m_applJob As Object
  4. Private m_applModul As interface_Module //interface_Module is described in an IDL/TLB-File
  5. Private cont As Boolean
  6. Private c_applJob As New ApplicationJob.Job
  7.  
  8.  Set m_Obj_1 = CreateObject("Obj1_LIB.Impl_1")
  9. m_Obj_1.Init
  10.  
  11.  Set mHelper = CreateObject("ModulHelper.Helper")
  12. Set m_applJob = CreateObject("ApplicationJob.Job")
  13.     Set m_applModul = m_applJob
  14.  
  15.     m_applModul.method1_from_appl_module
  16.     m_applModul.method2_from_appl_module
These methods (method1/_from_appl_module) are part of the interface loaded from interface_module and not part of the m_applJob-Object. Nevertheless, m_applModul now also supports all methods from the m_applJob-Object.

So how can I do this in Python?
I tried this, which didn't work:
Expand|Select|Wrap|Line Numbers
  1. import win32com.client
  2. Obj_1 = win32com.client.Dispatch("Obj1_LIB.Impl_1")
  3. Obj_1.Init()
  4.  
  5. ModulHelp = win32com.client.Dispatch("ModulHelper.Helper")
  6. applJob = win32com.client.Dispatch("ApplicationJob.Job")
  7.  
  8. applJob._oleobj_.QueryInterface("{7DE9DB29-1794-4C3B-95EA-E1324B15BBE6}")  ##using the uuid of the interface described in the IDL
  9.  
This says "interface not supported"

I'd appreciate your help in this!
It would help if you paste the whole error message. Sometimes, even if a pythoneer dosn't know a particular package, they can deduce what's wrong from the error message. Thanks.
Feb 26 '07 #2
VolkerS
2 New Member
The error message I get is:

Traceback (most recent call last):
File "C:\PROGRA~1\python\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py" , line 310, in RunScript
exec codeObject in __main__.__dict__
File "M:\Diagnose\Projekt EE61\ApplJob4test.py", line 655, in ?
m_applJob=applJob._oleobj_.QueryInterface("{7DE9DB 29-1794-4C3B-95EA-E1324B15BBE6}")
com_error: (-2147467262, 'Schnittstelle nicht unterst\xfctzt', None, None)

in fact it also happens (sometimes, without changing the code) that I get this message:

Traceback (most recent call last):
File "C:\PROGRA~1\python\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py" , line 310, in RunScript
exec codeObject in __main__.__dict__
File "M:\Diagnose\Projekt EE61\ApplJob4test.py", line 655, in ?
m_applJob=applJob._oleobj_.QueryInterface("{7DE9DB 29-1794-4C3B-95EA-E1324B15BBE6}")
TypeError: There is no interface object registered that supports this IID
Feb 26 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: BoonHead, The Lost Philosopher | last post by:
Does anyone know how to implement internal interface documentation for functions and parameters? I found a similair thing for proerties. For properties I found something like:...
0
by: Rex | last post by:
Hello... I have a C# app, and am trying to save a web page as a .mht file using CreateMHTMLBody. It was working a while back, but now I am getting "interface not registered" errors when calling...
2
by: seesaw | last post by:
When define an interface of all pure virtual functions, will the destructor of it will automatically virtual, or it has to be declared as virtual? Should it be declared as "virtual" when defining...
3
by: Markus Dehmann | last post by:
I have a two different value types with which I want to do similar things: store them in the same vector, stack, etc. Also, I want an << operator for each of them. class Value{}; // this would...
2
by: PatrickSA | last post by:
Hi, Am new to web services, so apologies for the basic nature of the question - and apologies in advance if this is the wrong newsgroup. We're building a new web service and I'm looking around...
0
by: Dundealing | last post by:
I am trying to deploy an application but when I build it in Release mode, I get the message: "Could not find file '<pathname>\appname.exe' Interface not registered". It works fine in Debug...
0
by: Kivak Wolf | last post by:
Hey, Not sure how to explain this. But I created a SQL server database file called "testingData.mdf" using VS2005 and I connected to it. After I create it, I can modify it, connect things to it...
0
by: epoxyparser | last post by:
Hi all, I work as a glue coder and often have to interface existing mechanisms with other platforms. Creating bridge code between command-line functionality and desktop GUIs takes up a lot of that...
4
by: ~~~ .NET Ed ~~~ | last post by:
I am facing a problem. My project is composed of several assemblies. In one of them -the backend- I have several internal classes that must implement an interface. These internal classes are only...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.