473,325 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

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.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:{authentication Level=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;

Sep 14 '06 #1
2 3832
Hello me*********@gmail.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.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:{authentication Level=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;

Sep 14 '06 #2
<me*********@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.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

Sep 15 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: achrist | last post by:
I'm aving some trouble getting callbacks from a Delphi DLL back to python working through ctypes. The call from python to the DLL works fine. In the Delphi(5) code: type TCallbackFunc =...
0
by: Shane | last post by:
Greetings, I've been trying to get PyRun_SimpleFile to work from Delphi without success, has any one done this? Doing it in C/C++ is trivial, but I need Delphi and I'm not a Delphi expert. ...
9
by: Gclinton | last post by:
I'm looking for a comparsion of C# to Delphi .net. My company is about to begin the process of reengineering a Delphi tightly coupled win32 app and a Older Java webclient that uses JSP over to an...
7
by: Sanjay Kedare | last post by:
Hi, I am evaluating various alternatives of converting Delphi (Ver 4.0) screens to C# screens. Are there any tools available for such conversion? if yes how much conversion do they achieve? The...
4
by: Islamegy | last post by:
I'm convert a Delphi program to C#.. While i have no knowledge with delphi i must implement everything but for some reason everything working faster on the old program than mine!! i'm working with...
7
by: Bart Roozendaal | last post by:
I am using a C# assembly in Delphi.Win32 using the com interop services. This works fine, but I am looking for a way to debug the C# assembly. When using a Delphi program as a host for the...
0
by: Tomek | last post by:
Welcome. I`m trying to prepere some project that shows how to use Corba technology i heterogenic systems.I`d like to create CORBA server with Borland Delphi (or C#.NET) and few client...
9
by: de | last post by:
between c and c++ I have understood is preferibile c++, but always? and regarding C# what changes? Moreover which are the main differences between the rad Turbo C++, Borland Studio6 C++, Visual...
1
by: Jure Bogataj | last post by:
Hello! Does anybody knows how to handle this issue: I have an Delphi DLL with following two function declaration: function DeallocateString(lpszString : PChar) : DWORD; stdcall; function...
11
by: gnuist006 | last post by:
Is there a Delphi equivalent in the C world or Scheme/LISP world ? Recently, Delphi is in resurgence. In Russia people are using like crazy. For example, Bolega has written a free image...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.