CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Data passing

  1. #1
    Join Date
    Nov 2008
    Posts
    4

    Data passing

    I'm working on a DLL which will serve as the back end or engine for an arbitrary Win32 GUI front end to connect to. My back end should have no graphical code, of course. What I'm making is an interface for a camera-like device. This device has an SDK I'm using which utilizes CALLBACKs. Through several of these callbacks, which run in their own thread, I receive an image (as an object) from the camera device. I need an efficient way to forward this image to the Win32 GUI developer without exposing him to the SDK's callback functions. This image must be immediately forwarded because the Win32 Developer may want to display it the moment it is received, as these images are continually streaming from the device. (Ultimately, if you were to display the images as they came from the device, what you would get is a video in real-time of the images being captured by the device).

    I'm not asking anyone here to solve my problem, but, as an entry level coder, I would like input as to what my options are and what the pros and cons are to each solution. I am concerned with speed.

    I'm using MS VS 2008 on Windows XP to write the DLL in C++. The SDK is a DLL and static LIB written in C using an unknown compiler. I don't know how relevant that info is, but, there it is.

    Thanks in advance to those who reply.
    Last edited by praenato14; March 22nd, 2011 at 12:42 PM. Reason: Added additional info

  2. #2
    Join Date
    Feb 2011
    Posts
    32

    Re: Data passing

    That sounds like a classical 2d animation.

  3. #3
    Join Date
    Jul 2002
    Posts
    2,543

    Re: Data passing

    You need to pass these images to UI level using callbacks. In C++ callbacks are easy to implement using callback interface, something like this:
    Code:
    class ICallback
    {
        virtual void ImageAcquired( image-parameters ) = 0;
    };
    Client creates its own class derived from this interface, and passes pointer to this class as ICallback* to your Dll. When Dll receives an image from low level, it calls ImageAcquired function.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured