RAS connect and so on
sorry pureuser, i was perhaps a little quick, i tend to get 'overcondensed' now and again, but i overcompensate that by being loud and noisy the rest of the time
here's the same somewhat better...
struct rasdialparams ; the struct as was shown in another post
...
...
endstructure
x.rasdialparams ; make a variable x of type struct rasdialparams
pokes(@x\szEntryName,"test") ; and fill a certain field
that should be better
here's the same somewhat better...
struct rasdialparams ; the struct as was shown in another post
...
...
endstructure
x.rasdialparams ; make a variable x of type struct rasdialparams
pokes(@x\szEntryName,"test") ; and fill a certain field
that should be better
( 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... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
rasdial_(0,0,@x,0,0,0)
( 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... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
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
x.rasdialparams ; make a variable x of type struct rasdialparams
PokeL(@x\dwSize, SizeOf(RASDIALPARAMS))
PokeS(@x\szEntryName,"gin") ; and fill a certain field
PokeS(@x\szPhoneNumber,"")
PokeS(@x\szCallBackNumber,"")
PokeS(@x\szUserName,"test")
PokeS(@x\szPassword,"test")
PokeS(@x\szDomain,"*")
res=RasDial_(null, null, @x, null, null, null ); it gives an error #610 on win 9x
;This means that the buffer was set incorrectly
;in C\C++ the key to fix trouble is to set
;#define WINVER 0x400
;before
;#include <ras.h>
Delay (99999)
This means that the buffer was set incorrectly
in C\C++ the key to fix trouble is to set
#define WINVER 0x400
before
#include <ras.h>
Any ideas how to translate to PB ?
at first glance this looks ok
you can set the dwsize field directly though, no need to poke it
PokeL(@x\dwSize, SizeOf(RASDIALPARAMS))
x\dwsize = SizeOf(RASDIALPARAMS))
on winxp, it returns 87, no other error reported
i'm afraid either i lost you or can't help you any further on this
you can set the dwsize field directly though, no need to poke it
PokeL(@x\dwSize, SizeOf(RASDIALPARAMS))
x\dwsize = SizeOf(RASDIALPARAMS))
on winxp, it returns 87, no other error reported
i'm afraid either i lost you or can't help you any further on 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... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
try it on another os and see what it does
( 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... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
checkout the vb example at http://www.mentalis.org/apilist/RasDial.shtml
example : http://www.mentalis.org/apilist/RasDial.shtml#
Now you have to add a phone book entry with the same entryname.
example : http://www.mentalis.org/apilist/RasDial.shtml#
Code: Select all
#RAS_MaxEntryName = 256
#RAS_MaxPhoneNumber = 128
#RAS_MaxCallbackNumber = 128 ; this was wrong
#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
RDP.RASDIALPARAMS
hRasConn.l=NULL
RDP\dwSize = 1052 ;SizeOf(RASDIALPARAMS)
Debug RDP\dwSize
PokeS(@RDP\szEntryName,"test")
PokeS(@RDP\szPhoneNumber,"012313213")
PokeS(@RDP\szCallbackNumber ,"*")
PokeS(@RDP\szUserName,"test")
PokeS(@RDP\szPassword,"test")
PokeS(@RDP\szDomain,"*")
res.l = 0
res = RasDial_(null, null, @RDP, null, null, @hRasConn)
Debug res
I find it very strange that the sizeof doesn't work correctly, instead 1052 works ?
Does PB have something similar to the #if and #endif as in visual c++ ?
Does PB have something similar to the #if and #endif as in visual c++ ?
Code: Select all
#define RASDIALPARAMSA struct tagRASDIALPARAMSA
RASDIALPARAMSA
{
DWORD dwSize;
CHAR szEntryName[ RAS_MaxEntryName + 1 ];
CHAR szPhoneNumber[ RAS_MaxPhoneNumber + 1 ];
CHAR szCallbackNumber[ RAS_MaxCallbackNumber + 1 ];
CHAR szUserName[ UNLEN + 1 ];
CHAR szPassword[ PWLEN + 1 ];
CHAR szDomain[ DNLEN + 1 ];
#if (WINVER >= 0x401)
DWORD dwSubEntry;
DWORD dwCallbackId;
#endif
};I'm not sure what #if and #endif do, but if they're compiler directives, you can use CompilerIf and CompilerEndIf.Does PB have something similar to the #if and #endif as in visual c++ ?
P4 2.4GHz, 256 MB, WinXP Pro, onboard video&audio.
The Programmer's Drinking Song:
"99 little bugs in the code,
99 little bugs.
Fix one bug, recompile
100 little bugs in the code."
The Programmer's Drinking Song:
"99 little bugs in the code,
99 little bugs.
Fix one bug, recompile
100 little bugs in the code."


