If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > calling api in c#

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-16-03, 04:13
daboira daboira is offline
Registered User
 
Join Date: Dec 2001
Location: Barcelona
Posts: 32
Question calling api in c#

I have some problems to implement the WSAStartup api function in C#.
this is the portion of code:

public struct WSADATA
{
public int wVersion ;
public int wHighVersion;
public byte[] szDescription ;
public byte[] szSystemStatus ;
public long wMaxSockets;
public long wMAXUDPDG;
public long dwVendorInfo;
} // end of structure
...
[DllImport("wsock32.dll")]
public static extern long WSAStartup(long wVersionRequired, WSADATA lpWSDATA);
....
public bool SocketInitialize()
{
WSADATA WSAD = new WSADATA();

return (WSAStartup (WS_VERSION_REQD, WSAD) == IP_SUCCESS);
}
I think the problem is in the initilization of the WSAD structure.

thank's for your help.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On