Click here to Skip to main content
16,015,414 members
Home / Discussions / C#
   

C#

 
AnswerRe: Screen mousemove event? Pin
Nick Parker15-Apr-02 1:27
protectorNick Parker15-Apr-02 1:27 
AnswerRe: Screen mousemove event? Pin
Rüpel18-Apr-02 2:38
Rüpel18-Apr-02 2:38 
GeneralRe: Screen mousemove event? Pin
Rüpel19-Apr-02 0:01
Rüpel19-Apr-02 0:01 
GeneralEnumerating computer names in local network Pin
djnex13-Apr-02 21:56
djnex13-Apr-02 21:56 
GeneralWSDL (Web service description language) Pin
13-Apr-02 16:24
suss13-Apr-02 16:24 
GeneralRe: WSDL (Web service description language) Pin
Nick Parker15-Apr-02 12:43
protectorNick Parker15-Apr-02 12:43 
GeneralC# wrapper for the WinPcap Library Pin
HG12-Apr-02 21:25
HG12-Apr-02 21:25 
GeneralRe: C# wrapper for the WinPcap Library Pin
James T. Johnson12-Apr-02 22:12
James T. Johnson12-Apr-02 22:12 
A long in Win32 API is 32-bits, a long in .NET is 64 bits while an int is 32 bits.

If the string being passed in is a buffer (looks like it is) you should also be using StringBuilder instead of string.

With those two changes I come up with

[DllImport("packet.dll")]<br />
extern static bool PacketGetAdapterNames(StringBuilder pStr, ref uint BufferSize);


void GetAdapterNames() <br />
{<br />
  System.Text.StringBuilder AdapterNames = new System.Text.StringBuilder(bufferSize);<br />
  uint bufSize = (uint) bufferSize;<br />
<br />
  PacketGetAdapterNames(AdapterNames, ref bufSize);<br />
}


I don't think ref is needed on the buffer because it will be passed like a char array to the function by the marshaler, putting ref on the buffer would be equivelant to WCHAR** in C/C++.

HTH,

James

Simplicity Rules!
GeneralRe: C# wrapper for the WinPcap Library Pin
HG12-Apr-02 22:29
HG12-Apr-02 22:29 
GeneralRe: C# wrapper for the WinPcap Library Pin
HG12-Apr-02 23:51
HG12-Apr-02 23:51 
GeneralRe: C# wrapper for the WinPcap Library Pin
James T. Johnson13-Apr-02 0:20
James T. Johnson13-Apr-02 0:20 
GeneralRe: C# wrapper for the WinPcap Library Pin
Neil Van Note13-Apr-02 14:54
Neil Van Note13-Apr-02 14:54 
GeneralRe: C# wrapper for the WinPcap Library Pin
James T. Johnson13-Apr-02 15:09
James T. Johnson13-Apr-02 15:09 
GeneralRe: C# wrapper for the WinPcap Library Pin
Neil Van Note13-Apr-02 15:41
Neil Van Note13-Apr-02 15:41 
Generalsome problem about Font Pin
12-Apr-02 18:01
suss12-Apr-02 18:01 
QuestionA bug in TreeView AfterCheck event? Pin
gicio12-Apr-02 8:44
gicio12-Apr-02 8:44 
AnswerRe: A bug in TreeView AfterCheck event? Pin
Tom Welch12-Apr-02 8:51
Tom Welch12-Apr-02 8:51 
GeneralRe: A bug in TreeView AfterCheck event? Pin
gicio14-Apr-02 3:25
gicio14-Apr-02 3:25 
GeneralIcon from ImageList Pin
Derek Price12-Apr-02 2:19
Derek Price12-Apr-02 2:19 
GeneralRe: Icon from ImageList Pin
Rüpel18-Apr-02 2:52
Rüpel18-Apr-02 2:52 
GeneralRe: Icon from ImageList Pin
Derek Price18-Apr-02 4:40
Derek Price18-Apr-02 4:40 
QuestionHow to make a combobox uneditable? Pin
11-Apr-02 23:32
suss11-Apr-02 23:32 
AnswerRe: How to make a combobox uneditable? Pin
James T. Johnson11-Apr-02 23:35
James T. Johnson11-Apr-02 23:35 
GeneralUsing COM Objects (new interfaces) Pin
Anders Molin11-Apr-02 22:39
professionalAnders Molin11-Apr-02 22:39 
GeneralRe: Using COM Objects (new interfaces) Pin
James T. Johnson11-Apr-02 23:00
James T. Johnson11-Apr-02 23:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.