Home All Groups Group Topic Archive Search About
Author
14 Sep 2006 8:42 AM
mesutalturk
i need your help some eror when i convert is VBS code to Delphi.
thats eror code is =

For Each objItem in colItems
    objItem.AddExtensionFile _
        "C:\dene.exe", True, _
            "BITSEXT", True, "BITS Update"
Next


VBS and Delphi codes  in the bottom.
thaks anyway for your helps.


**************************
VBS Code;


strComputer = "."
Set objWMIService = GetObject _
    ("winmgmts:{authenticationLevel=pktPrivacy}\\" _
        & strComputer & "\root\microsoftiisv2")


Set colItems = objWMIService.ExecQuery _
    ("Select * From IIsWebService")


For Each objItem in colItems
    objItem.AddExtensionFile _
        "C:\dene.exe", True, _
            "BITSEXT", True, "BITS Update"
Next


Delphi Convert Code :) ;


function TForm1.GetObject(const objectName: String): IDispatch;
var
  bindCtx: IBindCtx;
  moniker: IMoniker;
  chEaten: Integer;
begin
  OleCheck(CreateBindCtx(0, bindCtx));
  OleCheck(MkParseDisplayName(bindCtx, StringToOleStr(objectName),
chEaten,
moniker));
  OleCheck(moniker.BindToObject(bindCtx, nil, IDispatch, Result));
end;


procedure TForm1.Button3Click(Sender: TObject);
var
  objWMIService: OLEVariant;
  colItems: OLEVariant;
begin
objWMIService:=GetObject('winmgmts:{authenticationLevel=pktPrivacy}\\localh­ost\root\microsoftiisv2');

colItems:=objWMIService.ExecQuery('Select * From IIsWebService');

******************
{
For Each objItem in colItems
    objItem.AddExtensionFile _
        "C:\dene.exe", True, _
            "BITSEXT", True, "BITS Update"
Next
}
:(
******************

end;

Author
14 Sep 2006 10:06 PM
GhostInAK
Hello mesutalt***@gmail.com,

This is neither a VBS nor a Delphi group.  Piss off.

-Boo

Show quoteHide quote
> i need your help some eror when i convert is VBS code to Delphi. thats
> eror code is =
>
> For Each objItem in colItems
> objItem.AddExtensionFile
> "C:\dene.exe", True,
> "BITSEXT", True, "BITS Update"
> Next
> VBS and Delphi codes  in the bottom.
> thaks anyway for your helps.
> **************************
> VBS Code;
> strComputer = "."
> Set objWMIService = GetObject
> ("winmgmts:{authenticationLevel=pktPrivacy}\\"
> & strComputer & "\root\microsoftiisv2")
> Set colItems = objWMIService.ExecQuery
> ("Select * From IIsWebService")
> For Each objItem in colItems
> objItem.AddExtensionFile
> "C:\dene.exe", True,
> "BITSEXT", True, "BITS Update"
> Next
> Delphi Convert Code :) ;
>
> function TForm1.GetObject(const objectName: String): IDispatch;
> var
> bindCtx: IBindCtx;
> moniker: IMoniker;
> chEaten: Integer;
> begin
> OleCheck(CreateBindCtx(0, bindCtx));
> OleCheck(MkParseDisplayName(bindCtx, StringToOleStr(objectName),
> chEaten,
> moniker));
> OleCheck(moniker.BindToObject(bindCtx, nil, IDispatch, Result));
> end;
> procedure TForm1.Button3Click(Sender: TObject);
> var
> objWMIService: OLEVariant;
> colItems: OLEVariant;
> begin
> objWMIService:=GetObject('winmgmts:{authenticationLevel=pktPrivacy}\\l
> o calh­ost\root\microsoftiisv2');
>
> colItems:=objWMIService.ExecQuery('Select * From IIsWebService');
>
> ******************
> {
> For Each objItem in colItems
> objItem.AddExtensionFile
> "C:\dene.exe", True,
> "BITSEXT", True, "BITS Update"
> Next
> }
> :(
> ******************
> end;
>
Author
15 Sep 2006 10:46 AM
Brian Cryer
<mesutalt***@gmail.com> wrote in message
news:1158223369.340400.301860@b28g2000cwb.googlegroups.com...
i need your help some eror when i convert is VBS code to Delphi.

<snip>

If you point your newsreader at the server newsgroups.Borland.com you will
find there a number of Borland Delphi newsgroups. Can't advise which is the
best one to use, but you are more likely to get a helpful answer there than
in this vb.net specific newsgroup.
--
Brian Cryer
www.cryer.co.uk/brian