<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: progress bar in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828627#M51270</link>
    <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Yes, thanks, USE DFWIN works Ok.&lt;/SPAN&gt;
&lt;P&gt;But after this there is still something missing:&lt;/P&gt;
&lt;P&gt;Compiling Fortran...&lt;/P&gt;
&lt;P&gt;Warning: Variable HWND is used before its value has been defined.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;In fact, HWND &lt;SPAN&gt;(&lt;/SPAN&gt;which is used in the first line of the code kindly provided by &lt;SPAN&gt;Paul-Curtis&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;has not been defined in my program. My dialog was initialized by &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;recursive subroutine DoDialog( dlgParent, id, callbacktype )&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;without any handlers&lt;/SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 20 Apr 2005 17:24:12 GMT</pubDate>
    <dc:creator>dan789</dc:creator>
    <dc:date>2005-04-20T17:24:12Z</dc:date>
    <item>
      <title>progress bar</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828619#M51262</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;Dear colleagues, &lt;/P&gt;
&lt;P&gt;I have written a Windows dialog-based application on the basis of the Whizzy example from the CVF 6.5 samples. I am performing sophisticated calculations described by my own subroutine, and want that each time my subroutine calculates a new point the progress bar in the dialog box be updated. However this does not happen: the progress bar first shows 0%, then (when ALL the calculations are finished) it is changed to 100%. (I am also unable to change any of the static text controls of the dialog until the program stops). Could you please help me to get it working smoothly? Here is my code for the progress bar: &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: black 1px solid; PADDING-RIGHT: 10px; BORDER-TOP: black 1px solid; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; BORDER-LEFT: black 1px solid; PADDING-TOP: 10px; BORDER-BOTTOM: black 1px solid"&gt;&lt;SPAN class="text_smallest"&gt;Code:&lt;/SPAN&gt;&lt;PRE&gt;retlog = DlgSet(dlg, IDC_PROGRESS, 0, DLG_RANGEMIN) 
retlog = DlgSet(dlg, IDC_PROGRESS, 500, DLG_RANGEMAX) 
retlog = DlgSet(dlg, IDC_PROGRESS, 0) 
do i = 1, 500 
   retlog = DlgSet(dlg, IDC_PROGRESS, i) 
   call PointCalc(i,[other parameters]) 
enddo 
&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Message Edited by Dan789 on &lt;SPAN class="date_text"&gt;04-19-2005&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;10:20 AM&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2005 00:14:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828619#M51262</guid>
      <dc:creator>dan789</dc:creator>
      <dc:date>2005-04-20T00:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: progress bar</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828620#M51263</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Here is how you run a progress bar in a Windows application.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;First, get the handle to the progressbar control within its parent dialog, hwnd:&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New"&gt;hwpb = GetDlgItem (hwnd, IDC_MY_BAR)&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New"&gt;rval = SendMessage (hwpb, PBM_SETRANGE, 0, MakeLong(0, maxsteps))&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New"&gt;rval = SendMessage (hwpb, PBM_SETPOS, 0, 0) ! start at 0&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New"&gt;rval = SendMessage (hwpb, PBM_SETSTEP, 1, 0) ! 1 unit steps&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Then, youshow progress by incrementing the bar displayfor each iteration of your loop or whatever:&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New"&gt;DO iter = 1, maxsteps&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New"&gt; ... your code ...&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New"&gt; rval = SendMessage (hwpb, PBM_STEPIT, 0, 0)&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New"&gt;END DO&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 20 Apr 2005 00:43:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828620#M51263</guid>
      <dc:creator>Paul_Curtis</dc:creator>
      <dc:date>2005-04-20T00:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: progress bar</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828621#M51264</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Hmm Thats what Ive got after this: 
&lt;P&gt;&lt;SPAN&gt;Compiling Fortran...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Error: This name does not have a type, and must have an explicit type.&lt;SPAN&gt; &lt;/SPAN&gt;[GETDLGITEM]&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Error: This name does not have a type, and must have an explicit type.&lt;SPAN&gt; &lt;/SPAN&gt;[SENDMESSAGE]&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;Message Edited by Dan789 on &lt;SPAN class="date_text"&gt;04-19-2005&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;01:50 PM&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2005 03:04:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828621#M51264</guid>
      <dc:creator>dan789</dc:creator>
      <dc:date>2005-04-20T03:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: progress bar</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828622#M51265</link>
      <description>&lt;DIV&gt;Well, the obvious stuff (type defines, includes, etc.) was left unstated in my code sample. GetDlgIgem is a standard Win32 API function, residing in USER32.lib, one of the standard Win32 component collections. My code simply INCLUDEs modules IFWIN and IFWINTY, which in turn include the relevent interface block for GetDlgItem (and every other Win32 API function you might need). If you search for GetDlgItem in the set of include files, the interface is found in USER32.f90, which you can open to inspect the arguments and calling convention for F90. Searching for GetDlgItem in the VS help immediately produces the complete documentation for this function (in a C context); you could also recover the same information by a search of the MSDN website.&lt;/DIV&gt;</description>
      <pubDate>Wed, 20 Apr 2005 10:49:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828622#M51265</guid>
      <dc:creator>Paul_Curtis</dc:creator>
      <dc:date>2005-04-20T10:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: progress bar</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828623#M51266</link>
      <description>&lt;DIV&gt;In otherwords, trying to update progress within a callback, even using 'dlgflush' does not work, when the computations are being done in a callback in the same thread. You have to go directly to the dialog control using SendMessage or SendDlgItemMessage. Thanks for the code Paul, it solves my similar problem trying to update edit boxes in a loop.&lt;/DIV&gt;</description>
      <pubDate>Wed, 20 Apr 2005 15:57:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828623#M51266</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2005-04-20T15:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: progress bar</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828624#M51267</link>
      <description>&lt;DIV&gt;Yes, this helps. I proceed a little bit:) That's what I've got after adding the "use user32" line:&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Compiling Fortran...&lt;BR /&gt;Error: This name does not have a type, and must have an explicit type. [MAKELONG]&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;PS.I didn't find any "ifwin" files. Only dfwin, msfwin, etc in the include directory&lt;/DIV&gt;</description>
      <pubDate>Wed, 20 Apr 2005 15:57:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828624#M51267</guid>
      <dc:creator>dan789</dc:creator>
      <dc:date>2005-04-20T15:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: progress bar</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828625#M51268</link>
      <description>&lt;DIV&gt;You are using CVF, so add USE DFWIN, which includes calls to USE USER32, which contains the interface block for SendMessage.&lt;/DIV&gt;</description>
      <pubDate>Wed, 20 Apr 2005 16:01:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828625#M51268</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2005-04-20T16:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: progress bar</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828626#M51269</link>
      <description>&lt;DIV&gt;MAKELONG(0,NUMBER) takes a 16-bit integer and makes it 32-bit, with NUMBER in the lowest 16-bits. I guess you could just make NUMBER a 4-byte integer and use it instead of MAKELONG(...).&lt;/DIV&gt;</description>
      <pubDate>Wed, 20 Apr 2005 16:05:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828626#M51269</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2005-04-20T16:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: progress bar</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828627#M51270</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Yes, thanks, USE DFWIN works Ok.&lt;/SPAN&gt;
&lt;P&gt;But after this there is still something missing:&lt;/P&gt;
&lt;P&gt;Compiling Fortran...&lt;/P&gt;
&lt;P&gt;Warning: Variable HWND is used before its value has been defined.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;In fact, HWND &lt;SPAN&gt;(&lt;/SPAN&gt;which is used in the first line of the code kindly provided by &lt;SPAN&gt;Paul-Curtis&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;has not been defined in my program. My dialog was initialized by &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;recursive subroutine DoDialog( dlgParent, id, callbacktype )&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;without any handlers&lt;/SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 20 Apr 2005 17:24:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828627#M51270</guid>
      <dc:creator>dan789</dc:creator>
      <dc:date>2005-04-20T17:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: progress bar</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828628#M51271</link>
      <description>&lt;DIV&gt;Your callback routines, attached to controls in your dialog 'dlgParent',should typically begin something like&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;SUBROUTINE ComputeSub( dlg, id, callbacktype )&lt;/DIV&gt;
&lt;DIV&gt;!DEC$ ATTRIBUTES DEFAULT :: ComputeSub&lt;/DIV&gt;
&lt;DIV&gt; use dflib&lt;BR /&gt; use dfwin&lt;BR /&gt; use dflogm&lt;BR /&gt; use Yourglobals&lt;/DIV&gt;
&lt;DIV&gt; implicit none&lt;/DIV&gt;
&lt;DIV&gt; type (dialog) dlg&lt;BR /&gt; integer id, callbacktype&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;The handle you want is given by dlg%hWnd in the dialog type 'dlg' given as the first argument in the callback routine. This is the windows handle to the dialog box that 'owns' the controls you want to send messages to.'Dlg' will be identical to dlgParent if the callback is attached to controls in dlgParent. So, wherever you see 'hWnd' in the example code given by Paul Curtis, just substitute 'dlg%hWnd'.&lt;BR /&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 20 Apr 2005 18:46:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828628#M51271</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2005-04-20T18:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: progress bar</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828629#M51272</link>
      <description>&lt;DIV&gt;nope, there is nothing like this in the program code&lt;/DIV&gt;
&lt;DIV&gt;I have attached a file of the sample provided with CVF. I have greatly modified this code, but I didn't introduce new structures there.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;btw. I have an idea why it's impossble to change the dialog controls while the calculations are running. I think it deals with the modal/non-modal use of the dialog.&lt;/DIV&gt;</description>
      <pubDate>Wed, 20 Apr 2005 19:03:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828629#M51272</guid>
      <dc:creator>dan789</dc:creator>
      <dc:date>2005-04-20T19:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: progress bar</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828630#M51273</link>
      <description>&lt;DIV&gt;Wow! it works:) I have a nicely working progress bar! &lt;/DIV&gt;
&lt;DIV&gt;Thank you, guys!&lt;/DIV&gt;</description>
      <pubDate>Wed, 20 Apr 2005 19:25:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/progress-bar/m-p/828630#M51273</guid>
      <dc:creator>dan789</dc:creator>
      <dc:date>2005-04-20T19:25:12Z</dc:date>
    </item>
  </channel>
</rss>

