Consultor Eletrônico



Kbase P3513: How to call WIN32 API Function: RasDialA
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   1/26/2005
Status: Unverified

GOAL:

How to call WIN32 API Function: RasDialA

FIX:

DEFINE VARIABLE RAS AS MEMPTR.
DEFINE VARIABLE lpSize AS INT NO-UNDO.
DEFINE VARIABLE hRAS AS int NO-UNDO.
DEFINE VARIABLE ReturnCode AS INT NO-UNDO.


PROCEDURE RasDialA EXTERNAL "rasapi32.dll".
DEFINE INPUT PARAMETER I AS LONG.
DEFINE INPUT PARAMETER J AS LONG.
DEFINE INPUT PARAMETER RASDialParams AS MEMPTR.
DEFINE INPUT PARAMETER K AS LONG.
DEFINE INPUT PARAMETER L AS LONG.
DEFINE OUTPUT PARAMETE hRAS AS LONG.
DEFINE RETURN PARAMETER ReturnCode AS LONG.
END.


set-size(RAS) = lpSize. /* RAS structure size */

Put-Long(RAS, 1) = lpSize. /* Entry Size */
Put-String(RAS, 5) = "CName". /* Connection Name */
[...] /* RAS memptr has to be initialized with the appropiated values */


Run RASDialA( 0,
0,
RAS,
0,
0,
output hRAS,
output ReturnCode
).

set-size(RAS) = 0.

If ReturnCode = 0 then
Message "You are connected." view-as alert-box ERROR.
else
Message "Error " ReturnCode "has occured while dialing..."
view-as alert-box ERROR.