| View previous topic :: View next topic |
| Author |
Message |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Sun Nov 25, 2007 3:00 pm Post subject: [Delphi] Console Application |
|
|
Hey guys.
Still working on my console application.
Heres a new question:
Is there anyway to make this work in a Console Application?
http://www.swissdelphicenter.ch/torry/showcode.php?id=2177
When I try to run it, it says
"Undeclared identifier 'TStrings'"
"Missing operator or semicolon"
at
| Code: | | procedure ScanNetworkResources(ResourceType, DisplayType: DWord; List: TStrings); |
I want my console apply to show the computers in network by using
|
|
| Back to top |
|
 |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Sun Nov 25, 2007 3:16 pm Post subject: |
|
|
| Code: | uses
SysUtils, Windows, Classes; |
But I'm not sure if you can do this in a Console application.
|
|
| Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Sun Nov 25, 2007 3:25 pm Post subject: |
|
|
| rEakW0n wrote: | | Code: | uses
SysUtils, Windows, Classes; |
But I'm not sure if you can do this in a Console application. |
Well, I'm not getting the error as before.
But now when Im trying to show the computers in writeln();
Would this be right
| Code: | | writeln(ScanNetworkResources(RESOURCETYPE_DISK, RESOURCEDISPLAYTYPE_SERVER, ); |
Because Im getting an error there.
It says:
| Quote: | | Not enough actual parameters |
I dont know what to add. Any idea?
|
|
| Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Sun Nov 25, 2007 4:12 pm Post subject: |
|
|
Add a TString to it
_________________
|
|
| Back to top |
|
 |
rapion124 Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Mar 2007 Posts: 1095
|
Posted: Sun Nov 25, 2007 7:25 pm Post subject: |
|
|
| It should be TString not TStrings. You can use other units in your console application. Check the procedure header in whatever unit you're getting it from. That should tell you the parameters.
|
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Mon Nov 26, 2007 7:55 am Post subject: |
|
|
add a TStringList variable and use it like this:
| Code: |
ScanNetworkResources(RESOURCETYPE_DISK, RESOURCEDISPLAYTYPE_SERVER,[My TStrings or TStringList here]);
write([My TStrings or TStringList here]);
|
|
|
| Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Mon Nov 26, 2007 10:06 am Post subject: |
|
|
| Could any help me how to add TString to it? Where to put it?
|
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Mon Nov 26, 2007 10:28 am Post subject: |
|
|
| Code: | procedure TForm1.Button3Click(Sender: TObject);
var
...
somewhere here
...
begin
...
//code of the procedure here
...
end; |
|
|
| Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Mon Nov 26, 2007 10:35 am Post subject: |
|
|
| HolyBlah wrote: | | Code: | procedure TForm1.Button3Click(Sender: TObject);
var
...
somewhere here
...
begin
...
//code of the procedure here
...
end; |
|
Remember its not a regular form, its a console application.
But Ill try this out
|
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Mon Nov 26, 2007 11:18 am Post subject: |
|
|
| I've coded alot of shitty quality applications (in the past)
|
|
| Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Mon Nov 26, 2007 11:37 am Post subject: |
|
|
| Kaspersky wrote: | | I've coded alot of shitty quality applications (in the past) |
Okay...? And how is that gonna help me -.-
|
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Mon Nov 26, 2007 12:09 pm Post subject: |
|
|
| Moller wrote: | | HolyBlah wrote: | | Code: | procedure TForm1.Button3Click(Sender: TObject);
var
...
somewhere here
...
begin
...
//code of the procedure here
...
end; |
|
Remember its not a regular form, its a console application.
But Ill try this out |
Oh,
so put var section before all procedures/functions an after uses and types.
@Kaspersky:
show me 1 good program and i will remove it from my sig.
|
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Mon Nov 26, 2007 1:51 pm Post subject: |
|
|
HolyBlah:
Here
|
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Mon Nov 26, 2007 5:20 pm Post subject: |
|
|
| Kaspersky wrote: | HolyBlah:
Here |
Oh look, it can restart the computer and delete the hosts file! I believe an applause is needed here ladies and gentlemen!
|
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Tue Nov 27, 2007 4:06 am Post subject: |
|
|
| it just delete files and restart the computer...
|
|
| Back to top |
|
 |
|