How can I open a device from managed code?

  • Thread starter Thread starter Êþóôáò ÔñÜãêáò
  • Start date Start date
Ê

Êþóôáò ÔñÜãêáò

Hello,
Is there any way to open a device from managed code without P/Invoking
CreateFileW()?
I tried File.Open("LPT1:",...) but it doesn't work.

Thank you,
Kostas Tragas
 
Without P/Invoking no, but keep in mind that under the hood almost all
managed code is P/Invoking at some point, whether it's in your code or
Microsoft's. That's the only way to call a native API.

For stream interface drivers you might find this useful:

http://www.opennetcf.org/library/OpenNETCF.IO.StreamInterfaceDriverMembers.html

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate
 
Back
Top