Link to home
Start Free TrialLog in
Avatar of ekinee
ekinee

asked on

outp();

I have an application written for win16. In this program I use outp in order to give add on card information. However this does not work with win32. Could someone describe me how this should be done.
ASKER CERTIFIED SOLUTION
Avatar of nietod
nietod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just a suggestion...

Can you make your old Win16 code into 16-bit DLL and then mix your Win32 app with 16-bit DLL?..

It's only assumption...

Andrew
Avatar of nietod
nietod

A 32 bit app can't call a 16 bit DLL directly.  You would have to use thunks to make the call work.  (then it would work.)
OK. I just mean it.
ekinee,

I use a shareware-driver, called "TVicHW32" for this.
If you stick to win95/win98 you can still use outp() etc...
Luc
1. Codes directly from my application so please do not confuse by the parameter names.

2. Create a handle to the port as given below.

hCommPort = CreateFile (m_PortName, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);

m_PortName can be COM1/COM2/COM3/COM4

3. Write to the port using the hCommPort handle and the WriteFile function. Configure the m_strWrite String with the details of the add-on Card.

WriteFile(hCommPort, m_strWrite, dwLength, &MyBytesWritten, NULL);
I have assumed that you have the source code to rebuild.
padmashali, that allows you to access a communication port, not an I/O port.  The two are unrelated.  outp() allows you to access the 64k I/O ports on an x85 machine.
Avatar of ekinee

ASKER

Yes,  as nietod said I dont want to communicate with the card through COM port, but through ISA bus.
Avatar of ekinee

ASKER

I've found the device driver that does what I want .

So I'm thanking.
Thanks nietod, and sorry for not understanding the Q and answering.