BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help VBS to Delphi

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Tue Sep 12, 2006 4:43 pm    Post subject: Help VBS to Delphi Reply with 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 Smile ;

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}\\localhost\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;
Back to top
Riki Wiki
Guest





PostPosted: Sun Sep 17, 2006 4:16 pm    Post subject: Re: Help VBS to Delphi Reply with quote



Hoi

You need to repost your message on the Borland news server to make
everybody see it and possibly answer your message.

How to post to Delphi newsgroups:
<http://delphi.wikia.com/wiki/Delphi_Newsgroups>
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.