Results 1 to 15 of 15

Thread: Dev c++

  1. #1
    One skin, two skin......
    Join Date
    Jul 2003
    Location
    Durham
    Posts
    1,705
    Thanks
    0
    Thanked
    1 time in 1 post

    Dev c++

    Hiya you lot!

    I'm trying to learn C++.
    I have installed and played with devc++ (including the minigw compiler).
    I want to use the outp() or outport() function, but have found that it is unavailable with devc++ as it doesn't follow the ansi standard correctly.
    I want to output some info to the parallel port, but have been unsuccessful so far.

    Any ideas? I want to avoid inline assembler as I feel it is a bit of a 'cop out'!

  2. #2
    One skin, two skin......
    Join Date
    Jul 2003
    Location
    Durham
    Posts
    1,705
    Thanks
    0
    Thanked
    1 time in 1 post
    Can someone teach me a little of dechipering the MSDN jargon in this?

    Is it possible to use this to gain access to the parallel port from a user program? Or am I delving too far into the land of driver writing?

  3. #3
    Senior Member
    Join Date
    Jan 2005
    Location
    Manchester
    Posts
    2,900
    Thanks
    67
    Thanked
    182 times in 136 posts
    • Butcher's system
      • Motherboard:
      • MSI Z97 Gaming 3
      • CPU:
      • i7-4790K
      • Memory:
      • 8 GB Corsair 1866 MHz
      • Storage:
      • 120GB SSD, 240GB SSD, 2TB HDD
      • Graphics card(s):
      • MSI GTX 970
      • PSU:
      • Antec 650W
      • Case:
      • Big Black Cube!
      • Operating System:
      • Windows 7
    outp and outport are not ansi. Also they are not used for the parallel port, they are used for io ports. Further, you can't use them inside windows unless you're running in kernel mode, which means writing a device driver.

    For standard user-mode output you want to open "LPT1:" as a file and write to it, that'll go to the parallel port. If you need more than simple text you can use the windows GDI to print graphics and text with fonts (use of the windows GDI is beyond the scope of this reply, check MSDN).

  4. #4
    One skin, two skin......
    Join Date
    Jul 2003
    Location
    Durham
    Posts
    1,705
    Thanks
    0
    Thanked
    1 time in 1 post
    Wow, thanks!

    Can I just write hex values to lpt1: ?

    I take it fstream would do the trick, do I just pretend that I'm writing to a file on the hard drive, but the file is called lpt1: rather that starting with c: ?

  5. #5
    Senior Member
    Join Date
    Jan 2005
    Location
    Manchester
    Posts
    2,900
    Thanks
    67
    Thanked
    182 times in 136 posts
    • Butcher's system
      • Motherboard:
      • MSI Z97 Gaming 3
      • CPU:
      • i7-4790K
      • Memory:
      • 8 GB Corsair 1866 MHz
      • Storage:
      • 120GB SSD, 240GB SSD, 2TB HDD
      • Graphics card(s):
      • MSI GTX 970
      • PSU:
      • Antec 650W
      • Case:
      • Big Black Cube!
      • Operating System:
      • Windows 7
    Yes you just open lpt1: with fstream. You can write anything you would normally write to a file or the screen with it.
    e.g.
    Code:
    std::ofstream of;
    if (of.open("LPT1:"))
    {
      of << "Hello world!" << std::endl;
    }

  6. #6
    One skin, two skin......
    Join Date
    Jul 2003
    Location
    Durham
    Posts
    1,705
    Thanks
    0
    Thanked
    1 time in 1 post
    Can I have your children?

    You have just saved me LOADS of research into how the hell to do this. I've been looking for ages. THANKS!!!

  7. #7
    Registered+
    Join Date
    Jul 2004
    Posts
    21
    Thanks
    0
    Thanked
    0 times in 0 posts
    ...if you're just starting out, learn c# instead...much nicer

  8. #8
    Senior Member
    Join Date
    Jan 2005
    Location
    Manchester
    Posts
    2,900
    Thanks
    67
    Thanked
    182 times in 136 posts
    • Butcher's system
      • Motherboard:
      • MSI Z97 Gaming 3
      • CPU:
      • i7-4790K
      • Memory:
      • 8 GB Corsair 1866 MHz
      • Storage:
      • 120GB SSD, 240GB SSD, 2TB HDD
      • Graphics card(s):
      • MSI GTX 970
      • PSU:
      • Antec 650W
      • Case:
      • Big Black Cube!
      • Operating System:
      • Windows 7
    This post is over 3 months old you know?

  9. #9
    Gentoo Ricer
    Join Date
    Jan 2005
    Location
    Galway
    Posts
    11,048
    Thanks
    1,016
    Thanked
    944 times in 704 posts
    • aidanjt's system
      • Motherboard:
      • Asus Strix Z370-G
      • CPU:
      • Intel i7-8700K
      • Memory:
      • 2x8GB Corsiar LPX 3000C15
      • Storage:
      • 500GB Samsung 960 EVO
      • Graphics card(s):
      • EVGA GTX 970 SC ACX 2.0
      • PSU:
      • EVGA G3 750W
      • Case:
      • Fractal Design Define C Mini
      • Operating System:
      • Windows 10 Pro
      • Monitor(s):
      • Asus MG279Q
      • Internet:
      • 240mbps Virgin Cable
    C# is an abombination to children of proceduaral languages :S
    Quote Originally Posted by Agent View Post
    ...every time Creative bring out a new card range their advertising makes it sound like they have discovered a way to insert a thousand Chuck Norris super dwarfs in your ears...

  10. #10
    Registered+
    Join Date
    Jul 2004
    Posts
    21
    Thanks
    0
    Thanked
    0 times in 0 posts
    Get with the program...this is the 21st Century!

  11. #11
    Gentoo Ricer
    Join Date
    Jan 2005
    Location
    Galway
    Posts
    11,048
    Thanks
    1,016
    Thanked
    944 times in 704 posts
    • aidanjt's system
      • Motherboard:
      • Asus Strix Z370-G
      • CPU:
      • Intel i7-8700K
      • Memory:
      • 2x8GB Corsiar LPX 3000C15
      • Storage:
      • 500GB Samsung 960 EVO
      • Graphics card(s):
      • EVGA GTX 970 SC ACX 2.0
      • PSU:
      • EVGA G3 750W
      • Case:
      • Fractal Design Define C Mini
      • Operating System:
      • Windows 10 Pro
      • Monitor(s):
      • Asus MG279Q
      • Internet:
      • 240mbps Virgin Cable
    21st century is the age of tick wasting JIT garbage?
    Quote Originally Posted by Agent View Post
    ...every time Creative bring out a new card range their advertising makes it sound like they have discovered a way to insert a thousand Chuck Norris super dwarfs in your ears...

  12. #12
    Senior Member
    Join Date
    May 2005
    Posts
    434
    Thanks
    0
    Thanked
    0 times in 0 posts
    lol i just notice that dis post os 3 months old, in that time he probably learned c++ already

  13. #13
    Senior Member
    Join Date
    Feb 2005
    Location
    Folsom, CA
    Posts
    221
    Thanks
    0
    Thanked
    0 times in 0 posts
    Quote Originally Posted by aidanjt
    21st century is the age of tick wasting JIT garbage?
    Well said sir...but the advantages are present...and things are getting better...but well said!!

  14. #14
    Registered+
    Join Date
    Jul 2004
    Posts
    21
    Thanks
    0
    Thanked
    0 times in 0 posts
    Quote Originally Posted by aidanjt
    21st century is the age of tick wasting JIT garbage?
    Yeah, lost ticks mean a lot in 99.9% of the apps out there running on 3GHz desktops.

    But I forgot you write time critical sensor stuff for nuclear power plants and such like. Why don't you just stick to machine code and be done with it?

    After all what's the point in making things easy? Christ it means everyone might be able to do it! Ahgghh, my aura, my aura!

  15. #15
    Senior Member
    Join Date
    Jan 2005
    Location
    Manchester
    Posts
    2,900
    Thanks
    67
    Thanked
    182 times in 136 posts
    • Butcher's system
      • Motherboard:
      • MSI Z97 Gaming 3
      • CPU:
      • i7-4790K
      • Memory:
      • 8 GB Corsair 1866 MHz
      • Storage:
      • 120GB SSD, 240GB SSD, 2TB HDD
      • Graphics card(s):
      • MSI GTX 970
      • PSU:
      • Antec 650W
      • Case:
      • Big Black Cube!
      • Operating System:
      • Windows 7
    Use the right tool for the right job. C++ has its place, but it's a different place to that of C#. I don't think learning C# is really any more valid than C++ - better to learn both or just C++ if you can only learn one.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. An interestingly unusual web dev request
    By da_ging in forum Software
    Replies: 5
    Last Post: 06-11-2004, 08:43 PM
  2. Far Cry - Problems with DEV Mode/Cheats
    By Boobam in forum Gaming
    Replies: 3
    Last Post: 15-04-2004, 04:36 PM
  3. Spec me new dev server
    By TiG in forum PC Hardware and Components
    Replies: 55
    Last Post: 01-08-2003, 12:56 PM

Posting Permissions

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