hello everybody,i got trouble again
Posted: Sat Sep 13, 2014 5:04 pm
i don't know how to use CallDll command
i wanna use winapi,just like messagebox
i don't know how to write argument
can someone tell me,and write a example?
please.
Game Making Should Be Easy...
https://www.coolbasic.com/phpBB3/
Code: Select all
ShowWindow()
FlashWindow()
MoveWindow()
SetWindowAlpha()
SwitchWindow()
DestroyWindow()
CreateRoundWindow()
CreateRectRoundWindow()
HideMenu()
OpenCDTray()
ScreenW()
ScreenH()
Beep()
MsgBox()
HideWindowsTaskBar()
SetTaskBarAlpha()
SetCursorPos()
_PutPixel()
BlockInput()
HideDesktopIcons()
ShowCursor()
LockWorkStation()
TextOut()
MouseEvent()
_MouseX()
_MouseY()
SwapMouseButton()
SetLockLed()
GetAscKey()
TypeStr()
_GetPixel()
SetWindowText()
GetEnv()
I just wanna know how to use CallDll command.......CCE wrote:The CoolBasic DLL support is really limited and you cannot call WinAPI DLLs as is.
There is a wrapper library called cbFUN that has some this functionality. To use it you need to download the SDK and then extract the files to the CoolBasic directory.
List of supported functions:Code: Select all
ShowWindow() FlashWindow() MoveWindow() SetWindowAlpha() SwitchWindow() DestroyWindow() CreateRoundWindow() CreateRectRoundWindow() HideMenu() OpenCDTray() ScreenW() ScreenH() Beep() MsgBox() HideWindowsTaskBar() SetTaskBarAlpha() SetCursorPos() _PutPixel() BlockInput() HideDesktopIcons() ShowCursor() LockWorkStation() TextOut() MouseEvent() _MouseX() _MouseY() SwapMouseButton() SetLockLed() GetAscKey() TypeStr() _GetPixel() SetWindowText() GetEnv()
You usually have to make your own dll for that because CB expects all dll functions to be declared as:lanslotfrog wrote: I just wanna know how to use CallDll command.......
Code: Select all
extern "C" __declspec( dllexport ) void myfunction(const int *memIn, int memInSize, int *memOut, int memOutSize) {
// memIn contains pointer to input memblock data and memInSize is the memblock size.
//same thing for memOut
//You have to return values by writing them to output memblock
}
Code: Select all
CallDLL "mydll.dll", "myfunction", memIn, memOut
i mean that i don't know how to write argument use MakeMemBlock functionLatexi95 wrote:You usually have to make your own dll for that because CB expects all dll functions to be declared as:lanslotfrog wrote: I just wanna know how to use CallDll command.......
(C++ code)Then you could call the function with CallDll:Code: Select all
extern "C" __declspec( dllexport ) void myfunction(const int *memIn, int memInSize, int *memOut, int memOutSize) { // memIn contains pointer to input memblock data and memInSize is the memblock size. //same thing for memOut //You have to return values by writing them to output memblock }
Code: Select all
CallDLL "mydll.dll", "myfunction", memIn, memOut
Code: Select all
Include "sdk/include/cbAPI.cb"
Const MID_NEWTEXT = 1
Const MID_NEWIMAGE = 2
Const MID_OPENFILE = 3
Const MID_SAVEFILE = 4
Const MID_EXIT = 5
subID = CreatePopupMenu()
AddPopupMenuItem(subID, MID_NEWTEXT, "Uusi tekstitiedosto")
AddPopupMenuItem(subID, MID_NEWIMAGE, "Uusi kuvatiedosto")
popupID = CreatePopupMenu()
AddPopupSubMenu(popupID, subID, "Uusi")
AddPopupMenuSeparator(popupID)
AddPopupMenuItem(popupID, MID_OPENFILE, "Avaa")
AddPopupMenuItem(popupID, MID_SAVEFILE, "Talleta")
AddPopupMenuSeparator(popupID)
AddPopupMenuItem(popupID, MID_EXIT, "Lopeta")
Repeat
If MouseHit(2) Then
cmd = ShowPopupMenu(popupID, MouseX(), MouseY())
If cmd = MID_EXIT Then End
EndIf
Forever