Recent

Author Topic: Unexpected DOS Mode  (Read 14531 times)

Majster

  • Newbie
  • Posts: 6
Unexpected DOS Mode
« on: January 23, 2011, 08:46:26 pm »
Allways when I runing Lazarus the started screen is going totally black, a couple of seconds. After that, when I try to run a very simple program (Hello world with readln instruction to stop it), the screen is black again and no efect is vissible. Every program I tryed to start is runing in DOS mode. I serched info on diferent forums and I found only one: -WG on linker option, but it does not help.

cdbc

  • Hero Member
  • *****
  • Posts: 1090
    • http://www.cdbc.dk
Re: Unexpected DOS Mode
« Reply #1 on: January 24, 2011, 03:26:06 am »
Hi

"readln" is normally used in console applications, ie: "dos-mode".

Application behaviour seems normal...

hth, regards benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

Majster

  • Newbie
  • Posts: 6
Re: Unexpected DOS Mode
« Reply #2 on: January 24, 2011, 06:03:07 am »
Sorry, but I did not asked about the "readln" instruction.
The problem is in black screen when starting Lazarus, and running programs. I'v seen couple of tutorial films on YT, so I know, that Lazarus can working in windows/graphic mode only, without any screen black-blinking. How to avoid this?

Laksen

  • Hero Member
  • *****
  • Posts: 754
    • J-Software
Re: Unexpected DOS Mode
« Reply #3 on: January 24, 2011, 08:17:29 am »
What operating system are you using?

clauslack

  • Sr. Member
  • ****
  • Posts: 275
Re: Unexpected DOS Mode
« Reply #4 on: January 24, 2011, 12:47:29 pm »
Depend of your Lazarus version.
Try search for

Compiler Options->Linking->Win32 GUI Aplication (-WG)

and check.

Regards

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9908
  • Debugger - SynEdit - and more
    • wiki
Re: Unexpected DOS Mode
« Reply #5 on: January 24, 2011, 01:23:41 pm »
Allways when I runing Lazarus the started screen is going totally black, a couple of seconds.

Ok, are you speaking of:

1) Dos-Mode, which would still only be a window. A window with black background, but normal window borders and title. A window that is also still shown in the task bar.

2) Or a you talking about a graphical glitch. Where your whole screen goes blank (not even a cursor, but 100% blank. No taskbar neither. The kind of that happens when you start some (full screen) games.

In either case:
- Which exact version of Lazarus and fpc?
- Did you recompile Lazarus itself?
- Did you add any packages?

In case 2:
- which version of windows? Vista, 7, XP?

Majster

  • Newbie
  • Posts: 6
Re: Unexpected DOS Mode
« Reply #6 on: January 24, 2011, 05:25:17 pm »
Ok, are you speaking of:
1) Dos-Mode, which would still only be a window.
No. There are no windows on the screen - it is totally black, even no cursor is present. So I can suppos that memory of my SVGA was restarted when Lazarus started and when I run any program.
A window with black background, but normal window borders and title.
As I said - no title, no border - completly black screen for a few second.
A window that is also still shown in the task bar.
No task bar of couorse ;D If I see a black window with a title and border - I will be happy :D
2) Or a you talking about a graphical glitch. Where your whole screen goes blank (not even a cursor, but 100% blank. No taskbar neither. The kind of that happens when you start some (full screen) games.
Exactly!! But after a couple of cecunds a Lazarus menu and source window of my simple program is visible again.
In either case:
- Which exact version of Lazarus and fpc?
0.9.28 and 2.2.4.
Additionally I've installed a 2.4.2 FPC (witch is working of couorse perfectly) but in totally diferent location without any shared components.
- Did you recompile Lazarus itself?
No, should I? How to do it and why?
- Did you add any packages?
No
In case 2:
- which version of windows? Vista, 7, XP?
Win XP
Thanks and rgds :)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9908
  • Debugger - SynEdit - and more
    • wiki
Re: Unexpected black screen [was: DOS Mode]
« Reply #7 on: January 24, 2011, 08:07:21 pm »
 
- Did you recompile Lazarus itself?
No, should I? How to do it and why?
- Did you add any packages?
No
Good. And No you do not need to rebuild Lazarus, nor should you (at least not yet).
Just making sure you are working with the original pre-compiled Lazarus. So no 3rd party add-ons can be at fault (like maybe some open-gl driver...)

Quote
In case 2:
- which version of windows? Vista, 7, XP?
Win XP
Ok, WinXP is popular enough, and plenty of people use Lazarus with it.

My best *guess* at the moment is that something upsets your gfx driver.

Afaik Lazarus only uses calls to the win API. But it must be calling something that apparently few applications are calling. (So you only see those symptoms with Lazarus)

Anyway: The symptoms you describe have nothing to do with the -WG or -WC switches.

And the Lazarus.exe as installed by the installer, also is not compiled with Dos console, so that is definitely not the problem.

A very unlikely possibility: Try to temporarily disable (or at least set to game-mode or similar) your Anti-Virus.
I don't think it will be, but I've been around long enough to see weird things...

More likely a problem with resources. do you have any other app open when you start lazarus? (like browser, email, ...). Just for testing, does it happen on a freshly booted Windows, with no application running, just starting Lazarus?
Or even better, starting an already compiled (compiled before you reboot) "project1.exe" with just an empty form? (running project1 outside Lazarus?)

Otherwise it is likely that Lazarus triggers some feature in Forms, that does not work with your gfx card.
This may be a feature that is not even used by your app. But because of the LCL has support for it, it may always initialize it, even if not needed.

What GFX card to you have?
What driver / Version?
What resolution/color depth?

Your Pc: how much memory?
Your XP: up-to-date, with all service packs etc?

Majster

  • Newbie
  • Posts: 6
Re: Unexpected black screen [was: DOS Mode]
« Reply #8 on: January 24, 2011, 09:26:10 pm »
My best *guess* at the moment is that something upsets your gfx driver.
Suggest you to reinstall gfx drivers?
Anyway: The symptoms you describe have nothing to do with the -WG or -WC switches.
I thing so too.
A very unlikely possibility: Try to temporarily disable (or at least set to game-mode or similar) your Anti-Virus.
I tryed, nothing better.
More likely a problem with resources. do you have any other app open when you start lazarus? (like browser, email, ...). Just for testing, does it happen on a freshly booted Windows, with no application running, just starting Lazarus?
Or even better, starting an already compiled (compiled before you reboot) "project1.exe" with just an empty form? (running project1 outside Lazarus?)
I closed all other apps - but nothing better. I started project1.exe outside lazarus environment - it does not help. Of couorse for that .exe file I can manually change properties to run it in a window, but its not elegant way to solve my problem. I thing Lazarus can make exact windows .exe, but I do not know how to do it :(
What GFX card to you have?
What driver / Version?
What resolution/color depth?
Typical: GF WinFast A340, drivers from installation CD, res 1280x1024 fullcolor (32b).
Your Pc: how much memory?
Your XP: up-to-date, with all service packs etc?
1,5GB RAM, but no WinUpdates - in my opinion updating windows is the best way to mule it.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9908
  • Debugger - SynEdit - and more
    • wiki
Re: Unexpected black screen [was: DOS Mode]
« Reply #9 on: January 24, 2011, 11:18:37 pm »
Or even better, starting an already compiled (compiled before you reboot) "project1.exe" with just an empty form? (running project1 outside Lazarus?)
I closed all other apps - but nothing better. I started project1.exe outside lazarus environment - it does not help. Of couorse for that .exe file I can manually change properties to run it in a window, but its not elegant way to solve my problem. I thing Lazarus can make exact windows .exe, but I do not know how to do it :(
"Of couorse for that .exe file I can manually change properties"

Well now you confused me. I thought your screen went black, but then it comes back, and Lazarus, or whatever app you use runs normally? So project1.exe would already run in a normal window (and in front of the normal desktop). It just flashes the screen black before?
(How else is the IDE running at all, since it has many individual windows?)

How can, and how do you change the properties (and which properties) of "project1.exe" to make it normal? (and does normal mean *no* black flashing screen?)



Typical: GF WinFast A340, drivers from installation CD, res 1280x1024 fullcolor (32b).
1,5GB RAM, but no WinUpdates - in my opinion updating windows is the best way to mule it.

My best *guess* at the moment is that something upsets your gfx driver.
Suggest you to reinstall gfx drivers?

Hm, well I do not want to be the one into talking you to upgrade, and then you get other problems....

Though my personal experience is that having done regular updates in the last decade, I only had one update going wrong (and that I could roll back and skip afterwards).

The problem is, there may (or may not) be an issue in the driver, and there may be a newer driver, that solves it... (Maybe directly from the gfx card manufacturer, and not via automated update).
Yet it may require other updates, and so on...

On the other hand, it is yet the most promising course of action.

------------
On a last minute thought...

Try disabling or changing the Manifest.... Maybe it is to do with windows themes?
If it is, that still leaves the question why it goes bad...

Majster

  • Newbie
  • Posts: 6
Re: Unexpected black screen [was: DOS Mode]
« Reply #10 on: January 25, 2011, 04:35:08 pm »
"Of couorse for that .exe file I can manually change properties"

Well now you confused me. I thought your screen went black, but then it comes back, and Lazarus, or whatever app you use runs normally?
True. Every other apps are working properly, only lazarus and lazarus compilates (project1.exe etc.) shows screen problems.

So project1.exe would already run in a normal window (and in front of the normal desktop).
Right - it would. But it does not know it :DD Or I do not know how to do it.

It just flashes the screen black before?
(How else is the IDE running at all, since it has many individual windows?)
True too. After blackblink all is present like you said.

How can, and how do you change the properties (and which properties) of "project1.exe" to make it normal? (and does normal mean *no* black flashing screen?)
Very easy - click RMB on the program name in windows explorer and chose all properties option from menu - window/fullscreen, res, font etc. Or, after program running bat before stop - alt-tab, back to windows and program properties from taskbar.
Hm, well I do not want to be the one into talking you to upgrade, and then you get other problems....
No problems, I'm regulary cuting system, and installing it on fresh formated HDD partition. Last time it was about one year back, so the time is comming ;)
Though my personal experience is that having done regular updates in the last decade, I only had one update going wrong (and that I could roll back and skip afterwards).
Perhaps you right, but "personal experience" in updating I understand: adding a couple of gigs RAM, may be new procesor, new gfx or mainboard. But I comming from different part of that planet, where maiboards and other hardware are a little more expensive then cola and chips ;)
The problem is, there may (or may not) be an issue in the driver, and there may be a newer driver, that solves it... (Maybe directly from the gfx card manufacturer, and not via automated update).
Yet it may require other updates, and so on...
So the best way to fix it will be a new system installation, that I mean.
On the other hand, it is yet the most promising course of action.
We agry.
------------
On a last minute thought...
Try disabling or changing the Manifest.... Maybe it is to do with windows themes?
If it is, that still leaves the question why it goes bad...
What is Manifest? Something like a screensaver? I dont use it.
Thx for your help and rgds;)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9908
  • Debugger - SynEdit - and more
    • wiki
Re: Unexpected black screen [was: DOS Mode]
« Reply #11 on: January 25, 2011, 04:55:42 pm »

How can, and how do you change the properties (and which properties) of "project1.exe" to make it normal? (and does normal mean *no* black flashing screen?)
Very easy - click RMB on the program name in windows explorer and chose all properties option from menu - window/fullscreen, res, font etc. Or, after program running bat before stop - alt-tab, back to windows and program properties from taskbar.
Ok.

Did you ever find out, which one. e.g. maybe you need to check only one?
In Vista I have:

"disable visual themes" => And yes lazarus uses that feature (unless you disable manifest)

"disable scaling / DPI" => Afaik, that was added recently to Lazarus, but maybe some of it existed for longer already

IMHO Resolution and color depth are unlikely.

Quote
------------
On a last minute thought...
Try disabling or changing the Manifest.... Maybe it is to do with windows themes?
If it is, that still leaves the question why it goes bad...
What is Manifest? Something like a screensaver? I dont use it.
Thx for your help and rgds;)
There is a checkbox in the project options. You can use that to disable the manifest.

The manifest itself is a file in your project dir, that specifies some things like which themes to use.

Majster

  • Newbie
  • Posts: 6
Re: Unexpected DOS Mode
« Reply #12 on: January 25, 2011, 05:47:32 pm »
Experiments with different window option does not solv, block the manifest does not help too, unfortunatelly, so now I'll try to reinstal my windows platform with all drivers (as I decided early).
And what about DevPascal IDE? How find you it? Or, other side - does exist any other Pascal windows editor? But, my O - most important is the users community, witch can and want to help, like hier :)

TurboRascal

  • Hero Member
  • *****
  • Posts: 672
  • "Good sysadmin. Bad programmer."™
Re: Unexpected DOS Mode
« Reply #13 on: March 22, 2011, 09:33:21 pm »
Do your other textmode (console) application work ok?

And obviously -WG cannot help here, since your program _is_ a console app since it is using readln (and probably writeln).
Regards, ArNy the Turbo Rascal
-
"The secret is to give them what they need, not what they want." - Scotty, STTNG:Relics

 

TinyPortal © 2005-2018