CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2012
    Location
    India
    Posts
    193

    Unhappy "Port I/O instructions and c#"

    I am converting my MFC based technical project to c#. Every thing is fine except port I/O instructions.

    There are no _inp / _Outp equivalent commands in c#.

    I tried to use them by including C Dll file containing I/O code. I tried
    _inp/_outp instructions and also _asm out dx,ax instructions.
    Its giving SEHExcepion error for using privileged instructions. I read on net that , these commands cant work in user mode.

    Now what is a solution for this ? I need to read data from my hardware card RAM.

    pl guide ...

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: "Port I/O instructions and c#"

    You'll need to write a device driver or obtain one from the manufacturer of the i/o card.

  3. #3
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: "Port I/O instructions and c#"

    Redundant info but _inp & _outp isn't supported in an OS of today. The older OS supported access to the hardware but newer OS does not so as Arjay say the access needs a device driver.
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

  4. #4
    Join Date
    Jan 2012
    Location
    India
    Posts
    193

    Re: "Port I/O instructions and c#"

    Thank you Arjay Sir and S_M_A sir ..

    Writing Device Driver is very very tough .

    I have read and tried a lot to solve the issue .. nothing worked so put up question in the forum ...

    Thank you once again

  5. #5
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: "Port I/O instructions and c#"

    Quote Originally Posted by new_2012 View Post
    Thank you Arjay Sir and S_M_A sir ..

    Writing Device Driver is very very tough .

    I have read and tried a lot to solve the issue .. nothing worked so put up question in the forum ...

    Thank you once again
    Before writing your own driver, I'd check with the manufacturer to see if they have an SDK for your card.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured