Jump to content

QueryInterface of object from msdn


Qvae
 Share

Recommended Posts

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

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

@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).aspx

http://msdn.microsoft.com/en-us/library/bb262856(VS.85).aspx

But 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

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

@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).aspx

http://msdn.microsoft.com/en-us/library/bb262856(VS.85).aspx

But 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 both

IUnknown 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 called

msnews 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.

Link to comment
Share on other sites

@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).aspx

http://msdn.microsoft.com/en-us/library/bb262856(VS.85).aspx

But 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 both

IUnknown 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 called

msnews 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.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...