Re: Using a C++ Win32 DLL internally in an ActiveX deployed on a webpage



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.

.



Relevant Pages

  • Re: ActiveX object doesnt get installed at client
    ... if I download the dll and register it with regsvr32 on the client it runs as it should. ... So there doesn't seem to be any dependencys missing. ... The process I use to deploy the activex dll is just to copy it with the website to the webserver. ...
    (microsoft.public.vc.atl)
  • Re: DLL blocked when called asynchronously from ASP via ActiveX EXE
    ... I'll have another think Simon but it looks like diagnostic files will help ... The only other thing that comes to mind is that your ActiveX DLL must have ... though I don't think it's the client to EXE ... The minute I call into the DLL from the ActiveX ...
    (microsoft.public.vb.com)
  • Re: Java Applet Funktionalität in ASP.Net
    ... Ja indem du per Tag eine dotnet dll einbindest, ... Programmierung, also Applets, ActiveX, einschließlich javascript. ... ..NET Framework basierende Komponente" ist also keineswegs unsicherer. ... Packe dein Windows Formular in eine Windows Control Library, ...
    (microsoft.public.de.german.entwickler.dotnet.asp)
  • Re: why some dlls are scriptable and some are not?
    ... which is the same as ActiveX. ... So a COM DLL is also an ActiveX DLL. ... through its "OLE" functions to read type libraries. ... An object browser shows the methods and properties ...
    (microsoft.public.scripting.vbscript)
  • Re: Java Applet Funktionalität in ASP.Net
    ... >> Applets in normalen HTML Seiten hinzubekommen? ... > Packe dein Windows Formular in eine Windows Control Library, ... > du eine DLL. ... Bei ActiveX wird ja auch local beim Client was installiert, ...
    (microsoft.public.de.german.entwickler.dotnet.asp)

Loading