Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change
D:\BCX>DllToInc64.exe
Usage : DllToInc64.exe DllFile.dll [optional -u]
Version 1.0
-u : Create include file for UNICODE API functions.
DllToInc64.exe kernel32.dll
\FreeBASIC\fbc32 -nodeflibs -c GetPublicIP.bas
\FreeBASIC\bin\win32\ld -e _mainCRTStartup -subsystem console -o GetPublicIP.exe GetPublicIP.o -L\FreeBASIC\lib\win32 -lkernel32 -luser32 -lgdi32 -lWininet -lmsvcrt -s
' Example of retrieving the WAN IP adress from an external source :
'
' GetPublicIP.exe http://whatismyip.akamai.com
' GetPublicIP.exe https://ipecho.net/plain
'
' If no command line option is specified then the application
' defaults to the address http://icanhazip.com
' Source code compiled with FreeBASIC Compiler - Version 1.09.0 (2021-12-31)
#include "windows.bi"
#include "win\wininet.bi"
Declare Function __getmainargs Cdecl Alias "__getmainargs" (Byval As Integer Ptr,_
Byval As Zstring Ptr Ptr Ptr,Byval As Zstring Ptr Ptr Ptr,_
Byval As Integer,Byval As LPSTARTUPINFO) As Integer
Public Function StdOut ( Zstr As Zstring Ptr) As Integer
Dim As HANDLE hOutput
Dim As DWORD bWritten
hOutput=GetStdHandle(STD_OUTPUT_HANDLE)
WriteFile(hOutPut,Zstr,lstrlen(ZStr),@bWritten,NULL)
Function=bWritten
End Function
Function main () As Integer
Dim As Integer i,RetVal
Dim As HINTERNET hInt,hUrl
Dim As WINBOOL Irf
Dim As DWORD BuffSize
Dim As LPCSTR url
Dim As ZString * 128 App
Dim As ZString * 68 IpAddr
Dim As ZString Ptr Buffer=@IpAddr
Dim As Integer argc
Dim As ZString Ptr Ptr argv
Dim As ZString Ptr Ptr env
Dim As Integer sinfo=0
__getmainargs(@argc,@argv,@env,0,Cast(LPSTARTUPINFO,@sinfo))
If argc=1 Then
url=Cast(ZString Ptr,@"http://icanhazip.com")
Else
url=argv[1]
End If
GetModuleFileName(0,@App,128)
hInt=InternetOpen(@App,INTERNET_OPEN_TYPE_PRECONFIG,0,0,0)
If hInt=0 Then Return 1
hUrl=InternetOpenUrl(hInt,url,0,0,0,0)
If hUrl=0 Then
InternetCloseHandle(hInt)
Return 2
End If
Irf=InternetReadFile(hUrl,@IpAddr,64,@BuffSize)
InternetCloseHandle(hUrl)
If Irf=0 Then
InternetCloseHandle(hInt)
Return 3
End If
*Cast(Ubyte Ptr,Buffer+BuffSize)=0
For i=1 To BuffSize
If *Cast(Ubyte Ptr,Buffer)<32 Then *Cast(Ubyte Ptr,Buffer)=32
Buffer+=1
Next i
StdOut IpAddr
InternetCloseHandle(hInt)
Return 0
End Function
Sub mainCRTStartup Cdecl Alias "mainCRTStartup"()
ExitProcess(main())
End Sub
QuoteWhilst Hutch (and perhaps others seemed Keen to resist almost Any change to the forum that departed from Hutch's Grand Design etc), ..... I think the Masm side of things is still extremely strong here and the Forum has developed it's own World Wide understanding with regard to it's MASM purpose :)
That being said though, it Does have a diverse membership, seriously involved in all manner of interests and activities, which,.. seeing as it is (perhaps sadly), no longer merely Steve's own Playground,.. but now yours, the Members, I feel it should be allowed to develop and reflect the interests and wishes of those involved and interested members :)
Not in every case ofcourse, but there Did seem to be some interest in this, so was simply wondering, if it is still something that is worth setting up ??