VB to Delphi Help!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mesutalturk@gmail.com

    #1

    VB to Delphi Help!

    i need your help some eror when i convert is VBS code to Delphi.
    thats eror code is =

    For Each objItem in colItems
    objItem.AddExte nsionFile _
    "C:\dene.ex e", 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:{aut henticationLeve l=pktPrivacy}\\ " _
    & strComputer & "\root\microsof tiisv2")


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


    For Each objItem in colItems
    objItem.AddExte nsionFile _
    "C:\dene.ex e", True, _
    "BITSEXT", True, "BITS Update"
    Next


    Delphi Convert Code :) ;


    function TForm1.GetObjec t(const objectName: String): IDispatch;
    var
    bindCtx: IBindCtx;
    moniker: IMoniker;
    chEaten: Integer;
    begin
    OleCheck(Create BindCtx(0, bindCtx));
    OleCheck(MkPars eDisplayName(bi ndCtx, StringToOleStr( objectName),
    chEaten,
    moniker));
    OleCheck(monike r.BindToObject( bindCtx, nil, IDispatch, Result));
    end;


    procedure TForm1.Button3C lick(Sender: TObject);
    var
    objWMIService: OLEVariant;
    colItems: OLEVariant;
    begin
    objWMIService:= GetObject('winm gmts:{authentic ationLevel=pktP rivacy}\\localh ­ost\root\micro softiisv2');

    colItems:=objWM IService.ExecQu ery('Select * From IIsWebService') ;

    *************** ***
    {
    For Each objItem in colItems
    objItem.AddExte nsionFile _
    "C:\dene.ex e", True, _
    "BITSEXT", True, "BITS Update"
    Next
    }
    :(
    *************** ***

    end;

  • GhostInAK

    #2
    Re: VB to Delphi Help!

    Hello mesutalturk@gma il.com,

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

    -Boo
    i need your help some eror when i convert is VBS code to Delphi. thats
    eror code is =
    >
    For Each objItem in colItems
    objItem.AddExte nsionFile
    "C:\dene.ex e", 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:{aut henticationLeve l=pktPrivacy}\\ "
    & strComputer & "\root\microsof tiisv2")
    Set colItems = objWMIService.E xecQuery
    ("Select * From IIsWebService")
    For Each objItem in colItems
    objItem.AddExte nsionFile
    "C:\dene.ex e", True,
    "BITSEXT", True, "BITS Update"
    Next
    Delphi Convert Code :) ;
    >
    function TForm1.GetObjec t(const objectName: String): IDispatch;
    var
    bindCtx: IBindCtx;
    moniker: IMoniker;
    chEaten: Integer;
    begin
    OleCheck(Create BindCtx(0, bindCtx));
    OleCheck(MkPars eDisplayName(bi ndCtx, StringToOleStr( objectName),
    chEaten,
    moniker));
    OleCheck(monike r.BindToObject( bindCtx, nil, IDispatch, Result));
    end;
    procedure TForm1.Button3C lick(Sender: TObject);
    var
    objWMIService: OLEVariant;
    colItems: OLEVariant;
    begin
    objWMIService:= GetObject('winm gmts:{authentic ationLevel=pktP rivacy}\\l
    o calh­ost\root\m icrosoftiisv2') ;
    >
    colItems:=objWM IService.ExecQu ery('Select * From IIsWebService') ;
    >
    *************** ***
    {
    For Each objItem in colItems
    objItem.AddExte nsionFile
    "C:\dene.ex e", True,
    "BITSEXT", True, "BITS Update"
    Next
    }
    :(
    *************** ***
    end;
    >

    Comment

    • Brian Cryer

      #3
      Re: VB to Delphi Help!

      <mesutalturk@gm ail.comwrote in message
      news:1158223369 .340400.301860@ b28g2000cwb.goo glegroups.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.Borl and.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
      Brian Cryer's home page, a collection of notes on my professional and personal interests. Including C#, VB.Net, Windows, DB admin, Delphi and more.




      Comment

      Working...