Author |
Message |
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Tue Mar 21, 2006 5:50 pm Post subject: Eject and Closing CD/DVD tray. (C++) |
|
|
|
|
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:
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:
#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 |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Tue Mar 21, 2006 6:56 pm Post subject: |
|
|
|
|
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 |
|
|
LearJett+ Server Help Squatter
Joined: Jul 11 2005 Posts: 281 Offline
|
Posted: Tue Mar 21, 2006 8:20 pm Post subject: |
|
|
|
|
Push the button. _________________
|
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Wed Mar 22, 2006 12:04 am Post subject: |
|
|
|
|
Still getting the same errors. |
|
Back to top |
|
|
Muskrat Server Help Squatter
Age:37 Joined: Aug 24 2004 Posts: 829 Location: Swamp Offline
|
|
Back to top |
|
|
CypherJF I gargle nitroglycerin
Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Wed Mar 22, 2006 10:12 am Post subject: |
|
|
|
|
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 |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
|
Back to top |
|
|
Mr Ekted Movie Geek
Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Wed Mar 22, 2006 1:00 pm Post subject: |
|
|
|
|
#include "windows.h" _________________ 4,691 irradiated haggis! |
|
Back to top |
|
|
Mr Ekted Movie Geek
Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Wed Mar 22, 2006 1:01 pm Post subject: |
|
|
|
|
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 |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Wed Mar 22, 2006 11:00 pm Post subject: |
|
|
|
|
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 |
|
|
Mr Ekted Movie Geek
Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Wed Mar 22, 2006 11:06 pm Post subject: |
|
|
|
|
I never use the angle brackets. |
|
Back to top |
|
|
hellzlaker Registered Cap Buster Popping men in the ass since Oct 2005
Gender: NEVER ENOUGH! Joined: Oct 27 2005 Posts: 34 Offline
|
Posted: Sun Apr 09, 2006 7:02 pm Post subject: |
|
|
|
|
LearJett+ wrote: | Push the button. | LMAO LMAOOOO thats funny =) and correct |
|
Back to top |
|
|
wEaViL Don't make me turn this forum around!
Age:44 Gender: Joined: Feb 17 2003 Posts: 829 Location: nc usa Offline
|
Posted: Sun Apr 09, 2006 11:06 pm Post subject: |
|
|
|
|
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 |
|
Back to top |
|
|
BDwinsAlt.. Guest
Offline
|
Posted: Mon Apr 10, 2006 8:18 am Post subject: |
|
|
|
|
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 |
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 |
|
Back to top |
|
|
D1st0rt Miss Directed Wannabe
Age:36 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Mon Apr 10, 2006 11:24 am Post subject: |
|
|
|
|
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 |
|
|
Cerium Server Help Squatter
Age:41 Gender: Joined: Mar 05 2005 Posts: 807 Location: I will stab you. Offline
|
Posted: Mon Apr 10, 2006 12:05 pm Post subject: |
|
|
|
|
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 |
|
|
Bak ?ls -s 0 in
Age:25 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: Mon Apr 10, 2006 6:14 pm Post subject: |
|
|
|
|
no way man, have fun with coding while you're young |
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Mon Apr 10, 2006 6:24 pm Post subject: |
|
|
|
|
Bak wrote: | no way man, have fun with coding while you're young |
I like Bak. He's cool. 8) |
|
Back to top |
|
|
Cerium Server Help Squatter
Age:41 Gender: Joined: Mar 05 2005 Posts: 807 Location: I will stab you. Offline
|
Posted: Mon Apr 10, 2006 10:26 pm Post subject: |
|
|
|
|
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 |
|
|
Bak ?ls -s 0 in
Age:25 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: Tue Apr 11, 2006 3:24 am Post subject: |
|
|
|
|
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 |
|
|
Cerium Server Help Squatter
Age:41 Gender: Joined: Mar 05 2005 Posts: 807 Location: I will stab you. Offline
|
Posted: Tue Apr 11, 2006 10:29 am Post subject: |
|
|
|
|
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 |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Tue Apr 11, 2006 5:39 pm Post subject: |
|
|
|
|
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 |
|
|
Cerium Server Help Squatter
Age:41 Gender: Joined: Mar 05 2005 Posts: 807 Location: I will stab you. Offline
|
Posted: Tue Apr 11, 2006 6:14 pm Post subject: |
|
|
|
|
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 |
|
|
D1st0rt Miss Directed Wannabe
Age:36 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
|
Back to top |
|
|
SpecShip Complete twat
Gender: Joined: Dec 17 2005 Posts: 514 Location: 8025 - Spec Freq Offline
|
Posted: Wed Apr 12, 2006 2:48 am Post subject: |
|
|
|
|
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 |
|
|
|