Solved

Creating an application in a DLL - Is it possible??

Posted on 2000-04-26
1
227 Views
Last Modified: 2013-11-13
Hi,

      I am writing a java based application that needs to control a PCI Card (TV card to be exact). The card offers two SDK API's, one is an activeX component (ocx file) the other is C++. In both API's the card requires a window to be opened in order to initialise. Using the activeX API this requires an MFC SDI app to be created (window with doc/view). The C++ API requires a Win32 app to be created.

     What I want to know is can I create the required application within a DLL (no exe) using either threads or the dll entry points? I have managed to create a window that is launched from the dll using a class derived from CWinThread but I was unable to create the doc/view required.

     Can anyone help with this? What I want to do is create a windows application that can be launched from a DLL. Are there any alternatives (taking into account that the java program must be able to control the card?) Thanks in advance to anyone who has any idea of how to go about this..

    Darren.

0
Comment
Question by:Darren_B
1 Comment
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 200 total points
ID: 2757558
If you want to do this within a DLL, I would skip the MFC version. This way, you don't have to worry about the Doc/View model. I would instead use CreateWindow() API call and try to get the C++ API to work with that window. Typically, you shouldn't need to use a separate thread. You can usually assume that whatever thread called your DLL would have a UI thread on it. That way you don't have to worry about a message loop for that thread.

One way to do this is that if there is a C++ class that does most of the work, then I would create a global instance of the DLL and then provide functions in the DLL to manipulate the global instance. For example,

CCard g_Card;

__declspec(export) void UseMethodA()
{
  g_Card.MethodA();
}

You can do the same for the rest of the methods.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

823 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question