joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.77k stars 381 forks source link

This program cannot be run in DOS mode #3169

Closed Arthur3032 closed 2 years ago

Arthur3032 commented 2 years ago

Code of Conduct & Contributing Guidelines

Have you checked that no other similar question(s) already exists?

Question

dear sir, I execute the command in the DOSBOX-X command mode, For example: winet.exe Will appear This program cannot be run in DOS mode. After all, it is still executed, and it is executed normally. However, I am in Clipper 5.3b and call winet.exe It only appears This program cannot be run in DOS mode. There is no more

ps. DoxBox-X 0.83.21 DOS v7.1 country: 886,995 language: zh_TW

joncampbell123 commented 2 years ago

EXE files will print that message when you execute the "MS-DOS stub" of a Windows application.

Real MS-DOS will do the same.

DOSBox-X will always run executables through the MS-DOS header, same as DOSBox SVN and any other fork, and any real MS-DOS system.

joncampbell123 commented 2 years ago

This is the MS-DOS EXE header originally defined since MS-DOS 2.0:

http://www.delorie.com/djgpp/doc/exe/

joncampbell123 commented 2 years ago

The Windows or OS/2 header is placed elsewhere in the EXE file, and a DWORD at offset 0x3C points at it. The signature at that offset indicates what kind it is.

"NE" Windows 3.x 16-bit executable or OS/2 16-bit executable "PE" 32-bit/64-bit Windows executable, common in use still today "LE" Linear executable, which is used by OS/2 32-bit, VXD drivers, and 32-bit MS-DOS programs loaded by DOS4GW or CWSDPMI

https://docs.microsoft.com/en-us/windows/win32/debug/pe-format?redirectedfrom=MSDN#ms-dos-stub-image-only

joncampbell123 commented 2 years ago

This design allows the EXE to contain code for both MS-DOS and Windows. By default, Microsoft's Linker will attach a small "stub" program that prints that message, however you can put anything you like in the MS-DOS portion.

Arthur3032 commented 2 years ago

Understand, thanks for the detailed explanation

Arthur3032 commented 2 years ago

Can the DosBox-X window be resize, in runtime?

in English mode , it's ok, but Chinese mode, cannot be. ps. DoxBox-X 0.83.21 DOS v7.1 country: 886,995 language: zh_TW

Wengier commented 2 years ago

You can increase or decrease the window size in Chinese TTF mode at run-time with the menu options "Increase TTF font size" / "Decrease TTF font size" (under "Video" => "TTF options"), or using the keyboard shortcuts F11 + Up/Down (default for these menu options).

P.S. DOSBox-X emulates the behaviors of "pure" DOS mode by default, so the message "This program cannot be run in DOS mode" is expected when you run PE applications. There is a GUI for DOS known as Windows 9x which does allow you to run PE application outside DOS command prompt when launched from it, and you can run such applications if you enable START command with startcmd=true setting in DOSBox-X. Windows XP and later, however, are not DOS-based so they are no longer GUIs for DOS.

Arthur3032 commented 2 years ago

The response is really fast, thank you very much

Arthur3032 commented 2 years ago

But windows EXE, in DOSBOX-X command mode can Directly give instructions (without CA-Clipper), how it to do.

Arthur3032 commented 2 years ago

image

Wengier commented 2 years ago

@Arthur3032 I don't have the Clipper program that you mentioned. Can you upload it so that I can test it as well?

Arthur3032 commented 2 years ago

Test.rar.zip

Arthur3032 commented 2 years ago

in Dosbox-X command mode type WINPRINT TT.PRG ( or another text file)

in Dosbox-X command mode type TT.exe (This is Clipper exe file, tt.prg is source code)

Wengier commented 2 years ago

@Arthur3032 Thanks for the program. I could reproduce the issue, and have hopefully fixed in the updated Windows build below. Please check it out:

Arthur3032 commented 2 years ago

Too strong, can't believe it, am I dreaming? (It was actually executed normally) Thank You very much.

Arthur3032 commented 2 years ago

So, in later versions, is that the same?

Wengier commented 2 years ago

@Arthur3032 Sure, it is fixed for the later version.

Arthur3032 commented 2 years ago

That's great

Wengier commented 2 years ago

Closing the issue.