Markus: The beauty of using the early binding file is that you don't have to use all that Dispatch syntax because the file does that for you. I don't know what you named this file, but let's say you call it "PyMemtool.py". Now your code just looks like this: import PyMemtool fm = PyMemtool.SMTMemtool() fs = fm.GetFlashModByName("MyFM") That should be all you have to do, but looking at your file I think you'll also have to add an explicit type cast to the class you want: fs = PyMemtool.DISMTFlashMod (fs) The other objects you mention should work just like SMTMemtool, because you don't need to "Get" them from another object: sp = PyMemtool.SMTSerPort() ti = PyMemtool.SMTTargInfo() tf = PyMemtool.SMTTargIntf() - Greg Antal Gregory W. Antal Senior Technical Advisor ATA Engineering, Inc. 11995 El Camino Real, Suite 200 San Diego, CA 92130 www.ata-e.com greg.an...@ata-e.com 858-480-2072 (Phone) 858-792-8932 (Fax) Tim Roberts wrote, On 4/9/2010 10:26 AM: Markus Hubig wrote:i'm trying to use Infinion's Memtool via it's COM interface in my python program. I've created an early binding file <http://pastie.org/911543> with the makepy utility and now I try to figure out how I can use it ... I got five classes which I can use to get access to all the features of Memtool. -----------------8<---schnipp------------------------ from win32com.client import CoClassBaseClass class SMTFlashMod(CoClassBaseClass): # A CoClass # This CoClass is known by the name 'SMT.Memtool.1' class SMTMemtool(CoClassBaseClass): # A CoClass # This CoClass is known by the name 'SMT.SerPort.1' class SMTSerPort(CoClassBaseClass): # A CoClass # This CoClass is known by the name 'SMT.TargInfo.1' class SMTTargInfo(CoClassBaseClass): # A CoClass # This CoClass is known by the name 'SMT.TargIntf.1' class SMTTargIntf(CoClassBaseClass): # A CoClass -----------------8<---schnapp------------------------ and exept the first class "SMTFlashMod" all classes have a comment telling me there "COM" name, so I can make an instance like that:fm = win32com.client.Dispatch("SMT.Memtool.1") sp = win32com.client.Dispatch("SMT.SerPort.1") ti = win32com.client.Dispatch("SMT.TargInfo.1") tf = win32com.client.Dispatch("SMT.TargIntf.1")But How can make a instance on the SMTFlashMod Class?I would be very disappointed in your pattern recognition and deductive skills if you have not already tried "SMT.FlashMod.1". |
_______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32