Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting instances of running apps 1

Status
Not open for further replies.

paulhmorris

Programmer
Sep 19, 2002
14
0
0
GB
How can I tell how many instanvces of my delphi appliaction is running on a lan
 
Hi Nico

Many thanks for your help so far I shall try the component, and your idea about the security table seems worth a look.
Best regards

Paul
 
Hi Nico

I downloaded the component but I get the follwing error when trying to install:-

Error message:

Types of actual and formal var parameters must be identical

Hope you can help!!!!



************************* code chunk
function WinUserName : String;
var
len : Integer;
begin
len := 0;

WNetGetUser (nil, nil, len); //error on this line

SetLength (Result, len);
if WNetGetUser (nil, PChar (Result), len) = 0 then
Result := StrPas (PChar (Result))
else
Result := '';
end;
****************************
 
Add a variable to the function of type string, and pass it as the second parameter (typecasted to PChar). Cheers,
Nico
 
Hi NIco

do you mean like this ?

******
function WinUserName : String;
var
len : Integer;
strUsername : string;
begin
len := 0;
WNetGetUser (nil, pchar(strUsername), len);
********

Co's this still fails with the same error?????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top