Home » Community » Newbie corner » How to link to multiple DLLs
|
Re: How to link to multiple DLLs [message #43511 is a reply to message #43510] |
Thu, 14 August 2014 08:51   |
 |
koldo
Messages: 3432 Registered: August 2008
|
Senior Veteran |
|
|
Hello Jerson
There is no problem to call many DLLs from a single program.
In case of Functions4U you can have as many Dl classes as you want. Every Dl class represents a DLL through Dl::Load(fileDll). With Dl::GetFunction(functionName) you get a pointer to the functions you will use.
Anyway user32 functions can be called directly. I mean, for example, you can include this in your C++ code:
::SendMessage(hwnd, WM_SYSCOMMAND, 0xf008, MAKELONG(p.x, p.y));
::SetWindowPos(hdlg, NULL, p.x, p.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
::DestroyWindow(hwnd);
Best regards
Iñaki
|
|
|
Re: How to link to multiple DLLs [message #43512 is a reply to message #43511] |
Thu, 14 August 2014 13:46   |
jerson
Messages: 202 Registered: June 2010 Location: Bombay, India
|
Experienced Member |

|
|
Hello Koldo
Thanks for your valuable input
Am I doing this DLI declaration right?
FN(WORD, capCreateCaptureWindowA, (String WindowName, int32 Style,int32 x, int32 y, int32 Width, int32 Height, int32 hParent, int32 ID));
/*
* '--The capCreateCaptureWindow function creates a capture window--
* Declare Function capCreateCaptureWindowA Lib "avicap32.dll" _
* (ByVal lpszWindowName As String, ByVal dwStyle As Integer, _
* ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, _
* ByVal nHeight As Short, ByVal hWnd As Integer, _
* ByVal nID As Integer) As Integer
*
I keep getting this error with the pointer under capCreateCaptureWindowA
c:/..../avicap32.dli:1:10: error: expected ')' before 'capCreateCaptureWindowA_type'
FN(WORD, capCreateCaptureWindowA, (char *WindowName, long Style,long x, long y, long Width, long Height, long hParent, long ID));
^
C:\upp\uppsrc/Core/dli.h:42:23: note: in definition of macro 'FN_CN'
typedef retval (call fn##_type) args; fn##_type *fn;
I have not used a header file and have put the following lines into my main.c
#define DLLFILENAME "avicap32.dll"
#define DLIMODULE avicap32
#define DLIHEADER <LM/avicap32.dli>
#define DLLCALL LNPUBLIC
#include <Core/dli.h>
What am I doing wrong?
PS:
I think I figured it out somewhat. this is what compiled for me. However, I will still appreciate some insight into why this works. Why does FN_C work and not FN?
void MyAppWindow::CapStart(void)
{
HWND hwnd;
hwnd = avicap32().capCreateCaptureWindowA("WebCam", WS_VISIBLE | WS_CHILD,0,0,640,480,picCapture.GetHWND(), 0);
}
In DLI file
FN_C(HWND, WINAPI, capCreateCaptureWindowA,
(const char *WindowName, UINT Style,UINT x, UINT y, UINT Width, UINT Height, HANDLE hParent, UINT ID))
[Updated on: Thu, 14 August 2014 14:45] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Sat Apr 26 18:23:18 CEST 2025
Total time taken to generate the page: 0.00843 seconds
|