[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

passing sysint variable to API

Posted on 2008-11-04
6
Medium Priority
?
510 Views
Last Modified: 2013-11-23
I am trying to pass some variables into an api using delphi 6.

function  Login(const Server: WideString; Port: sysint;
                    const Username: WideString; const Password: WideString): WideString

procedure TForm1.Button1Click(Sender: TObject);
var
islogin : widestring;
begin
 server := 'testserver';
 username := 'user1';
 password := 'password';
 port := 11977;
islogin := globo.Login(servername,portnumber,username,password);
 showmessage(islogin);
end;

I get an access violation - am I not passing the correct variable for a sysint / can you provide examples of a sysint variable?;


0
Comment
Question by:ubernewb
  • 3
  • 2
5 Comments
 
LVL 46

Expert Comment

by:aikimark
ID: 22882767
you have two differently named variables:

port := 11977;
portnumber
0
 

Author Comment

by:ubernewb
ID: 22883758
Sorry - That line should read:

islogin := globo.Login(servername,port,username,password);

Is a sysint variable like an integer?
0
 
LVL 46

Expert Comment

by:aikimark
ID: 22885358
yes.  it's basically an INT.
http://docs.codegear.com/docs/radstudio/radstudio2007/RS2007_helpupdates/HUpdate3/EN/html/devwin32/wtlvalidtypes_xml.html


============
btw...do you have ?
   uses activex;
0
 

Author Comment

by:ubernewb
ID: 22885480
Thanks for posting again,

I have activex under my uses clause....., perhaps the access violation is nothing to do with the parameters I am passing to it.
0
 
LVL 46

Accepted Solution

by:
aikimark earned 2000 total points
ID: 22885717
how about the 'server' versus 'servername' difference?

how are your variables declared?
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
Suggested Courses

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question