Very new to BMax: I need help here with DLL's

BlitzMax Forums/BlitzMax Programming/Very new to BMax: I need help here with DLL's

bytecode77(Posted 2007) [#1]
hi!

i need some help here using the kernel32 dll!

this is a bb program


it contains a library in which you can easily set up pixels. i tried to port it to bmax, but first i needed to import the kernel DLL, but i just didn't figure out how :(

can somebody help me here, please?
thanks a lot :)


Azathoth(Posted 2007) [#2]
Something like
Extern "Win32"
	Function apiRtlMoveMemory(Destination:Byte Ptr,Source:Byte Ptr,Length)="RtlMoveMemory@12"
EndExtern

or
Extern "Win32"
	Function RtlMoveMemory(Destination:Byte Ptr,Source:Byte Ptr,Length)
EndExtern



bytecode77(Posted 2007) [#3]
and what exactly do i do with this?
you know i'm a pro in BB and a beginner in bmax


Gabriel(Posted 2007) [#4]
BlitzMax has a MemCopy command which can be used instead. It takes two pointers and a length, just as yours do.

EDIT: Not that there's anything wrong with Azathoth's response. I just cross-posted.


bytecode77(Posted 2007) [#5]
wow quick answer :)

so, how do i USE this command instead of that one?


Azathoth(Posted 2007) [#6]
It defines the function RtlMoveMemory, you put it at the top of your program.

Edit: If you're uncertain whether the memory blocks over lap you could use MemMove, instead of MemCopy.


bytecode77(Posted 2007) [#7]
Extern "Win32"
	Function RtlMoveMemory(Destination:Byte Ptr,Source:Byte Ptr,Length)
EndExtern


so i only put in this piece of code, and i can use RtlMoveMemory as default?

and how do i access the BackBuffer ?


Azathoth(Posted 2007) [#8]
so i only put in this piece of code, and i can use RtlMoveMemory as default?
Yep.


bytecode77(Posted 2007) [#9]
and how do i access the BackBuffer ?
i need the pointer of the backbuffer


bytecode77(Posted 2007) [#10]
well thats just whats missing. i need the pointer to the backbuffer. in BB you usualy get this with BackBuffer()


tonyg(Posted 2007) [#11]
There's not the same easy way in Bmax as far as I know.
You can try the following :
graphics800,600
Local renderSurf:IDirectDrawSurface7
D3D7GraphicsDriver().Direct3DDevice7().GetRenderTarget Varptr renderSurf

to get one from DX.