RAS connect and so on

Just starting out? Need help? Post your questions and find answers here.
Stronler
New User
New User
Posts: 1
Joined: Sun Oct 05, 2003 2:07 pm
Location: Dusseldorf

RAS connect and so on

Post by Stronler »

Id like to write a small dialer for myself, but I cant really find out how to work with API in PB... Can anyone help me?
PureUser
User
User
Posts: 31
Joined: Sun Oct 05, 2003 11:18 pm

Post by PureUser »

I've got the same problem...I can not run PPP Daemon with PB
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

http://www.xs4all.nl/~bluez/datatalk/pure1.htm

doc still unchecked, but perhaps it could help you

there's a very small section on using winapi calls, it's not that difficult
Jurgen
User
User
Posts: 37
Joined: Mon Sep 08, 2003 11:53 pm

Post by Jurgen »

What Api function do you want to use ? :)
PureUser
User
User
Posts: 31
Joined: Sun Oct 05, 2003 11:18 pm

Post by PureUser »

Structure RASDIALPARAMS
dwSize.f
szEntryName.s
szPhoneNumber.s
szCallbackNumber.s
szUserName.s
szPassword.s
szDomain.s
EndStructure

Dim lol.rasdialparams(100)
lol(0)\dwSize = SizeOf(RASDIALPARAMS)
lol(0)\szEntryName = "test"
lol(0)\szPhoneNumber = "1-800-test"
lol(0)\szCallbackNumber
lol(0)\szUserName = "test"
lol(0)\szPassword = "test"
lol(0)\szDomain = "*"

RASDIALPARAMS = *RASDIALPARAMS



RasDial_(null, null, *RASDIALPARAMS, null, null, null )

Maybe this source can help you... I am not really sure that it is without mistakes, still...maybe GURU coders will check this out and correct it...
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

> RASDIALPARAMS = *RASDIALPARAMS

why do this?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

typedef struct _RASDIALPARAMS {
DWORD dwSize;
TCHAR szEntryName[RAS_MaxEntryName + 1];
TCHAR szPhoneNumber[RAS_MaxPhoneNumber + 1];
TCHAR szCallbackNumber[RAS_MaxCallbackNumber + 1];
TCHAR szUserName[UNLEN + 1];
TCHAR szPassword[PWLEN + 1];
TCHAR szDomain[DNLEN + 1] ;
} RASDIALPARAMS;

aren't these fixed length strings instead of pointers? your definition makes them pointers, or am i wrong? see also viewtopic.php?t=7766
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
PureUser
User
User
Posts: 31
Joined: Sun Oct 05, 2003 11:18 pm

Post by PureUser »

it is said in api help that RasDial_ uses pointer...that is why i made pointer.... but unfortunately nothing works... :( Any Ideas?
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

i was refering to the structure itself which is, i think, incorrectly translated to purebasic
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
PureUser
User
User
Posts: 31
Joined: Sun Oct 05, 2003 11:18 pm

Post by PureUser »

So maybe you will post correct idea? ;)
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

i have no idea how ras works, but as for the structure, i think you have to translate the TCHAR stuff with byte fields

TCHAR x[255]

would then become

x.b[255]

in pure, you cannot assign a string to such a bytefield, so the c statement

variable.x = "test"

would become in pure:

pokes(@variable.b,"test")

or something along those lines...

now i only have to figure out what TCHAR does... :roll:
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
freak
PureBasic Team
PureBasic Team
Posts: 5960
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

TCHAR is on non-unicode systems defined as a CHAR, which is just a byte
in fact.

Structure should look like this:

Code: Select all

#RAS_MaxEntryName = 256
#RAS_MaxPhoneNumber = 128
#RAS_MaxCallbackNumber = 48
#UNLEN = 256
#PWLEN = 256
#DNLEN = 15

Structure RASDIALPARAMS 
  dwSize.l
  szEntryName.b[#RAS_MaxEntryName + 1]
  szPhoneNumber.b[#RAS_MaxPhoneNumber + 1]
  szCallbackNumber.b[#RAS_MaxCallbackNumber + 1]
  szUserName.b[#UNLEN + 1]
  szPassword.b[#PWLEN + 1]
  szDomain.b[#DNLEN + 1] 
EndStructure
Timo
quidquid Latine dictum sit altum videtur
PureUser
User
User
Posts: 31
Joined: Sun Oct 05, 2003 11:18 pm

Post by PureUser »

hm... and then is useful to use writwbyte func. ?
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

writebyte? you mean pokes i assume?

x.rasdialparams
pokes(@rasdialparamams\szEntryName,"test")
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
sec
Enthusiast
Enthusiast
Posts: 792
Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:

Post by sec »

hello,

i have log wvdial under linux:
[root@localhost root]# wvdial sec911
--> WvDial: Internet dialer version 1.53
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATI7
ATI7
Country: USA
OK
--> Modem initialized.
--> Sending: ATDT911
--> Waiting for carrier.
ATDT911
...
can anybody opencom(), senddata(), closecom() ,...? modem on com3 :?: in windows
?
Post Reply