RasEnumConnections怎么用?参数怎么写?(50分)

  • 主题发起人 主题发起人 天真
  • 开始时间 开始时间
该函数DELPHI不支持,需要你自己写<br>详情请看VC的RAS.H
 
谁说不支持的?<br>我都在DELPHI的帮助文件中找到了,<br>The RasEnumConnections function lists all active RAS connections. It returns each connection's handle and phone-book entry name. <br><br>DWORD RasEnumConnections(<br><br>&nbsp; &nbsp; LPRASCONN lprasconn, // buffer to receive connections data<br>&nbsp; &nbsp; LPDWORD lpcb, // size in bytes of buffer<br>&nbsp; &nbsp; LPDWORD lpcConnections // number of connections written to buffer<br>&nbsp; &nbsp;); <br>&nbsp;<br>但是我就是参数不知道该怎么写!
 
procedure GetActiveConn;<br>var<br>&nbsp; &nbsp; dwRet: DWORD;<br>&nbsp; &nbsp; nCB: DWORD;<br>&nbsp; &nbsp; Buf: array [0..255] of Char;<br>&nbsp; &nbsp; aRasConn: array [0..10] of TRASCONN<br>begin<br>&nbsp; &nbsp; aRasConn[0].dwSize := SizeOf(aRasConn[0]);<br>&nbsp; &nbsp; nCB &nbsp; := SizeOf(aRasConn);<br>&nbsp; &nbsp; dwRet := RasEnumConnectionsA(@aRasConn, @nCB, @nRasConnCount);<br>&nbsp; &nbsp; if dwRet &lt;&gt; 0 then <br>&nbsp; &nbsp; &nbsp; &nbsp; RasGetErrorStringA(dwRet, @Buf[0], SizeOf(Buf));<br>end;<br>
 
to 天真:<br>&nbsp; 你看的是windows Programmer's Guide吧,不错,是有它的帮助,但不一定DELPHI支持,我没有在<br>DELPHI的的源文件中看到任何它的说明和声明,所以我说不支持,也许是我太武断了<br><br>to 7030:<br>&nbsp; &nbsp;你的编译通不过,无TRASCONN声明<br>&nbsp; &nbsp;如果你编译通过了,请告诉我如何获得TRASCONN的声明.<br>&nbsp;
 
我看到进一本书讲过,但无实例!
 
TrasConn在ras.pas中申明如下:(你的ras.pas没有它吗?)<br>type<br>&nbsp; &nbsp; TRASCONN = packed record<br>&nbsp; &nbsp; &nbsp; &nbsp; dwSize &nbsp; &nbsp; &nbsp; : DWORD;<br>&nbsp; &nbsp; &nbsp; &nbsp; hRasConn &nbsp; &nbsp; : THRASCONN;<br>&nbsp; &nbsp; &nbsp; &nbsp; szEntryName &nbsp;: array [0..RAS_MaxEntryName] of char;<br>&nbsp; &nbsp; &nbsp; &nbsp;{$IFDEF WINVER400}<br>&nbsp; &nbsp; &nbsp; &nbsp; szDeviceType : array [0..RAS_MaxDeviceType] of char;<br>&nbsp; &nbsp; &nbsp; &nbsp; szDeviceName : array [0..RAS_MaxDeviceName] of char;<br>&nbsp; &nbsp; &nbsp; &nbsp;{$ENDIF}<br>&nbsp; &nbsp; &nbsp; &nbsp; szPadding &nbsp; &nbsp;: array [0..0] of Char;<br>&nbsp; &nbsp; end;
 
多人接受答案了。
 
后退
顶部