Page 1 of 1

Strange, Windows app working in Linux?

Posted: Mon Dec 25, 2006 5:50 pm
by GeoTrail
I was messing around on my backup drives and was testing to launch a few test programs I wrote for Windows some time ago. And some of them actually work perfectly. I haven't, that I know of, installed any emulators or anything like that. Just launched the program and it works.

Here's the code of one of the programs that works, it uses Windows API of all things

Code: Select all

Result = MessageBox_(0,"This is the text","This is the caption",#MB_CANCELTRYCONTINUE|#MB_ICONINFORMATION|#MB_DEFBUTTON2)



Select Result

	Case #IDABORT		; Abort button was selected.

		Selected$ = "IDABORT"

		MessageBox_(0,"You select " + Selected$ + ".","Result",#MB_OK)

	Case #IDCANCEL		; Cancel button was selected.

		Selected$ = "IDCANCEL"

		MessageBox_(0,"You select " + Selected$ + ".","Result",#MB_OK)

; 	Case #IDCONTINUE	; Continue button was selected.

; 		Selected$ = "IDCONTINUE"

; 		MessageBox_(0,"You select " + Selected$ + ".","Result",#MB_OK)

	Case #IDIGNORE		; Ignore button was selected.

		Selected$ = "IDIGNORE"

		MessageBox_(0,"You select " + Selected$ + ".","Result",#MB_OK)

	Case #IDNO			; No button was selected.

		Selected$ = "IDNO"

		MessageBox_(0,"You select " + Selected$ + ".","Result",#MB_OK)

	Case #IDOK			; OK button was selected.

		Selected$ = "IDOK"

		MessageBox_(0,"You select " + Selected$ + ".","Result",#MB_OK)

	Case #IDRETRY		; Retry button was selected.

		Selected$ = "IDRETRY"

		MessageBox_(0,"You select " + Selected$ + ".","Result",#MB_OK)

; 	Case #IDTRYAGAIN 	; Try Again button was selected.

; 		Selected$ = "IDTRYAGAIN"

; 		MessageBox_(0,"You select " + Selected$ + ".","Result",#MB_OK)

	Case #IDYES			; Yes button was selected.

		Selected$ = "IDYES"

		MessageBox_(0,"You select " + Selected$ + ".","Result",#MB_OK)

	Default

		Selected$ = Str( Result )

		MessageBox_(0,"You select " + Selected$ + ".","Result",#MB_OK)		

EndSelect





End

;- End of program



; IDE Options = PureBasic v4.01 (Windows - x86)

; Folding = -

; Executable = API_MessageBox.exe

Posted: Mon Dec 25, 2006 5:55 pm
by WishMaster

Code: Select all

user@linux:~> /usr/share/purebasic/compilers/pbcompiler /your/test/file.pb

******************************************
PureBasic 4.00 - Beta 1 (Linux - x86)
******************************************

Loading external modules...
Starting compilation...
Error: Line 1 - MessageBox_() is not a function, array, macro or linked list
user@linux:~>

Posted: Mon Dec 25, 2006 6:06 pm
by GeoTrail
No I have already compiled the code in Windows. The compiled exe is for Windows, but it works here.

Try this http://robert.geotrail.no/API_MessageBox.exe

Posted: Mon Dec 25, 2006 6:15 pm
by Trond
it's probably run with wine.

Posted: Mon Dec 25, 2006 6:51 pm
by GeoTrail
Aaa yeah I searched in the package manager and Wine Windows Emulator is installed. Pretty cool that it works though. Many Windows installations works too. Just tried a few just for fun.