15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Borland's outport not in MS

Philip Beck -- splinta@cix.compulink.co.uk
Thursday, January 25, 1996

Hi,

I'm converting a Borland C++ DOS program to MS MFC Win3.1.
It controls an RGB graphics card. The card was never supported in Windows 
by it's manufacturers. Some small company in Germany converted the 
development library to Windows - which we bought. We have recompiled the 
DLL under MS C++ and it seems okay.

Our DOS program accesses the card at some points using outport() and 
inport(). The Borland compiler says that these functions are compatible 
with both DOS and Windows. The MS compiler says that they are DOS only. 
Would it be okay to replace these commands with MFC inline assembly ? Or 
is it bad to access any hardware directly from a Window's app ? Should I 
put inline assembly in the source code of the DLL ?  Maybe I should 
declare the member function that contains the inline assembly as static ? 
Is there direct equivalents of out/inport in MS C++ or MFC ?

Any help will be very much appreciated.

Phil.





Marty Fried -- mfried@linex.com
Saturday, January 27, 1996

On Thu, 25 Jan 96 13:58 GMT, you evidently wrote:

>Hi,
>
>I'm converting a Borland C++ DOS program to MS MFC Win3.1.
>It controls an RGB graphics card. The card was never supported in Windows 
>by it's manufacturers. Some small company in Germany converted the 
>development library to Windows - which we bought. We have recompiled the 
>DLL under MS C++ and it seems okay.
>
>Our DOS program accesses the card at some points using outport() and 
>inport(). The Borland compiler says that these functions are compatible 
>with both DOS and Windows. The MS compiler says that they are DOS only. 
>Would it be okay to replace these commands with MFC inline assembly ? Or 
>is it bad to access any hardware directly from a Window's app ? Should I 
>put inline assembly in the source code of the DLL ?  Maybe I should 
>declare the member function that contains the inline assembly as static ? 
>Is there direct equivalents of out/inport in MS C++ or MFC ?

Yes, you can use the runtime library functions _inp()/_outp(), and
_inpw()/_outpw(), in apps or dlls.  There was an error in the docs for
version 1, but I have used it in all versions.  That's for 16-bit
Windows.  For 32-bit, you may have to talk to a driver.

______________________________________________________
Marty Fried  (mfried@linex.com)     San Anselmo, CA 
Win32 Programmer    :   Make me one with everything.  
Audio/Video/Winsock : -Zen monk to the hotdog vendor



Oguz Algan -- algan@bornova.ege.edu.tr
Monday, January 29, 1996

Hi,
You can use inp, and outp to access ports. You can use these functions =
from dos and win16 but not in win32 running under winnt. here are the =
function declerations in VC++ books
for inp:
int _inp( unsigned short port);
 
unsigned short _inpw( unsigned short port );
 
unsigned long _inpd( unsigned short port );

for outp

int _outp( unsigned short port, int databyte );
 
unsigned short _outpw( unsigned short port, unsigned short dataword );
 
unsigned long _outpd( unsigned short port, unsigned long dataword );



----------
From: 	Philip Beck[SMTP:splinta@cix.compulink.co.uk]
Sent: 	Thursday, January 25, 1996 3:58 PM
To: 	mfc-l@netcom.com
Cc: 	splinta@cix.compulink.co.uk
Subject: 	Borland's outport not in MS

Hi,

I'm converting a Borland C++ DOS program to MS MFC Win3.1.
It controls an RGB graphics card. The card was never supported in =
Windows=20
by it's manufacturers. Some small company in Germany converted the=20
development library to Windows - which we bought. We have recompiled the =

DLL under MS C++ and it seems okay.

Our DOS program accesses the card at some points using outport() and=20
inport(). The Borland compiler says that these functions are compatible=20
with both DOS and Windows. The MS compiler says that they are DOS only.=20
Would it be okay to replace these commands with MFC inline assembly ? Or =

is it bad to access any hardware directly from a Window's app ? Should I =

put inline assembly in the source code of the DLL ?  Maybe I should=20
declare the member function that contains the inline assembly as static =
?=20
Is there direct equivalents of out/inport in MS C++ or MFC ?

Any help will be very much appreciated.

Phil.




| Вернуться в корень Архива |