Innovative Integration
 
Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Running Armada programs without MFC

 
Post new topic   Reply to topic    II Support Forum Index -> ChicoPlus
View previous topic :: View next topic  
Author Message
csmith
Site Admin


Joined: 13 Apr 2006
Posts: 203

PostPosted: Thu Apr 13, 2006 4:30 pm    Post subject: Running Armada programs without MFC Reply with quote

Chico Plus programs and the Armada library do not require MFC, but they do require a functioning message loop to process windows messages. MFC creates a main message loop automatically.

Programs that don't have a message loop can create one using this library function:

Code:

    //
    //  Note will not return until WM_QUIT is posted...
    IICali_MessageLoop();


This function will stay in the message loop and not return. To leave the message loop, use this function:

Code:

    PostThreadMessage(id, WM_QUIT, 0, NULL);


In the example, this is called by the control-C handler. The arrival of data prints a line of text to the screen, until a control-C is hit.

Included is a VC6 project including source. The program may need some change to run with current versions of Armada, but the source shows what is needed to create a message loop if you don't have one.

_________________
Chris Smith
Innovative Integration
csmith@innovative-dsp.com
Back to top
View user's profile Send private message
msvilans



Joined: 16 May 2006
Posts: 12

PostPosted: Tue May 16, 2006 12:36 pm    Post subject: Reply with quote

Can this code be used in C++ Builder?

I would like to have the Armada acquisition code run in a thread separate from the main C++ Builder thread.

Regards,
Markus.
Back to top
View user's profile Send private message
csmith
Site Admin


Joined: 13 Apr 2006
Posts: 203

PostPosted: Thu May 18, 2006 1:47 pm    Post subject: Reply with quote

The code above is for use in a case where you want to use the MSVC DLL without a window, in a non MFC environment. Builder cannot create a project that does not have a window as far as I know, so the problem does not come up there. Also, while you can call the DLL functions from Builder, they are wrappers for Armada calls, so you might as well use Armada directly.

If you are in general asking how to use Multithreading in a Builder app, that really belongs in its own topic rather than here. If you could ask a more specific question we could answer it.

In general, there is no problem using threads in a Builder application. Armada uses background threads for data acquisition. There are ways to get at the data in a background thread before it is split and moved into the main thread context. It is also not a real problem to take the data provided in the foreground thread and deliver it to a background thread for processing. What solution is closest to what you need requires a more detailed explanation of what you are trying to do.

_________________
Chris Smith
Innovative Integration
csmith@innovative-dsp.com
Back to top
View user's profile Send private message
msvilans



Joined: 16 May 2006
Posts: 12

PostPosted: Thu May 18, 2006 4:14 pm    Post subject: Reply with quote

Hi Chris,

Apologies for being vague. I have posted a more detailed question in a new topic.

Regards,
Markus.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    II Support Forum Index -> ChicoPlus (GMT - 8 Hours)
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

© Copyright 2006-2012 Innovative Integration
Powered by phpBB © 2001, 2002 phpBB Group
Based on iCGstation v1.0 Template By Ray © 2003, 2004 iOptional