mIRC Home    About    Download    Register    News    Help

Print Thread
Using COM Objects #195042 16/02/08 05:59 AM
Joined: Aug 2007
Posts: 13
I
iStink Offline OP
Pikka bird
OP Offline
Pikka bird
I
Joined: Aug 2007
Posts: 13
I was wondering, if anyone could teach me how to do it, or if I could find somewhere to read, besides google, because I have looked all over google :P All I get is the definition of com, and I'm unable to find a forum in which I can read step by step instructions on how to make one, or how to access what I'm trying to get. But what I really need is a document of some kind, that I can read and understand the science of how it works. That's the only real way I can learn anything. Or if you could show me examples, or dynamic code; that might work smile Like you could give me some files and some scripts that I could use on my computer so that I can look at the code and see what it does, how it does it, and why it does what it does and possibly what it transfers or how it talks to other programs/files.

Well, I think I have said enough, haven't I? I would appreciate anyone who helps me with this matter, as I am trying to help out the mIRC community by donating smile but I can't really get my business out there till I can settle this problem I'm having with com objects.

Re: Using COM Objects [Re: iStink] #195048 16/02/08 11:15 AM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
For the actual COM items you can use and what data you can get from them, a good site is: http://msdn2.microsoft.com/en-us/library/aa394373.aspx

Beyond that, any script using COM can be adjusted to use pretty much any of the objects shown on the site.

Here's an example to get your video card information.

Code:
displaysystem {
  ; Use Caption,AdapterRAM
  .comopen xpver1 WbemScripting.SWbemLocator
  .comclose xpver1 $com(xpver1,ConnectServer,1,dispatch* xpver2)
  if $com(xpver2) {
    .comclose xpver2 $com(xpver2,ExecQuery,1,bstr*,select $1 from Win32_VideoController,dispatch* xpver3)
    if $com(xpver3) {
      var %a = $comval(xpver3,1,$1)
      .comclose xpver3
      return %a
    }
  }
}


Use:
$displaysystem(caption)
$displaysystem(adapterram)

As a note, this was actually from another COM script shown to me for OS output, but was adjusted for showing the video card information. I didn't bother changing the names used when opening the COM, but you can if you want to make it more clear what's going on.


Invision Support
#Invision on irc.irchighway.net
Re: Using COM Objects [Re: iStink] #195049 16/02/08 12:07 PM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138

Re: Using COM Objects [Re: iStink] #195051 16/02/08 12:43 PM
Joined: Apr 2004
Posts: 759
M
Mpdreamz Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
I recommend getting your hands on OLEVIEW.exe which allows you to inspect COM Objects, its method's properties and collections, it states the methods arguements of what type they should be and what they return and wheter its a propput or propget so all in all an excellent lifeline when checking out an Object!


$maybe