Run dll rundll32

New to FreeBASIC? Post your questions here.
Post Reply
gerry
Posts: 70
Joined: Oct 04, 2021 7:29

Run dll rundll32

Post by gerry »

Hi all! How to create a dll library and execute it through rundll32? Let's say

Code: Select all

Sub Main()
Print "Hello, world!"
End Sub
Example, cmd.exe > fbc32/fbc64 -dll example.bas
Example, cmd.exe > rundll32 example.dll,Main
UEZ
Posts: 988
Joined: May 05, 2017 19:59
Location: Germany

Re: Run dll rundll32

Post by UEZ »

Try this:

Code: Select all

#Include Once "windows.bi"
Extern "Windows-MS"
	Sub Main() Export
		MessageBoxEx(Null, "Hello, world!", "DLL Information", MB_ICONINFORMATION OR MB_OK Or MB_APPLMODAL Or MB_TOPMOST, 1033)
	End Sub
End Extern
Compile it with parameter -dll -export
gerry
Posts: 70
Joined: Oct 04, 2021 7:29

Re: Run dll rundll32

Post by gerry »

UEZ wrote: Aug 10, 2022 18:41 Try this:

Code: Select all

#Include Once "windows.bi"
Extern "Windows-MS"
	Sub Main() Export
		MessageBoxEx(Null, "Hello, world!", "DLL Information", MB_ICONINFORMATION OR MB_OK Or MB_APPLMODAL Or MB_TOPMOST, 1033)
	End Sub
End Extern
Compile it with parameter -dll -export
Thanks! Worked! :D
Post Reply