Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Eject and Closing CD/DVD tray. (C++)
Goto page 1, 2  Next
 
Post new topic   Reply to topic Printable version
 View previous topic  PHP-based File Browser Post :: Post 2D polygon version of subspace  View next topic  
Author Message
BDwinsAlt
Agurus's Posse


Age:28
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Tue Mar 21, 2006 5:50 pm    Post subject: Eject and Closing CD/DVD tray. (C++) Reply to topic Reply with quote

How do I go about Opening and Closing my CD and/or DVD drive.
I've looked around on google but nothing seems to work. I figured one of you guys may know how. I'll keep searching while i wait for a reply. I'm not giving up :p

Ignore the name below, i just typed in the first word i saw when i was making the project.

I get these errors:

Code: Show/Hide

c:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\virus\virus.cpp(18): error C2447: '{' : missing function header (old-style formal list?)
c:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\virus\virus.cpp(18): error C2143: syntax error : missing ';' before '{'
c:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\virus\virus.cpp(17): error C2182: 'CDRomOpen' : illegal use of type 'void'
c:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\virus\virus.cpp(17): error C2146: syntax error : missing ')' before identifier 'bOpenDrive'
c:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\virus\virus.cpp(17): error C2065: 'BOOL' : undeclared identifier
c:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\virus\virus.cpp(17): error C2059: syntax error : ')'



I'm using this code:

Code: Show/Hide

#include <iostream>
#include <cstdlib>
#include <stdio.h>

using namespace std;

main()
{
   int response;
   printf("Type '1' to continue.\n");
   cin >> response;
   if(response == 1){
     void CDRomOpen();
   }
}

void CDRomOpen(BOOL bOpenDrive, char *drive)
{
    MCI_OPEN_PARMS open;
    DWORD flags;

    ZeroMemory(&open, sizeof(MCI_OPEN_PARMS));

    open.lpstrDeviceType = (LPCSTR) MCI_DEVTYPE_CD_AUDIO;
    open.lpstrElementName = drive;

    flags = MCI_OPEN_TYPE | MCI_OPEN_TYPE_ID;

    if (!mciSendCommand(0, MCI_OPEN, flags, (DWORD) &open))
    {
        mciSendCommand(open.wDeviceID, MCI_SET, (bOpenDrive) ?
                       MCI_SET_DOOR_OPEN : MCI_SET_DOOR_CLOSED, 0);
        mciSendCommand(open.wDeviceID, MCI_CLOSE, MCI_WAIT, 0);
    }
}
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Dr Brain
Flip-flopping like a wind surfer


Age:32
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Tue Mar 21, 2006 6:56 pm    Post subject: Reply to topic Reply with quote

main doesn't have a type. You need to use either void main or int main.
_________________
Hyperspace Owner

Smong> so long as 99% deaths feel lame it will always be hyperspace to me
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
LearJett+
Server Help Squatter


Joined: Jul 11 2005
Posts: 281
Offline

PostPosted: Tue Mar 21, 2006 8:20 pm    Post subject: Reply to topic Reply with quote

Push the button.
_________________
Back to top
View users profile Send private message Add User to Ignore List
BDwinsAlt
Agurus's Posse


Age:28
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Wed Mar 22, 2006 12:04 am    Post subject: Reply to topic Reply with quote

Still getting the same errors.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Muskrat
Server Help Squatter


Age:31
Joined: Aug 24 2004
Posts: 828
Location: Swamp
Offline

PostPosted: Wed Mar 22, 2006 12:24 am    Post subject: Re: Eject and Closing CD/DVD tray. (C++) Reply to topic Reply with quote

BDwinsAlt wrote:

Code: Show/Hide

   if(response == 1){
     void CDRomOpen();
   }


When you call a function, dont put a return type.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2579
Location: USA
Offline

PostPosted: Wed Mar 22, 2006 10:12 am    Post subject: Reply to topic Reply with quote

He really needs to take that line and bump it above the main method.
_________________
Performance is often the art of cheating carefully. - James Gosling
Back to top
View users profile Send private message Add User to Ignore List
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Wed Mar 22, 2006 11:17 am    Post subject: Reply to topic Reply with quote

You seem to be mixing c and c++ headers: (although that's not your problem)
Code: Show/Hide
#include <iostream>
#include <cstdlib>
#include <stdio.h>

Do a search on prototypes and what they are in the context of programming c/c++.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Wed Mar 22, 2006 1:00 pm    Post subject: Reply to topic Reply with quote

#include "windows.h"
_________________
4,691 irradiated haggis!
Back to top
View users profile Send private message Add User to Ignore List
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Wed Mar 22, 2006 1:01 pm    Post subject: Reply to topic Reply with quote

Before main do:

void CDRomOpen (BOOL, char *);

And when you call a function, you need to pass it params of the type(s) that it takes. In this case, something like:

CDRomOpen(1, "d:")
Back to top
View users profile Send private message Add User to Ignore List
Cyan~Fire
I'll count you!
I'll count you!


Age:30
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Wed Mar 22, 2006 11:00 pm    Post subject: Reply to topic Reply with quote

Mr Ekted wrote:
#include "windows.h"

<windows.h>?
_________________
This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Wed Mar 22, 2006 11:06 pm    Post subject: Reply to topic Reply with quote

I never use the angle brackets.
Back to top
View users profile Send private message Add User to Ignore List
hellzlaker
Registered Cap Buster
Popping men in the ass since Oct 2005


Gender: NEVER ENOUGH!
Joined: Oct 27 2005
Posts: 34
Offline

PostPosted: Sun Apr 09, 2006 7:02 pm    Post subject: Reply to topic Reply with quote

LearJett+ wrote:
Push the button.
LMAO LMAOOOO thats funny =) and correct
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address MSN Messenger
wEaViL
Don't make me turn this forum around!


Age:38
Gender:Gender:Male
Joined: Feb 17 2003
Posts: 829
Location: nc usa
Offline

PostPosted: Sun Apr 09, 2006 11:06 pm    Post subject: Reply to topic Reply with quote

I have nothing to contribute but judging from the name of the file imma take a shot in the dark and say your making one of them virus trick programs that pretends to do all that wack stuff to a comp as a prank? Just curious icon_lol.gif
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address Yahoo Messenger MSN Messenger
BDwinsAlt..
Guest


Offline

PostPosted: Mon Apr 10, 2006 8:18 am    Post subject: Reply to topic Reply with quote

wEaViL wrote:
I have nothing to contribute but judging from the name of the file imma take a shot in the dark and say your making one of them virus trick programs that pretends to do all that wack stuff to a comp as a prank? Just curious icon_lol.gif


Yea, I was going to make my mom think she had a virus. I didn't want to give her a real one. Just one that makes messages pop-up and cdrom eject and all. I got the message boxes working. My mom always blames me if her pc messes up and I always use my own pc. I wanna see her blame me again icon_lol.gif
Back to top
D1st0rt
Miss Directed Wannabe


Age:30
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Mon Apr 10, 2006 11:24 am    Post subject: Reply to topic Reply with quote

You want to see her blame you for making her computer act funny after you make her computer act funny?

Am I missing something?
_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Cerium
Server Help Squatter


Age:36
Gender:Gender:Male
Joined: Mar 05 2005
Posts: 807
Location: I will stab you.
Offline

PostPosted: Mon Apr 10, 2006 12:05 pm    Post subject: Reply to topic Reply with quote

This is more immature than all of my 'kill yourself' comments combined.

Why go through all of the effort to make something as useless as this? Hell, why not just install VNC then open the SEEDEEROM from your computer. LOLOLOLZ! SHED BE LIKE WTF AND YOUD GO OMG LOL! AND SHED BE LIKE BDALTWINS GET DOWN HERE AND FIX0RZ MY COMPZ!

I dont see why you goddamn 15 year olds are so fuckin obsessed with making people think you made a virus. Nothing earns trust like a program that fucks with someones computer. Hey, why dont you tell your mom she can speed up her computer by adding "format C: /y" to her autoexec.bat.

God I hate you kids; grow the fuck up, or... you know... kill yourselves.
_________________
There are 7 user(s) ignoring me right now.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Bak
?ls -s
0 in


Age:19
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Mon Apr 10, 2006 6:14 pm    Post subject: Reply to topic Reply with quote

no way man, have fun with coding while you're young
Back to top
View users profile Send private message Add User to Ignore List AIM Address
BDwinsAlt
Agurus's Posse


Age:28
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Mon Apr 10, 2006 6:24 pm    Post subject: Reply to topic Reply with quote

Bak wrote:
no way man, have fun with coding while you're young

I like Bak. He's cool. 8)
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Cerium
Server Help Squatter


Age:36
Gender:Gender:Male
Joined: Mar 05 2005
Posts: 807
Location: I will stab you.
Offline

PostPosted: Mon Apr 10, 2006 10:26 pm    Post subject: Reply to topic Reply with quote

Have fun doing what exactly? Writing malicious and useless software? Why dont you just teach him how to edit IRC trojans, setup a botnet and ddos people, all in the name of fun.
This entire project is a fucking waste of time -- especially since he didnt even write the goddamn function that actually opens or closes the CDRom, hes just calling it from his broken ass program.

Dont encourage this script kiddie bullshit. People like you and I have to deal with dumbass users who are on the receiving end of this faggots 'fun'.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Bak
?ls -s
0 in


Age:19
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Tue Apr 11, 2006 3:24 am    Post subject: Reply to topic Reply with quote

You have to chillax cerium, I doubt he's going to release his cd-rom opening program into the wild. He's just playing a prank on his parents and maybe picking up some c++ in the process.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Cerium
Server Help Squatter


Age:36
Gender:Gender:Male
Joined: Mar 05 2005
Posts: 807
Location: I will stab you.
Offline

PostPosted: Tue Apr 11, 2006 10:29 am    Post subject: Reply to topic Reply with quote

Yeah, for now.
Where do you think the next step is? "Oh, well that was fun tricking my mother, I think Ill write a new compression algo now". Sorry, it wont work that way -- this is only going to escalate.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
BDwinsAlt
Agurus's Posse


Age:28
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Tue Apr 11, 2006 5:39 pm    Post subject: Reply to topic Reply with quote

I just wanted to learn gosh. I wasn't going to release anything remotely harmful to anyone. If I wanted to do evil things to people I would send them the Prorat trojan. I tried 4 anti-viruses to get rid of it. So later I used a special process manager and deleted the process then deleted all the infected files and files protecting it. I don't plan on making that happen to anyone else. I just wanted to have some fun and show my mom what I learned how to do. You freak out because I don't understand everything yet. Here's a little something, you learn little by little. You can't spell a word until you know how to write the letters. Please just help me along the way of the right path. All I ask is for a little respect, ok. I don't care how much you hate me, just show a little respect. It won't kill you, if it does then maybe it's for the best.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Cerium
Server Help Squatter


Age:36
Gender:Gender:Male
Joined: Mar 05 2005
Posts: 807
Location: I will stab you.
Offline

PostPosted: Tue Apr 11, 2006 6:14 pm    Post subject: Reply to topic Reply with quote

BDwinsAlt wrote:
I just wanted to learn gosh. I wasn't going to release anything remotely harmful to anyone.


Your mother qualifies as 'anyone'.


BDwinsAlt wrote:
If I wanted to do evil things to people I would send them the Prorat trojan. I tried 4 anti-viruses to get rid of it. So later I used a special process manager and deleted the process then deleted all the infected files and files protecting it.


This only qualifies as a very loosly fitting metaphore.


BDwinsAlt wrote:
I don't plan on making that happen to anyone else. I just wanted to have some fun and show my mom what I learned how to do.


So make something useful, or you could go the ultra sissy route and make something cheesy like a mothers day popup or birthday notice. There are literally hundreds of thousands of other things you could do that (a) show off what youve 'learned' and (b) dont piss off the person youre demonstrating for. Use a little common sense.


BDwinsAlt wrote:
You freak out because I don't understand everything yet.


No, Im 'freaking out' because theres this annoying trend with you non-adult teenagers where you seem to think its l33t to take what little programming knowledge you have and use it to try to fuck with somebody. Its an awful way to advance your abilities and removes any trust people had in you.


BDwinsAlt wrote:
Here's a little something, you learn little by little. You can't spell a word until you know how to write the letters.


Youre right, you do learn little by litte, but why do you insist on taking these baby steps down the path of the script kiddie with a language you clearly dont understand yet?
The word metaphore is also as terrible as your first one. When you were learning how to read and write, how many times did the teacher have you write death threats to your parents?


BDwinsAlt wrote:
Please just help me along the way of the right path.


Ill help people when (a) Im damn sure I know what Im talking about and (b) their project doesnt have malicious intent. So far I havent seen you do anything that meets both of these qualifications.


BDwinsAlt wrote:
All I ask is for a little respect, ok. I don't care how much you hate me, just show a little respect. It won't kill you, if it does then maybe it's for the best.


Ill respect you when you do something respectable. Take a look around these forums and who I reply to. Ever notice how the only people I flame are those who are under the age of 18? Try to find a post where Im ripping into D1st0rt, Ekted or MGB. Just try.

Im sick of your halfassed attempts at justification. What youre doing is wrong, plain and simple. Theres no gray area here. If you want to learn how to program, great. There are books, tutorials, free code and people all over the internet for you to learn from. There is absolutely no reason for you to be making applications like this. If you honestly believe this is the best way for you to learn, then I ask that you stay the fuck out of my field.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
D1st0rt
Miss Directed Wannabe


Age:30
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Tue Apr 11, 2006 11:50 pm    Post subject: Reply to topic Reply with quote

Don't be like this guy:
http://forums.minegoboom.com/viewtopic.php?t=5393
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
SpecShip
Complete twat


Gender:Gender:Male
Joined: Dec 17 2005
Posts: 514
Location: 8025 - Spec Freq
Offline

PostPosted: Wed Apr 12, 2006 2:48 am    Post subject: Reply to topic Reply with quote

I'm siding with Cerium.
BD, you're a dumbass.

Also, why goto lengths of quirky buggy virus when you can just install VNC and fuck up with her PC any way you want in real time.

Hell, you can make GOD speak to her via notepad...
_________________
Replacing yazour untill the whore returns.

"I could run a ss server on my car stereo!" -Xalimar
"Liberta tuit ma ex infernis" -Event Horizon
"I know too much about nothing." - Mine GO BOOM
"Hmm anyway, back to my kingdom hearts." - Chambahs
Back to top
View users profile Send private message Add User to Ignore List
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Non-Subspace Related Coding All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 74 page(s) served in previous 5 minutes.

phpBB Created this page in 0.101000 seconds : 49 queries executed (44.0%): GZIP compression disabled