Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2000-04-26
1
Medium Priority
?
247 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 600 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

618 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