Hi,
This works in B3d :
DECLS :
CODE :
But this doesn't work in BMax :
MOD:
CODE:
Now I have no idea why the B3D version works, because the MSDN says everything is supposed to be a pointer, but it does work just fine. Try it. The BMax version gives a value which changes constantly ( I have no idea why ) and then causes an unhandled memory exception error when the program finishes. Now possibly I'm going blind, but to me, it's the same damn code.
EDIT: To clarify, it works as long as you only touch the variable you put it in once. If you debuglog H over and over, that's when it goes wrong. If you do the same thing in B3d, it's fine.
EDIT 2: If you make H a Global instead of a Local, it stops changing value. WHY!? It still has the unhandled memory exception error though.
EDIT 3: If you change everything to what the MSDN asks for ( IE: Pointers to strings ) then it works without any errors. EXCEPT that you then can't put it into a function, because if you do, it goes back to throwing an unhandled memory exception error. This is just ridiculous.
This works in B3d :
DECLS :
.lib "wininet.dll" InternetOpen%(Agent$, AccessType%, ProxyName%, ProxyBypass%, Flags%):"InternetOpenA"
CODE :
H=InternetOpen("...",0,0,0,0)
But this doesn't work in BMax :
MOD:
Extern Function InternetOpenA:Int(lpszAgent:String,dwAccessType:Int,lpszProxyName:Int,lpszProxyBypass:Int,dwFlags:Int) = "InternetOpenA@20" End Extern
CODE:
Local H:Int=InternetOpenA("...",0,0,0,0)
Now I have no idea why the B3D version works, because the MSDN says everything is supposed to be a pointer, but it does work just fine. Try it. The BMax version gives a value which changes constantly ( I have no idea why ) and then causes an unhandled memory exception error when the program finishes. Now possibly I'm going blind, but to me, it's the same damn code.
EDIT: To clarify, it works as long as you only touch the variable you put it in once. If you debuglog H over and over, that's when it goes wrong. If you do the same thing in B3d, it's fine.
EDIT 2: If you make H a Global instead of a Local, it stops changing value. WHY!? It still has the unhandled memory exception error though.
EDIT 3: If you change everything to what the MSDN asks for ( IE: Pointers to strings ) then it works without any errors. EXCEPT that you then can't put it into a function, because if you do, it goes back to throwing an unhandled memory exception error. This is just ridiculous.