Hi i have 3 Editfields ,1 for the Dial Up Number ,1 for the Account Name and 1 for the Password,what must i now do with this Settings to open the connection ? invoke RasDial,0,0,??, 0, 0,?? Have a nice Day
Posted on 2001-06-27 08:47:00 by Crest
The last variable is a pointer to a DWORD.

LOCAL hMyRasConnection:DWORD

mov hMyRasConnection, 0 ;Must be zero before the call
invoke RasDial,0,0,??, 0, 0, ADDR hMyRasConnection
The other "??" is a pointer to a RASDIALPARAMS structure. But I don't know how to fill that in. Sorry Mirno This message was edited by Mirno, on 6/27/2001 9:39:39 AM
Posted on 2001-06-27 09:25:00 by Mirno
Creat, The third Parameter a pointer to the RASDIALPARAMS structure. You need to fill this structure out (the C version) :-

typedef struct _RASDIALPARAMS { 
   DWORD  dwSize; 
   TCHAR  szEntryName; 
   TCHAR  szPhoneNumber; 
   TCHAR  szCallbackNumber; 
   TCHAR  szUserName; 
   TCHAR  szPassword; 
   TCHAR  szDomain ; 
#if (WINVER >= 0x401)
   DWORD  dwSubEntry;
   DWORD  dwCallbackId;
dwSize = the size of the structure in bytes - this is so the API nows what version you are using, just use sizeof for this. szEntryName - the name of the entry to dial, if blank then it will use the default connection. szPhoneNumber - the phone number to call, if szEntryName was blank, then this can't be. szUserName - obvious szPassword - sooo obvious... szDomain - the domain you're logging on to, or blank. dwSubEntry - index of the sub-entry to dial. (zero probably) dwCallBackID - used defined value, which will be passed to RasDialFunc2 easy huh? umbongo
Posted on 2001-06-27 09:52:00 by umbongo
Hi ----------- easy huh? ----------- since English is not my Homelanguage and some other Problems ,its not Easy for me :-( But i try to understand what you like to tell me. Thanks
Posted on 2001-06-27 12:34:00 by Crest
Hi so i think i got it. i have first move my settings from the editfields to the RASDIALPARAMS ,then i have to call those settings with the rasdial function. like invoke rasdial ,0,0,here the rasdialparams,0,0,here the hMyRasConnection but what i not understand is how can i port the ras settings from the c sample u post to asm ? will u possible help me on this ? Thanks
Posted on 2001-06-29 04:47:00 by Crest
RASDIALPARAMS is already defined in WINDOWS.INC which is a standard part of the MASM32 package.

include \masm32\include\windows.inc
Will allow you to use it in your code.

include \masm32\include\windows.inc

hMyRASConnection DWORD 0

   mov edx, offset MyRASParams
   mov (RASDIALPARAMS PTR ).szEntryName[0], 0
   mov (RASDIALPARAMS PTR ).szDomain[0], 0
   mov (RASDIALPARAMS PTR ).dwSubEntry, 0
   mov (RASDIALPARAMS PTR ).dwCallBackID, 0 ;Not sure about this!
   lea eax, (RASDIALPARAMS PTR ).szPassword
   push eax
   lea eax, (RASDIALPARAMS PTR ).szUserName
   push eax
   lea eax, (RASDIALPARAMS PTR ).szPhoneNumber

   invoke SendMessage, hEditPhone, WM_GETTEXT, RAS_MaxPhoneNumber, eax

   pop eax
   invoke SendMessage, hEditUName, WM_GETTEXT, UNLEN, eax

   pop eax
   invoke SendMessage, hEditPW, WM_GETTEXT, PWLEN, eax

   ;MyRASParams is now filled out with the correct info,
   ;time to call RasDial!

   invoke RasDial, 0, 0, ADDR MyRASParams, 0, 0, ADDR hMyRASConnection
Posted on 2001-06-29 06:00:00 by Mirno