Qvae Posted September 15, 2008 Share Posted September 15, 2008 How do I translate queryinterface to work with autoit. I can generally convert some vb stuff, but everything I find on QueryInterface is C# and I can't figure out how to utilize it with autoit. This is one of my many combinations and attempts that is not working: $Player = ObjCreate("wmplayer.ocx") Global $ReturnPointer $cdRom = $Player.cdromCollection.getByDriveSpecifier("E:") $Player.QueryInterface($cdRom, $ReturnPointer) Link to comment Share on other sites More sharing options...
Qvae Posted September 17, 2008 Author Share Posted September 17, 2008 Bump Link to comment Share on other sites More sharing options...
DaleHohm Posted September 17, 2008 Share Posted September 17, 2008 Perhaps, but just a SWAG: $ReturnPointer = $Player.QueryInterface($cdRom) To get good help you need to include more information. Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
ptrex Posted September 18, 2008 Share Posted September 18, 2008 @allMy guess is that QueryInterface is out of reach for AU3.We are one step higher on ther ladder.Hope this helps.QueryInterfaceRegards,ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
Qvae Posted September 22, 2008 Author Share Posted September 22, 2008 @DaleHohm, that doesn't work. Sorry about the lack of info, I just thought QueryInterface was standard in C# so it would be easy to understand my needs. I'm trying to rip and burn through wmp and it requires queryinterface.http://msdn.microsoft.com/en-us/library/bb262854(VS.85).aspxhttp://msdn.microsoft.com/en-us/library/bb262856(VS.85).aspxBut odly enough, I can't find those interfaces or methods using the OLE viewer, so I don't understand where they are in the first place.Anyway, I was reading a few VB sites and it seems that C# is the one that needs to use queryinterface and VB doesn't because it is done automatically, correct me if I'm wrong, but does autoit MORE follow VB than C#? Or probobly ptrex is right. Link to comment Share on other sites More sharing options...
DaleHohm Posted September 22, 2008 Share Posted September 22, 2008 AutoIt uses the IDispatch interface for automation. If a component doesn't use this interface, AutoIt COM cannot see it. Please see the COM Reference section in the AutoIt helpfile for more info on this alond with a description of using the OLE Viewer. I cannot comment about your specific scenario for queryInterface regarding C# and VB. In general, what you can do with VBScript COM you can do in AutoIt COM and VBScript is obviously more VB-like than it is C#-like. Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
MilesAhead Posted September 22, 2008 Share Posted September 22, 2008 @DaleHohm, that doesn't work. Sorry about the lack of info, I just thought QueryInterface was standard in C# so it would be easy to understand my needs. I'm trying to rip and burn through wmp and it requires queryinterface.http://msdn.microsoft.com/en-us/library/bb262854(VS.85).aspxhttp://msdn.microsoft.com/en-us/library/bb262856(VS.85).aspxBut odly enough, I can't find those interfaces or methods using the OLE viewer, so I don't understand where they are in the first place.Anyway, I was reading a few VB sites and it seems that C# is the one that needs to use queryinterface and VB doesn't because it is done automatically, correct me if I'm wrong, but does autoit MORE follow VB than C#? Or probobly ptrex is right.If it's a standard .ocx then it's an ActiveX Control. Meaning it should be dual interfaced. IOW, it has bothIUnknown with a Virtual Method Table and IDispatch, that scripting languages use to get at methods by name. So if you access the object through IDispatch you should be able to see the methods by name.I don't know why they wouldn't make the function accessible through both interfaces. Perhaps you need to declare a different kind of object. Sometimes a COM object is just a section of a larger COM object that encompasses it. See if you can find any example of accessing the function through a scripting language or post on an MSDN or COM oriented forum or newsgroup. There was a news server calledmsnews on usenet where you could post programming questions. Lots of stuff on COM and Windows Shell that you would be hard pressed to find out anywhere else. I haven't been on it in some time though. Should be open to public access for free. My Freeware Page Link to comment Share on other sites More sharing options...
MilesAhead Posted September 22, 2008 Share Posted September 22, 2008 @DaleHohm, that doesn't work. Sorry about the lack of info, I just thought QueryInterface was standard in C# so it would be easy to understand my needs. I'm trying to rip and burn through wmp and it requires queryinterface.http://msdn.microsoft.com/en-us/library/bb262854(VS.85).aspxhttp://msdn.microsoft.com/en-us/library/bb262856(VS.85).aspxBut odly enough, I can't find those interfaces or methods using the OLE viewer, so I don't understand where they are in the first place.Anyway, I was reading a few VB sites and it seems that C# is the one that needs to use queryinterface and VB doesn't because it is done automatically, correct me if I'm wrong, but does autoit MORE follow VB than C#? Or probobly ptrex is right.If it's a standard .ocx then it's an ActiveX Control. Meaning it should be dual interfaced. IOW, it has bothIUnknown with a Virtual Method Table and IDispatch, that scripting languages use to get at methods by name. So if you access the object through IDispatch you should be able to see the methods by name.I don't know why they wouldn't make the function accessible through both interfaces. Perhaps you need to declare a different kind of object. Sometimes a COM object is just a section of a larger COM object that encompasses it. See if you can find any example of accessing the function through a scripting language or post on an MSDN or COM oriented forum or newsgroup. There was a news server calledmsnews on usenet where you could post programming questions. Lots of stuff on COM and Windows Shell that you would be hard pressed to find out anywhere else. I haven't been on it in some time though. Should be open to public access for free. My Freeware Page Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now