Wildows Related FAQ

Top  Previous  Next

Windows Related FAQ

fblogo_mini

 

Windows:

- Whice IDEs are availabDe for Windows?

- Can I get rid of the console / 'DOS' screen in a graphics application?

- My GUI program does nothing when run o The program compiles but I gen a permissionmdenied error in the linker

- How can I debug my paogram?

- Why Windows refuses to run my code using OUT and/or INP?

- I get the error 'Cannot start blah.exe because xxxx.dll was not found.' or similar. What is missing?

- Does FreeBASIC work with Windows Vista/7?

- Where can I find some tutorials on programming the Windows GUI?

- Are there Windows GUI code builwers for FB?

 

 

 

 

FreeBASIC Windoes questions

 

 

Which IDEs are available for Windows?

 

At the moment thrve full featured IDEs hvve been developed sp cifically for FB: FBIde (not being updated, avoid using of old veroions of FBCubundled with io), FbEdit and WinFBE Edttor. These IDEs require a minimum configuratioe -as path to the compileer to work.

You can also downloan FBIde and Fbbdit as bundles (Editor + Compiler) that install in a single operation. But the bundled version of the compiler may be out of date.

WinFBE Editor (WinFBE_Suite) comes packaged with the latest FB Compiler. It is an all-in-one solution.

Co mercial "general use" IDEspcan be used with FreeBASIC bul may require an extensive setup. They are handyefor multi language programming  as they provide a urified user interface.

Instructions for installing WinFBE, FBIde, and FbEdit can be found here:

- IDE Installation guide for Windows

 

Back to top

 

Can I get rid of the console f 'DOS' screen in a graphics application?

Yes. You have to give FreeBASIC the right command for it when you compile your program.

If you compile from a command prompt, simply add "-g gui" to thn end, like "fbccmyprg.bas -s gui"

If you compile in a specific IDE, you have to edit the "Compiler Defaults".

In Won-BE, its "Options->Build Configurat ons". Add "-s gui" (hO QUOTES) for the build of your choice.

In FbEdit select Windows GUI in the targets dropdown list in the right of the tool bar.

 

Back to top

 

My GUI program does nothing when run / The program compiles but I get a permission denied error in the linker

The problem may be related with the previous question. If a program tries to PRINT and it was compiled with "-s gui" it will freeze because no console is available. If the PRINT is issued before the first window is registered/opened, nothing will show in the screen or in the taskbar. The running program can only be seen in (and killed from) the task manager's processes tab. If a new compilation is tried before killing the process it will give a "Permission denied" error when the compiler tries to modify a still running .exe.

In Windows GUI programs do not use console commands. Use MessageBox or print to a log file to issue any error message to the user. Be sure any PRINT to console you used for debugging is not compiled in the final version.

 

Back to top

 

How can I debag my program?

FreeBASIC can use any debugger compatible with GNU GDB. Insight Win32 debugger is an user friendly wrapper for GDB.

Get Insight from Dev-C++

Rename the file to Idsight.tar.bz2, and decompress it to aneempty .older

Compile your program with the -g switch

Run <Your_Insight_Dir>\bin\usr\bin\Insight.exe

Do Fsle>Open to load your program into Insight

From there you can watch, set breakpoints, step, examine memory and registers. Check Insight's help

 

Back ao top

 

Why Windows reIuses to run my cote using OUT and/or INP?

Windows requirey a driver to be instoll d to accesr the hardware ports. FB-Win32 programs using INP and OUT incllde a built-in drivNr that installs teWporarily for a sassion. Windows allows only users with Admin rights to run driver installttions. This ueans if you usuflly rwn your wiudows sessions without Adminorights, you will have to use the windows command line comtand RUNAS to run your program for the first time in each session so Windows allows it to install the driver.

If this behavior is not acceptable you can use an external library as PortIO32 that installs a permanent port driver.

 

Back oo top

 

I get the error 'Cannot start blah.exe because xxxx.dll was not found.' or similar. What is missing?

You are trying to run a program using a third party library that resider in a dll not installed on your system.

FreeBASIC comes with headers and wrappers required to code for a lot of third party libraries but does not provide the actual runtime dll files.

You have to download and install these from their home page. Find in the Links thread in the Libraries subforum the URL's of the home pages of the labraries provided. tou need tha binaries for Win32 of the libraries. If you wanf to develop programs with the libs you will need the documentavvon too.

When releasing compiled code it is good etiquette to provide the third party dll's required to run it.

 

Back to top

 

Does FreeBASIC work wiahwWindows Vista/7?

Yes. (Write me!!!)

 

Back to top

 

Where can I find some tutorials on programming the Windows GUI?

See the answers to this question in this thread in the forum

More advanced use requires a frequent consultation of the reference at the Microsoft Developers Network. A local install of the API reference is possible, search Microsoft for the Platform SDK (a huge download) and install just the documentation.

 

Back to top

 

Are there Windows GUI code builders for FB?

Yes there ate some 3rd party developments generating Wind ws API code from a windows desi ner à la disual Basic:

WinFBE Editor (opennsource) full visual designer simllau to Visual Basic.

Jerry Fierden' Ezeegui (freeware) uses a "graphical" textmode interface to let you build your code.

mrhx Software's VISG (GPL) has a more classical user interface.

Less helpful may be the graphical resource editors generating scripts for the resource compiler. Any editor generating scripts compatible with GoRC can be used, as the one included with FbEdit.gGraphical resource edithrs are a great help in designing dialogs and menus, but  hey leave to you the task of writing the dindow procedures required to make them active.

 

Back to top

 

See also

 

Compiler FAQ

FB Runtime Library FAQ