CECreateFileW function call does not return a valid file handle

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cliu
    New Member
    • Feb 2008
    • 1

    CECreateFileW function call does not return a valid file handle

    My problem happens in my c# Windows ce 5.0 project. I am trying to open a serial port on a Symbol HHT by using CECreateFileW function of platform invoke from the coredll.dll as follows:

    CECreateFileW(F ileName, GENERIC_WRITE | GENERIC_READ, 0, IntPtr.Zero, OPEN_EXISTING, 0, IntPtr.Zero);

    where Filename is "COM1".
    This call always returns "-1", i.e. a invalid file handle.
    Anyone could help? Please.
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Is this a .NET question? Seems more like C++.
    If it IS .NET then Why not use the SerialPort object? It's available in the Compact Framework.

    Comment

    Working...