×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to implement the WMI WIN32 calls

How to implement the WMI WIN32 calls

How to implement the WMI WIN32 calls

(OP)
Hi all,

I use VBS (Visual Basic Script) to automate some tasks. However, sometimes I miss some nice and handy features in VBS.

As well I use Borland C++. Now I will try to use borland to perform these tasks. Do somebody know were I can find some simple examples how to implement the WMI Win32 calls with borland C++.

Thanks in advance,

Johan  

RE: How to implement the WMI WIN32 calls

(OP)
Thanks for the information.

Hi Glenn,

I used the code that was posted on the: Get System information from WMI FAQ102-7315: Get System information from WMI

I have just a question:

The function below generates the following error code:

CODE

function WMIRowFindFirst(ObjectSet: ISWbemObjectSet; var ENum: IEnumVariant; var tempobj: OleVariant): boolean;
// finds the first row in a result set.
  var
    Value: Longint;
  begin
    Enum :=  (ObjectSet._NewEnum) as IEnumVariant;
    Result := (ENum.Next(1, tempObj, @Value) = 0);
  end;

The following line generates this error:

Result := (ENum.Next(1, tempObj, @Value) = 0);

[DCC Error] wmiserv.pas(75): E2033 Types of actual and formal var parameters must be identical

I found this message back on the internet, however I still can't solve it.

Can anyone give me a hint how to solve this.

Thanks in advance,

Johan

 

RE: How to implement the WMI WIN32 calls

If you must work on Windows Vista or later, can I suggest you to learn PowerShell?
Is easy to use and you can write programs with wmi very quickly.

NOTE: For Windows XP you can also install PowerShell package   

RE: How to implement the WMI WIN32 calls

(OP)
It is working now,

I changed:

var
    Value: Longint;

To

var
    Value: Cardinal;

Thanks,

Johan

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close