Re: Using a C++ Win32 DLL internally in an ActiveX deployed on a webpage
- From: robert@xxxxxxxxxxx
- Date: 17 Jul 2006 08:26:09 -0700
Well, I would guess that first of all you'll need to ensure that the
dll-file can be retrieved by your active-X component on the client
machine. A quick and dirty solution would be to dump the dll into the
windows\system32 folder so that any program can load the dll. However,
it would be cleaner to place the dll file in the same folder where your
Active-X control is being installed. In order for your control to
locate your dll you could do something like this:
TCHAR ocxfname[512];
GetModuleFileName(m_hInstance, ocxfname, 512);
CString str = ocxfname;
int sc = str.ReverseFind(_T('\\'));
CString path = str.Mid(0,sc);
path = path + _T("\\mydllfile.dll");
Knowing the full pathname of your dll file you can now call
LoadLibrary() with the path argument and then GetProcAddress() for the
particular functions that your Active-X control wishes to use.
I've here assumed that your dll file is not a class dll (i.e. an
exported C++ class) since GetProcAddress on a class dll is virtually
impossible due to the name mangling of the member functions done by the
compiler.
Rob
ritulranjan@xxxxxxxxx wrote:
Hi,
I am some what new to Visual C++ environment, so please forgive any
trivial queries made, but do reply.
Can an MFC ActiveX control use a C++ DLL internally to process
information. The ActiveX DLL here, is provides a GUI component to be
embedded on a webpage and also process data which it receives through
the DLL (through sockets).
How should the DLL be structured so that it can be used by the ActiveX
control on the client machine, without actually registering the itself
(the ActiveX gets registered by IE, but I don't want the DLLs ActiveX
control uses to get registered)?
I have created the DLL libraries (with classes to be used, spanned over
multiple libraries). Should I create a wrapper of all these libraries?
Is yes, how should the wrapper be strctured?
I want the ActiveX to create an object and use that object to process
data.
Thanks in advance for answering my query.
regards,
Ritul.
.
- Follow-Ups:
- References:
- Using a C++ Win32 DLL internally in an ActiveX deployed on a webpage
- From: ritulranjan
- Using a C++ Win32 DLL internally in an ActiveX deployed on a webpage
- Prev by Date: Re: Problems resizing CListCtrl
- Next by Date: Re: how to Explore Drive
- Previous by thread: Using a C++ Win32 DLL internally in an ActiveX deployed on a webpage
- Next by thread: Re: Using a C++ Win32 DLL internally in an ActiveX deployed on a webpage
- Index(es):
Relevant Pages
|
Loading