Displaying ActiveX control in modeless dialog



First, let me start by saying that I am a Java programmer, so
MFC/Windows programming is a little foreign to me.

I have an image capture device that is controlled by an ActiveX
control, and I need to integrate this into a Java application. The
control can display a live video feed from the device, and fires events
at various times (i.e. when an image is captured). What I would like to
do is:

1. Create the ActiveX control.
2. Connect to the device to get and set properties without displaying
the control.
3. Present some options to the user (in the Java app) based on
information gathered from the device.
4. Display the control to show the video.
5. When an image is captured, return the image to Java and hide the
control. The Java app will perform some additional processing on the
image.
6. Repeat steps 4-5 for additional images.
7. Disconect from the device and destroy the control.

To do this, I have created a dialog class (derived from CDialog) to
host the control. If I make it a modeless dialog (construct, call
Create, then call ShowWindow), I don't receive any events from the
device when an image is captured. The scanner beeps when and image is
captured, so I know that part works, but I don't get the event. Also,
when I mouse over the control, the cursor turns to an hourglass.

If I make it a modal dialog, I cannot interact with the control until I
call DoModal, but I want to do so before displaying it. For testing
purposes, I tried changing my dialog to be initially visible and I
called Create, then called DoModal later. I got an assertion failure as
expected, but the control was visible (from when I called Create), and
when an image was captured, I got the event, even though the assertion
message was on screen.

I suppose I could create a modeless dialog without displying it, just
to get the info I need for steps 2-3 above, then for steps 4-5 I could
create a new modal dialog each time. However, initializing the device
takes a few seconds, so doing this repeatedly will make the process
seem slow for the user, especially since they usually capture 10-15
images at a time.

How can I get this to work properly? Could I use something other than
CDialog? Could I programmatically create the ActiveX control and drop
it into some other window if I have its HWND? Currently I am using the
Visual Studio dialog editor and class wizard to create my dialog. Any
help would be appreciated.

.



Relevant Pages

  • Re: MFC future?
    ... all ILs assume the programmer wants less control ... ... when people look at IL-based systems today they tend to be thinking of Java ... In Java there can be serious resource management problems because the ...
    (microsoft.public.vc.mfc)
  • Re: Problems capturing audio with Intel ICH5...
    ... Maybe gnome-mixer does not give you access to the relevant capture ... I guess I tried every single control, they're even too many, but this ... Simple mixer control 'Surround',0 ... Capture channels: ...
    (Debian-User)
  • Re: Tuesday 3rd April update wont work
    ... I only see the following two Java entries; ... Wuweb is for Windows Update, ... Add/Remove Programs in the Control Panel? ... In the opened folder, rename the folder SoftwareDistribution to Sdold. ...
    (microsoft.public.windowsupdate)
  • Re: Menu Control Odd Behavior
    ... Steven Cheng ... Can the request be extracted from a network monitor like Ethereal? ... How can I capture the request on the client side, ... For the Menu control, I haven't got any definite problem against the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Read wmcap.exe output in Java.
    ... AMCap uses DirectShow to build a capture graph. ... SampleGrabber all have guides in the DirectShow docs. ... DirectShow in Java. ...
    (microsoft.public.windowsmedia.sdk)

Quantcast