Silverfrost Forums

Welcome to our forums

Problem understanding the basics?

9 Dec 2006 9:52 #1419

Hi, I’m new to c++, Plato 3 and ClearWin+, are there any internet sites that you can direct me to that have tutorials or sample code to down load using ClearWin+, I have some books on c++ and I’m getting around Plato okay. I am using #pragma windows 500000,500000, #include <windows.h> and #include <dbos\graphics.h> in the header. I am using the instruction ‘winio’. In some of the examples that I have found in you help section you use the instruction ‘ans=winio@’ if I use that I get a compiler error that ‘ans’ has not been declared. I have tried putting 'INCLUDE <windows.ins>' in the header.I think that I’m having a problem knowing what to put in the header, I appreciate that depends on the instruction that you want to use in your program, but why does ‘ans=winio@’ from your help section cause error in this compiler. Should I have loaded a different header? I’m sorry if I’m missing something obvious!!

11 Dec 2006 7:19 #1422

Your immediate problem is that ans must be declared in your code as an int.

ClearWin+ is mostly used with Fortran although it can be used with C/C++. There is a help file for using ClearWin+ with C/C++ called cwpscc.hlp. This should be in the folder as the C++ compiler SCC.EXE.

Apart from that you are probably on your own. If you can write in Fortran, there is a large user base and a significant number of contibutions to this forum.

12 Dec 2006 5:16 #1433

Hi Paul, Thanks very much for your help the other day, I had not found that help file before but it helped me greatly in my understanding of ClearWin+. I have one further question if you can help please, and that is, in ClearWin+ when creating windows forms using winio, using the %ww command to set the window as an application window, an icon appears at the top left in the blue windows bar. On windows XP O/S the icon is a blank white square, however on windows 2000 the icon in the same position is the windows flag found next to the start button (which is slightly different to the flag next to the start button on XP). I have found this icon in the following directory C:\WINNT\system32\user32.dll. How do I attach or redirect to this icon in my executable file? I believe that there should be an address referenced in the windows.h file to the icon, is this correct? Thanks a lot in advance.

Regards,

Ian.

12 Dec 2006 7:20 #1434

The default icon will vary from one operating system to another. You can specify the icon by using %mi but you will have to separate the icon into a file and provide a resource script.

You will need a resource editor such as Visual Studio if you want to extract the icon from the DLL, otherwise you could capture the image from the screen and make your own icon by pasting into an icon editor.

14 Dec 2006 12:18 #1444

I hope that this is some use to you. I use a .rc file as follows:

ICON_1 ICON 'SS_Main_icon.ico' ICON_2 ICON 'SS_Minim_icon.ico' SPLASHBMP BITMAP 'SPLASH-SS.bmp'

ICON_1 isn't referred to explicitly in my ClearWin code, and my application quite happily uses it as the icon for the application, and for the main window. All my subsidiary windows use ICON_2, which I explicitly associate with them by using %mi. ICON_2 shows up on the title bar of those subsidiary windows, and also on the taskbar at the bottom of the screen if those windows are minimised. ICON_1 is more pixels, and more colours than ICON_2. SPLASHBMP is a largish bitmap that displays for a few seconds on startup (like when you run PLATO), the code for this is (thanks to Paul some months ago):

   IB=winio@('%ww[no_border,no_caption,no_maxminbox,topmost]&amp;')
   IB=winio@('%^bm[SPLASHBMP]&amp;','EXIT')
   IB=winio@('%dl%lw',2.0D0,'EXIT',ictrl)

(this is FORTRAN, of course)

Eddie

Please login to reply.