- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am new to Intel Fortran. I have been going through all available samples to find out how to write output on the window in an SDI environement or to a child window in an MDI environment.I do rather extensive calculations and would like to write the output to the main or child window so that I can see what is going on. Here is a part of the sample code. Any help would be appreciated or any reference to a source code that uses similar procedures would be appreciated.
After reading the filename and the paratmeters, I am reading the data and sending the output to the window. Unfortunately, I am not able to see anything. Is there any specific iunit (or hwnd for a child window) that I need to specify? Ideally,I would like to write it tothe mainwindow (in an SDI environment ) which has the menu for printing the output (hoping it would work!).
Many thanks.
=======================================
This is from an SDI enviro; the same dialogue is also used in an MDI.
case (idm_open)
retlog = dlginit(IDD_dialog4, dlg)
retint = dlgmodal(dlg)
retlog = dlgget(dlg, idc_edit1, text)
read (text, *) nvarretlog = dlgget(dlg, idc_edit2, text)
read (text, *) nrecretlog = dlgget(dlg, idc_check1, name)
ofn%Flags = null
retlog = dlgget(dlg, idc_button1, browse)
if (browse == .true.) call fileopen(filename)ret = winexec('NotePad.exe '//Trim(filename)//'*.txt'C,sw_maximize)
allocate (varname(nvar), des(nvar)) allocate (dataread(nrec,nvar)) open(unit=5,file=filename,status='old') if (name) read(5,*) (varname(j),j=1,nvar) do i=1,nrec read(5,*) (dataread(i,j),j=1,nvar) end dowrite(*, 10) filename
write(*, 11)(varname(j),j=1,nvar)
11 format(2x,'Variable Names : ',a12,100(/19x,a12)) CALL DlgUninit( dlg )MainWndProc = 0
returnLink Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I don't have some long experience at it: when I started I looked at samples in Array Visualizer directory. Something like this: SamplesFortran*Win32. May be it will help you as one day me. Good luck.
Stan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Graphic output in pure Win32 API application is fundamentally different from anything else you've probably encountered before. Namely, when you switch focus from e.g. Visual Studio to e.g. Internet Explorer, the system does not "pull out of pocket" the contents of IE's window. Instead, it merely sends a WM_PAINT message to IE's window (and its child windows recursively) which basically says "go ahead and redraw yourself". It is the logic within IE's code which determines what will be drawn (in this example, it will render HTML source into a series of TextOut and similar functions).
So, (properly) handling a WM_PAINT message is the most common way for an application to display its output. It can be done in two ways:
1) "Simple"way: on WM_PAINT, call BeginPaint and use GDIroutines to draw onto returned device context handle (hDC). However, that causes flickering on resize and scroll.
2) "Double-buffering": create an offscreen DC/bitmap using CreateCompatibleDC + CreateCompatibleBitmap. Use GDI routines to draw only on that DC. On WM_PAINT, just copy the appropriate part of that DC onto hDC returned by BeginPaint using BitBlt API. Basically, that's a tradeoff between memory and speed, but you get flicker-free resizing.
QuickWin internally uses technique (2) -- SETWINDOWCONFIG actually sets up the size of the offscreen bitmap, and all QuickWin functions (including "overriden" WRITE(*)) first draw there, then call InvalidateRect (which generates WM_PAINT). On WM_PAINT, QuickWin just does the copy using BitBlt.
I recommend that you examine XDblBuffer and XDblBuffer2 samples on my home page(in "downloads" section) to become familiar with the technique.
Next, forget everything I told youabove :-). Namely, in this particular case, you need something easier which will give you simple text output capabilities. An embedded edit-control is the right tool for the job -- it has its own redrawing (again, using technique 2 above) and scrolling capabilities.
So, I recommend that you download and examine XTabEditor sample (it also does the printing), but you have to install full XFT library first.
Also, there was a recent thread(s) called "Scrolling window" with a problem similar to yours -- you can search this Forum and take a look there as well.
Hope this helps
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, Stan and Jugoslav.
The ArrayViewer is not of much help in my program.
Jugoslav, I have downloaded your programs, it looks like that the example you have provided in XTabEditor may be somewhat related to the questions that I have. I shall work with XFT and shall contact you if I have any more questions. Thanks a lot. ...By the way, if you are planning to commercialize your product, why doesn't Intel incorporate your XFT library; it seems to be a good contribution!
Thanks again,
fernando

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page