OmniThreadLibrary forum
News: SMF - Just Installed!
 
*
Welcome, Guest. Please login or register. May 17, 2012, 06:06:00 PM


Login with username, password and session length


Pages: [1]   Go Down

Author Topic: Newbie ... Using OTL on a DLL with VCL component and callback.  (Read 319 times)

TrajanoCosta

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Newbie ... Using OTL on a DLL with VCL component and callback.
« on: January 10, 2012, 08:47:30 PM »

Hi all. I am new in OTL and multithreading.

I want to create a dll with a vcl component to capture frames from the webcam. In the dll I create the instance of visual component and assign a callback funtion for the event in frame captures.
Something like this:

type tframegrabberevent = procedure (bmp : Tbitmap); stdcall;

var FG : TFrameGrabber;
     Fframe : tframegrabberevent

...

FG := TFrameGrabber.create(nil);

FG.onframegrabber = Fframe.

When a call the dll from a application I assign the Fframe to a function in the application to receive the bitmap!

That's all

My question is: Can I use OTL to start the process in dll in a multitask way, in a thread different of application? and yet communicate a function address (callback) betwen app and dll?

I thank to all for any response.



Logged

Primoz Gabrijelcic

  • Administrator
  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • Email
Re: Newbie ... Using OTL on a DLL with VCL component and callback.
« Reply #1 on: January 11, 2012, 01:53:06 AM »

Sorry, you got me there - I've never used OTL in a DLL.

A short answer would be - if a TThread-based version would work in you scenario, OTL-based version should also work as they use identical mechanisms.
Logged

TrajanoCosta

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Newbie ... Using OTL on a DLL with VCL component and callback.
« Reply #2 on: January 11, 2012, 02:18:13 PM »

I will try and post the results here.

Thank you!
Logged
Pages: [1]   Go Up
 
 

Powered by MySQL Powered by PHP Powered by SMF 2.0.2 | SMF © 2006-2009, Simple Machines LLC

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM