Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: C++/MATLAB Progress Bar

Subject: C++/MATLAB Progress Bar

From: Sean Larkin

Date: 18 Jul, 2008 19:32:01

Message: 1 of 3

I am calling a lengthy C++ program(dll) from MATLAB with the
calllib function. I would like to display a dialog box with
a progress bar that updates as the C++ program executes.
The length of time for the C++ program varies so I never
know how long it will take. I tried to create a progress
bar in C++, but I get a dialog box that pops up that says
:"An unsupported operation was attempted." There may be an
error in my C++ code, but everything compiled correctly. I
wanted to know if this type of operation of creating a
progress bar in C++ a program called by MATLAB is even
possible. Or if anyone has any good ideas please let me
know. Thanks.

Subject: C++/MATLAB Progress Bar

From: Tim Davis

Date: 18 Jul, 2008 19:51:02

Message: 2 of 3

"Sean Larkin" <slarkin71278@sbcglobal.net> wrote in message
<g5qr3h$2la$1@fred.mathworks.com>...
> I am calling a lengthy C++ program(dll) from MATLAB with the
> calllib function. I would like to display a dialog box with
> a progress bar that updates as the C++ program executes.
> The length of time for the C++ program varies so I never
> know how long it will take. I tried to create a progress
> bar in C++, but I get a dialog box that pops up that says
> :"An unsupported operation was attempted." There may be an
> error in my C++ code, but everything compiled correctly. I
> wanted to know if this type of operation of creating a
> progress bar in C++ a program called by MATLAB is even
> possible. Or if anyone has any good ideas please let me
> know. Thanks.

Try the "waitmex" function on the File Exchange at MATLAB
central. Unsure if it will work in the context of calllib,
though.

Subject: C++/MATLAB Progress Bar

From: Bruno Luong

Date: 18 Jul, 2008 20:08:02

Message: 3 of 3

"Sean Larkin" <slarkin71278@sbcglobal.net> wrote in message
<g5qr3h$2la$1@fred.mathworks.com>...
> I
> wanted to know if this type of operation of creating a
> progress bar in C++ a program called by MATLAB is even
> possible.

Yes, I have programmed a C program that computes in the long
for-loop and call a MATLAB post-processing routine at each
iteration. The MATLAB routine takes care of the waitbar. It
works.

mxArray *rhs[narg];

/* ... */

for (i=0; i<niter; i++)
{
  mexCallMATLAB(0, NULL,
     narg, rhs, "PostProcessingStepFun");
}

%%

function PostProcessingStepFun(varargin)
  % ... initialize/update waitbar_h and x
  waitbar(x, waitbar_h);
  % ...
end

% Bruno

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
c matlab progress bar Sean Larkin 18 Jul, 2008 15:35:04
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics