<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.ciuly.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
	<title>Comments for Ciuly's Blog - Reinventing the wheel</title>
	
	<link>http://blog.ciuly.com</link>
	<description>basically, the news regarding my online activity</description>
	<lastBuildDate>Fri, 16 Jul 2010 20:25:13 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
	<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.ciuly.com/CommentsForCiulysBlog-ReinventingTheWheel" /><feedburner:info uri="commentsforciulysblog-reinventingthewheel" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Comment on Using SWbemRefresher in delphi by ciuly</title>
		<link>http://feeds.ciuly.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~3/d-557sTZ8w0/</link>
		<dc:creator>ciuly</dc:creator>
		<pubDate>Fri, 16 Jul 2010 20:25:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ciuly.com/?p=563#comment-400</guid>
		<description>you'll need to check your uses clause and declarations. objServicesCimv2 is of type variant in my code so definitely not HGDIOBJ and GetObject returns IInterface not string.
OR, GetObject gets a string parameter and not a HGDIOBJ.

So, in order to track it down, do the following:
- put editor cursor after "GetObject(" (with the bracket) and before &lt; &lt;'winmgmts&gt;&gt; and press ctrl+space. this will show you the parameter(s) expected by GetObject function. You should see there "Value: String". If that is not the case, then your problem is that you did not use the GetObject function provided in the article.
If you did, then objServicesCimv2 is not declared as variant but something else, but in this case you should get an error like 'Incompatible types: 'HGDIOBJ' and 'IIUnknown'

My bet is that you are using a different GetObject function than the one in the article.</description>
		<content:encoded><![CDATA[<p>you&#8217;ll need to check your uses clause and declarations. objServicesCimv2 is of type variant in my code so definitely not HGDIOBJ and GetObject returns IInterface not string.<br />
OR, GetObject gets a string parameter and not a HGDIOBJ.</p>
<p>So, in order to track it down, do the following:<br />
- put editor cursor after &#8220;GetObject(&#8221; (with the bracket) and before < <'winmgmts>> and press ctrl+space. this will show you the parameter(s) expected by GetObject function. You should see there &#8220;Value: String&#8221;. If that is not the case, then your problem is that you did not use the GetObject function provided in the article.<br />
If you did, then objServicesCimv2 is not declared as variant but something else, but in this case you should get an error like &#8216;Incompatible types: &#8216;HGDIOBJ&#8217; and &#8216;IIUnknown&#8217;</p>
<p>My bet is that you are using a different GetObject function than the one in the article.</p>
<img src="http://feeds.feedburner.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~4/d-557sTZ8w0" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.ciuly.com/programming/delphi/using-swbemrefresher-in-delphi/comment-page-1/#comment-400</feedburner:origLink></item>
	<item>
		<title>Comment on Using SWbemRefresher in delphi by Xiao Guang</title>
		<link>http://feeds.ciuly.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~3/x5H46ymytM0/</link>
		<dc:creator>Xiao Guang</dc:creator>
		<pubDate>Fri, 16 Jul 2010 15:30:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ciuly.com/?p=563#comment-397</guid>
		<description>objServicesCimv2 := GetObject('winmgmts:root\cimv2');

[DCC Error]Unmain.pas(87):E2010 Incompatible types:'HGDIOBJ' and 'string'</description>
		<content:encoded><![CDATA[<p>objServicesCimv2 := GetObject(&#8216;winmgmts:root\cimv2&#8242;);</p>
<p>[DCC Error]Unmain.pas(87):E2010 Incompatible types:&#8217;HGDIOBJ&#8217; and &#8216;string&#8217;</p>
<img src="http://feeds.feedburner.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~4/x5H46ymytM0" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.ciuly.com/programming/delphi/using-swbemrefresher-in-delphi/comment-page-1/#comment-397</feedburner:origLink></item>
	<item>
		<title>Comment on VMWare: Cannot find a valid peer process to connect to by schollii</title>
		<link>http://feeds.ciuly.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~3/oaGDwgvcoFE/</link>
		<dc:creator>schollii</dc:creator>
		<pubDate>Thu, 03 Jun 2010 16:30:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ciuly.com/?p=252#comment-212</guid>
		<description>I had similar problem: my VM was in a suspended state; started VMWare Player; got the same error message as you. I deleted the .vmss file, which stores the machine memory state (it's like a power cut to a physical machine), and that fixed the problem. I read that .vmem stores the paging file (ie memory that was on disk at suspend time) but I didn't have to touch that one.</description>
		<content:encoded><![CDATA[<p>I had similar problem: my VM was in a suspended state; started VMWare Player; got the same error message as you. I deleted the .vmss file, which stores the machine memory state (it&#8217;s like a power cut to a physical machine), and that fixed the problem. I read that .vmem stores the paging file (ie memory that was on disk at suspend time) but I didn&#8217;t have to touch that one.</p>
<img src="http://feeds.feedburner.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~4/oaGDwgvcoFE" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.ciuly.com/general/news-blog/vmware-cannot-find-a-valid-peer-process-to-connect-to/comment-page-1/#comment-212</feedburner:origLink></item>
	<item>
		<title>Comment on How to "permanently" delete System Volume Informat by ciuly</title>
		<link>http://feeds.ciuly.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~3/fkoLtO2kMRo/</link>
		<dc:creator>ciuly</dc:creator>
		<pubDate>Sun, 28 Mar 2010 19:07:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ciuly.com/?p=228#comment-121</guid>
		<description>I cannot offer support/help for things I do not support (like how to properly configure windows). There are dedicated forums for such questions. I only support my products and problems related to them and what you describe is not a problem related to my product nor one that can be solved by my product but, as I already explained, it's a problem of misconfiguration. Or, maybe, you are expecting too much from your system. If you want to have system restore, then you must deal with the fact that it eats up space. Sure, you can configure the maximum amount of space, but still, you can't have it SVI directory removed.</description>
		<content:encoded><![CDATA[<p>I cannot offer support/help for things I do not support (like how to properly configure windows). There are dedicated forums for such questions. I only support my products and problems related to them and what you describe is not a problem related to my product nor one that can be solved by my product but, as I already explained, it&#8217;s a problem of misconfiguration. Or, maybe, you are expecting too much from your system. If you want to have system restore, then you must deal with the fact that it eats up space. Sure, you can configure the maximum amount of space, but still, you can&#8217;t have it SVI directory removed.</p>
<img src="http://feeds.feedburner.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~4/fkoLtO2kMRo" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.ciuly.com/general/news-blog/how-to-quot-permanently-quot-delete-system-volume-informat/comment-page-1/#comment-121</feedburner:origLink></item>
	<item>
		<title>Comment on How to "permanently" delete System Volume Informat by ciuly</title>
		<link>http://feeds.ciuly.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~3/xmthpSkyqFI/</link>
		<dc:creator>ciuly</dc:creator>
		<pubDate>Sun, 28 Mar 2010 19:04:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ciuly.com/?p=228#comment-120</guid>
		<description>this program will work on any hdd as long as it is connected as a USB drive or as any other removable storage.</description>
		<content:encoded><![CDATA[<p>this program will work on any hdd as long as it is connected as a USB drive or as any other removable storage.</p>
<img src="http://feeds.feedburner.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~4/xmthpSkyqFI" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.ciuly.com/general/news-blog/how-to-quot-permanently-quot-delete-system-volume-informat/comment-page-1/#comment-120</feedburner:origLink></item>
	<item>
		<title>Comment on How to "permanently" delete System Volume Informat by guest</title>
		<link>http://feeds.ciuly.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~3/PchCmHCvVWg/</link>
		<dc:creator>guest</dc:creator>
		<pubDate>Sun, 28 Mar 2010 18:20:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ciuly.com/?p=228#comment-119</guid>
		<description>I'm not good in this. i found forum... where " add " link for this website.. so i could ask for help but it seem so that it will be hell of a problem for me ;/ to deal with</description>
		<content:encoded><![CDATA[<p>I&#8217;m not good in this. i found forum&#8230; where &#8221; add &#8221; link for this website.. so i could ask for help but it seem so that it will be hell of a problem for me ;/ to deal with</p>
<img src="http://feeds.feedburner.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~4/PchCmHCvVWg" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.ciuly.com/general/news-blog/how-to-quot-permanently-quot-delete-system-volume-informat/comment-page-1/#comment-119</feedburner:origLink></item>
	<item>
		<title>Comment on How to "permanently" delete System Volume Informat by guest</title>
		<link>http://feeds.ciuly.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~3/k1RThGZ9TyI/</link>
		<dc:creator>guest</dc:creator>
		<pubDate>Sun, 28 Mar 2010 18:17:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ciuly.com/?p=228#comment-118</guid>
		<description>So basicly thus program won't work on HDD? on pc?</description>
		<content:encoded><![CDATA[<p>So basicly thus program won&#8217;t work on HDD? on pc?</p>
<img src="http://feeds.feedburner.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~4/k1RThGZ9TyI" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.ciuly.com/general/news-blog/how-to-quot-permanently-quot-delete-system-volume-informat/comment-page-1/#comment-118</feedburner:origLink></item>
	<item>
		<title>Comment on libapu: apu library not found. by high</title>
		<link>http://feeds.ciuly.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~3/FIwgEbWetPk/</link>
		<dc:creator>high</dc:creator>
		<pubDate>Sat, 27 Mar 2010 19:03:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ciuly.com/?p=515#comment-117</guid>
		<description>Thanks a lot :D</description>
		<content:encoded><![CDATA[<p>Thanks a lot <img src='http://blog.ciuly.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~4/FIwgEbWetPk" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.ciuly.com/my-server/libapu-apu-library-not-found/comment-page-1/#comment-117</feedburner:origLink></item>
	<item>
		<title>Comment on How to "permanently" delete System Volume Informat by ciuly</title>
		<link>http://feeds.ciuly.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~3/gGrlHPhtSYg/</link>
		<dc:creator>ciuly</dc:creator>
		<pubDate>Sat, 27 Mar 2010 18:53:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ciuly.com/?p=228#comment-116</guid>
		<description>well, first of all you need to disable the services that use it. Those are at least the search index service and the one that actually eats up your hdd space: System Restore. If you don't know how to disable this, search on google or ask in a forum that supports vista/ windows 7. I have neither.

KEEP IN MIND that that folder is needed by the system for some other stuff as well. so DO NOT delete it from your system drive. As noted, you can disable some of the services that use it and thus save space, but overall, only remove it from data-only partitions/drives. That is the reason my service application only removes from USB drives and not from the actual hdds in the system.</description>
		<content:encoded><![CDATA[<p>well, first of all you need to disable the services that use it. Those are at least the search index service and the one that actually eats up your hdd space: System Restore. If you don&#8217;t know how to disable this, search on google or ask in a forum that supports vista/ windows 7. I have neither.</p>
<p>KEEP IN MIND that that folder is needed by the system for some other stuff as well. so DO NOT delete it from your system drive. As noted, you can disable some of the services that use it and thus save space, but overall, only remove it from data-only partitions/drives. That is the reason my service application only removes from USB drives and not from the actual hdds in the system.</p>
<img src="http://feeds.feedburner.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~4/gGrlHPhtSYg" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.ciuly.com/general/news-blog/how-to-quot-permanently-quot-delete-system-volume-informat/comment-page-1/#comment-116</feedburner:origLink></item>
	<item>
		<title>Comment on How to "permanently" delete System Volume Informat by guest</title>
		<link>http://feeds.ciuly.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~3/DuGQdU9yyas/</link>
		<dc:creator>guest</dc:creator>
		<pubDate>Sat, 27 Mar 2010 17:35:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ciuly.com/?p=228#comment-115</guid>
		<description>my problem is on Windows 7 x86 Ultimate I'm w8 for reply.</description>
		<content:encoded><![CDATA[<p>my problem is on Windows 7 x86 Ultimate I&#8217;m w8 for reply.</p>
<img src="http://feeds.feedburner.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~4/DuGQdU9yyas" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.ciuly.com/general/news-blog/how-to-quot-permanently-quot-delete-system-volume-informat/comment-page-1/#comment-115</feedburner:origLink></item>
	<item>
		<title>Comment on How to "permanently" delete System Volume Informat by guest</title>
		<link>http://feeds.ciuly.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~3/e5Zq67Ta3rI/</link>
		<dc:creator>guest</dc:creator>
		<pubDate>Sat, 27 Mar 2010 17:29:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ciuly.com/?p=228#comment-114</guid>
		<description>then how should i remove it this thing took my 148 GB from my D driver.. and sill want's to take more.. max space on D Driver is 467 GB.</description>
		<content:encoded><![CDATA[<p>then how should i remove it this thing took my 148 GB from my D driver.. and sill want&#8217;s to take more.. max space on D Driver is 467 GB.</p>
<img src="http://feeds.feedburner.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~4/e5Zq67Ta3rI" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.ciuly.com/general/news-blog/how-to-quot-permanently-quot-delete-system-volume-informat/comment-page-1/#comment-114</feedburner:origLink></item>
	<item>
		<title>Comment on Using SWbemRefresher in delphi by Aurore Effler</title>
		<link>http://feeds.ciuly.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~3/xDdxFagsDWo/</link>
		<dc:creator>Aurore Effler</dc:creator>
		<pubDate>Fri, 05 Mar 2010 07:47:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ciuly.com/?p=563#comment-112</guid>
		<description>I am really impressed with the content of your blog. It is easy to determine that you are fervent about your writing. If I had your writing ability, I know I would be successful. I have bookmarked your site and look forward to more updates.</description>
		<content:encoded><![CDATA[<p>I am really impressed with the content of your blog. It is easy to determine that you are fervent about your writing. If I had your writing ability, I know I would be successful. I have bookmarked your site and look forward to more updates.</p>
<img src="http://feeds.feedburner.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~4/xDdxFagsDWo" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.ciuly.com/programming/delphi/using-swbemrefresher-in-delphi/comment-page-1/#comment-112</feedburner:origLink></item>
	<item>
		<title>Comment on Major upgrades and changes by ciuly</title>
		<link>http://feeds.ciuly.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~3/-QomrQ04uBg/</link>
		<dc:creator>ciuly</dc:creator>
		<pubDate>Thu, 04 Feb 2010 19:56:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ciuly.com/?p=557#comment-108</guid>
		<description>adn , as expeted several things I forgot to do:
- enable the google analytics on the joomla site. stupid. 4 days without analytics. I would have picked that up if teh dashboard would have jumped over the last day of the old server. but instead is tood right there, in 30 january making me think it didn't process info yet.
- I forgot to start spammassassin filter :D. couldn't figure out why all the sudden I started to get a lot of stupid spam I stopped getting a long while ago.

and who knows what else</description>
		<content:encoded><![CDATA[<p>adn , as expeted several things I forgot to do:<br />
- enable the google analytics on the joomla site. stupid. 4 days without analytics. I would have picked that up if teh dashboard would have jumped over the last day of the old server. but instead is tood right there, in 30 january making me think it didn&#8217;t process info yet.<br />
- I forgot to start spammassassin filter <img src='http://blog.ciuly.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . couldn&#8217;t figure out why all the sudden I started to get a lot of stupid spam I stopped getting a long while ago.</p>
<p>and who knows what else</p>
<img src="http://feeds.feedburner.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~4/-QomrQ04uBg" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.ciuly.com/website/major-upgrades-and-changes/comment-page-1/#comment-108</feedburner:origLink></item>
	<item>
		<title>Comment on Using SWbemRefresher in delphi by ciuly</title>
		<link>http://feeds.ciuly.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~3/ajYSzIUD0oc/</link>
		<dc:creator>ciuly</dc:creator>
		<pubDate>Tue, 02 Feb 2010 20:36:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ciuly.com/?p=563#comment-107</guid>
		<description>well, there is really not much to explain. The demo is the exact translation of the MSDN example. what you probably need is to read up on late binding. I wouldn't be able to refer you a good article on the subject so just google for "delphi late binding" (no quotes). the one on delphi.about.com seems ok, but then it really depends on your level of experience if it's too abstract or lacking info.

since I really don't have time to make full-blown demos working out of the box and usable out of the box, here is a modification of the Running Processes WMI example which you can find on my site in the delphi/WMI section. basically, I copy pasted the listbox-population code into the msdn translation.
no type checking is done anywhere (well, only at the variant to interface assignment there should be done a check. after casting to IUnknown, one should test if it supports the ISWbemObjectSet interface or not and act accordingly)
adapting it should be trivial. yeah, another 5 minutes I couldn't spend on it :P
&lt;code&gt;
procedure getprocesslate;
var objServicesCimv2,
    objServicesDefault,
    objRefreshableItem1,
    objRefreshableItem2,
    RefreshableItem,
    objRefresher:OleVariant;
    i, j:integer;
    ObjectSet:  ISWbemObjectSet;
    SObject:    ISWbemObject;
    propSet :   ISWbemPropertySet;
    SProp:      ISWbemProperty;
    propEnum,
    Enum:       IEnumVariant;
    tempObj1,
    tempObj2,
    spropvalue: OleVariant;
    Count,
    Value:      Cardinal;

    sValue:     String;
    tmp:string;
begin
  // Get namespace connections
  objServicesCimv2 := GetObject('winmgmts:root\cimv2');
  objServicesDefault := GetObject('winmgmts:root\default');

  // Create a refresher object
  objRefresher := CreateOleObject('WbemScripting.SWbemRefresher');

  // Add a single object (SWbemObjectEx) to the refresher. The "@"
  // is used because _CIMOMIdentification is a singleton class- only
  // one instance exists. Note that the
  // SWbemRefreshableItem.Object property must
  // be specified or the SWbemRefresher.Refresh call will fail.

  objRefreshableItem1 := objRefresher.Add(objServicesDefault, '__CIMOMIdentification=@').Object;

  // Add an enumerator (SWbemObjectSet object)
  // to the refresher. Note that the
  // SWbemRefreshableItem.ObjectSet property
  // must be specified or the SWbemRefresher.Refresh call will fail.
  objRefreshableItem2 := objRefresher.AddEnum(objServicesCimv2, 'Win32_Process').ObjectSet;

  // Display number of items in refresher and update the data.
  ShowMessage('Number of items in refresher = ' +inttostr( objRefresher.Count));
  objRefresher.Refresh;

  // Iterate through the refresher. SWbemRefreshable
  // Item.IsSet checks for whether the item is an enumerator.
  for j := 1 to objRefresher.Count do
  begin
    RefreshableItem:=objRefresher.Item(j);
    if RefreshableItem.IsSet then
    begin
      ShowMessage('Item with index ' + IntToStr(RefreshableItem.Index) +
          ' is an enumerator containing ' + IntToStr(RefreshableItem.ObjectSet.Count) + ' processes');
      form1.ListBox1.Clear;
      ObjectSet:=ISWbemObjectSet(IUnknown(RefreshableItem.ObjectSet));
      Enum :=  (ObjectSet._NewEnum) as IEnumVariant;
      try
        i:=0;
        while (Enum.Next(1, tempObj1, Value) = S_OK) do
        try
          tmp:='';
          SObject := IUnknown(tempObj1) as SWBemObject;
          try
            propSet := SObject.Properties_;
            propEnum := (propSet._NewEnum) as IEnumVariant;
            try
              while (propEnum.Next(1, tempObj2, Value) = S_OK) do
              try
                SProp := IUnknown(tempObj2) as SWBemProperty;
                if (SProp.Name'Name') and (SProp.Name'ProcessId')
                  and (SProp.Name'ParentProcessId') and (SProp.Name'CreationDate') and (SProp.Name'ExecutablePath') then
                    continue;
                // now get the value of the property
                sValue := '';
                spropvalue:=SProp.Get_Value;
                try
                  if VarIsNull(spropvalue) then
                    sValue := ''
                  else
                    case SProp.CIMType of
                      wbemCimtypeSint8, wbemCimtypeUint8, wbemCimtypeSint16, wbemCimtypeUint16,
                      wbemCimtypeSint32, wbemCimtypeUint32, wbemCimtypeSint64:
                        sValue := IntToStr(spropvalue);
                      wbemCimtypeString, wbemCimtypeUint64:
                        if VarIsArray(spropvalue) then
                        begin
                          if VarArrayHighBound(spropvalue, 1) &gt; 0 then
                            for Count := 1 to VarArrayHighBound(spropvalue, 1) do
                              sValue := sValue + ' ' + spropvalue[Count];
                        end
                        else
                          sValue :=  spropvalue;
                      wbemCimtypeDatetime:sValue:=spropvalue//DateTimeToStr(spropvalue)
                    else
                      Exception.Create('Unknown type');
                    end;
                finally
                  spropvalue:=unassigned;
                end;
                case i of
                  0:tmp:=tmp+' [CreationDate='+sValue+']';
                  1:tmp:=tmp+' [Path='+sValue+']';
                  2:tmp:=sValue+tmp;
                  3:tmp:=tmp+' [Parent PID='+sValue+']';
                  4:tmp:=tmp+' [PID='+sValue+']';
                end;

                i:=(i+1) mod 5;
                if i=0 then
                  form1.ListBox1.items.add(tmp);
              finally
                sProp:=nil;
                tempObj2:=NULL;
              end;
            finally
              propEnum:=nil;
              propSet:=nil;
            end;
          finally
            sObject:=nil;
          end;
        finally
          tempObj2:=NULL;
        end;
      finally
        enum.Reset;
        enum:=nil;
      end;
    end else
      ShowMessage('Item with index ' + IntToStr(RefreshableItem.Index) +
          ' is a single object containing WMI version ' + objRefreshableItem1.VersionCurrentlyRunning);
  end;
end;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>well, there is really not much to explain. The demo is the exact translation of the MSDN example. what you probably need is to read up on late binding. I wouldn&#8217;t be able to refer you a good article on the subject so just google for &#8220;delphi late binding&#8221; (no quotes). the one on delphi.about.com seems ok, but then it really depends on your level of experience if it&#8217;s too abstract or lacking info.</p>
<p>since I really don&#8217;t have time to make full-blown demos working out of the box and usable out of the box, here is a modification of the Running Processes WMI example which you can find on my site in the delphi/WMI section. basically, I copy pasted the listbox-population code into the msdn translation.<br />
no type checking is done anywhere (well, only at the variant to interface assignment there should be done a check. after casting to IUnknown, one should test if it supports the ISWbemObjectSet interface or not and act accordingly)<br />
adapting it should be trivial. yeah, another 5 minutes I couldn&#8217;t spend on it <img src='http://blog.ciuly.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /><br />
<code><br />
procedure getprocesslate;<br />
var objServicesCimv2,<br />
    objServicesDefault,<br />
    objRefreshableItem1,<br />
    objRefreshableItem2,<br />
    RefreshableItem,<br />
    objRefresher:OleVariant;<br />
    i, j:integer;<br />
    ObjectSet:  ISWbemObjectSet;<br />
    SObject:    ISWbemObject;<br />
    propSet :   ISWbemPropertySet;<br />
    SProp:      ISWbemProperty;<br />
    propEnum,<br />
    Enum:       IEnumVariant;<br />
    tempObj1,<br />
    tempObj2,<br />
    spropvalue: OleVariant;<br />
    Count,<br />
    Value:      Cardinal;</p>
<p>    sValue:     String;<br />
    tmp:string;<br />
begin<br />
  // Get namespace connections<br />
  objServicesCimv2 := GetObject('winmgmts:root\cimv2');<br />
  objServicesDefault := GetObject('winmgmts:root\default');</p>
<p>  // Create a refresher object<br />
  objRefresher := CreateOleObject('WbemScripting.SWbemRefresher');</p>
<p>  // Add a single object (SWbemObjectEx) to the refresher. The "@"<br />
  // is used because _CIMOMIdentification is a singleton class- only<br />
  // one instance exists. Note that the<br />
  // SWbemRefreshableItem.Object property must<br />
  // be specified or the SWbemRefresher.Refresh call will fail.</p>
<p>  objRefreshableItem1 := objRefresher.Add(objServicesDefault, '__CIMOMIdentification=@').Object;</p>
<p>  // Add an enumerator (SWbemObjectSet object)<br />
  // to the refresher. Note that the<br />
  // SWbemRefreshableItem.ObjectSet property<br />
  // must be specified or the SWbemRefresher.Refresh call will fail.<br />
  objRefreshableItem2 := objRefresher.AddEnum(objServicesCimv2, 'Win32_Process').ObjectSet;</p>
<p>  // Display number of items in refresher and update the data.<br />
  ShowMessage('Number of items in refresher = ' +inttostr( objRefresher.Count));<br />
  objRefresher.Refresh;</p>
<p>  // Iterate through the refresher. SWbemRefreshable<br />
  // Item.IsSet checks for whether the item is an enumerator.<br />
  for j := 1 to objRefresher.Count do<br />
  begin<br />
    RefreshableItem:=objRefresher.Item(j);<br />
    if RefreshableItem.IsSet then<br />
    begin<br />
      ShowMessage('Item with index ' + IntToStr(RefreshableItem.Index) +<br />
          ' is an enumerator containing ' + IntToStr(RefreshableItem.ObjectSet.Count) + ' processes');<br />
      form1.ListBox1.Clear;<br />
      ObjectSet:=ISWbemObjectSet(IUnknown(RefreshableItem.ObjectSet));<br />
      Enum :=  (ObjectSet._NewEnum) as IEnumVariant;<br />
      try<br />
        i:=0;<br />
        while (Enum.Next(1, tempObj1, Value) = S_OK) do<br />
        try<br />
          tmp:='';<br />
          SObject := IUnknown(tempObj1) as SWBemObject;<br />
          try<br />
            propSet := SObject.Properties_;<br />
            propEnum := (propSet._NewEnum) as IEnumVariant;<br />
            try<br />
              while (propEnum.Next(1, tempObj2, Value) = S_OK) do<br />
              try<br />
                SProp := IUnknown(tempObj2) as SWBemProperty;<br />
                if (SProp.Name'Name') and (SProp.Name'ProcessId')<br />
                  and (SProp.Name'ParentProcessId') and (SProp.Name'CreationDate') and (SProp.Name'ExecutablePath') then<br />
                    continue;<br />
                // now get the value of the property<br />
                sValue := '';<br />
                spropvalue:=SProp.Get_Value;<br />
                try<br />
                  if VarIsNull(spropvalue) then<br />
                    sValue := ''<br />
                  else<br />
                    case SProp.CIMType of<br />
                      wbemCimtypeSint8, wbemCimtypeUint8, wbemCimtypeSint16, wbemCimtypeUint16,<br />
                      wbemCimtypeSint32, wbemCimtypeUint32, wbemCimtypeSint64:<br />
                        sValue := IntToStr(spropvalue);<br />
                      wbemCimtypeString, wbemCimtypeUint64:<br />
                        if VarIsArray(spropvalue) then<br />
                        begin<br />
                          if VarArrayHighBound(spropvalue, 1) &gt; 0 then<br />
                            for Count := 1 to VarArrayHighBound(spropvalue, 1) do<br />
                              sValue := sValue + ' ' + spropvalue[Count];<br />
                        end<br />
                        else<br />
                          sValue :=  spropvalue;<br />
                      wbemCimtypeDatetime:sValue:=spropvalue//DateTimeToStr(spropvalue)<br />
                    else<br />
                      Exception.Create('Unknown type');<br />
                    end;<br />
                finally<br />
                  spropvalue:=unassigned;<br />
                end;<br />
                case i of<br />
                  0:tmp:=tmp+' [CreationDate='+sValue+']';<br />
                  1:tmp:=tmp+' [Path='+sValue+']';<br />
                  2:tmp:=sValue+tmp;<br />
                  3:tmp:=tmp+' [Parent PID='+sValue+']';<br />
                  4:tmp:=tmp+' [PID='+sValue+']';<br />
                end;</p>
<p>                i:=(i+1) mod 5;<br />
                if i=0 then<br />
                  form1.ListBox1.items.add(tmp);<br />
              finally<br />
                sProp:=nil;<br />
                tempObj2:=NULL;<br />
              end;<br />
            finally<br />
              propEnum:=nil;<br />
              propSet:=nil;<br />
            end;<br />
          finally<br />
            sObject:=nil;<br />
          end;<br />
        finally<br />
          tempObj2:=NULL;<br />
        end;<br />
      finally<br />
        enum.Reset;<br />
        enum:=nil;<br />
      end;<br />
    end else<br />
      ShowMessage('Item with index ' + IntToStr(RefreshableItem.Index) +<br />
          ' is a single object containing WMI version ' + objRefreshableItem1.VersionCurrentlyRunning);<br />
  end;<br />
end;<br />
</code></p>
<img src="http://feeds.feedburner.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~4/ajYSzIUD0oc" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.ciuly.com/programming/delphi/using-swbemrefresher-in-delphi/comment-page-1/#comment-107</feedburner:origLink></item>
	<item>
		<title>Comment on Using SWbemRefresher in delphi by David</title>
		<link>http://feeds.ciuly.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~3/QVyg-EWQcDo/</link>
		<dc:creator>David</dc:creator>
		<pubDate>Tue, 02 Feb 2010 11:28:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ciuly.com/?p=563#comment-106</guid>
		<description>Hi!

Could you expand this example and show how could this be used to show all processes in a memo?


Regards,
David</description>
		<content:encoded><![CDATA[<p>Hi!</p>
<p>Could you expand this example and show how could this be used to show all processes in a memo?</p>
<p>Regards,<br />
David</p>
<img src="http://feeds.feedburner.com/~r/CommentsForCiulysBlog-ReinventingTheWheel/~4/QVyg-EWQcDo" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.ciuly.com/programming/delphi/using-swbemrefresher-in-delphi/comment-page-1/#comment-106</feedburner:origLink></item>
</channel>
</rss>
