hello everybody,i got trouble again
-
- Newcomer
- Posts: 11
- Joined: Wed Mar 12, 2014 8:43 am
hello everybody,i got trouble again
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.
Re: hello everybody,i got trouble again
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:
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()
Re: hello everybody,i got trouble again
CBSDK also has functions (including MessageBox) which use WinAPI (these functions are in cbAPI.cb file). It also has functions for making other user interface stuff etc. Take a look at the examples.
-
- Newcomer
- Posts: 11
- Joined: Wed Mar 12, 2014 8:43 am
Re: hello everybody,i got trouble again
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()
Re: hello everybody,i got trouble again
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)
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
-
- Newcomer
- Posts: 11
- Joined: Wed Mar 12, 2014 8:43 am
Re: hello everybody,i got trouble again
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
how to use string type?some questions like this
-
- Newcomer
- Posts: 11
- Joined: Wed Mar 12, 2014 8:43 am
Re: hello everybody,i got trouble again
I tried this example
but there isn't any response
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