|
-
Feb 1st, 2001, 04:13 PM
#1
Thread Starter
Banned
i just got a new computer about 1 mouth ago. and ill ive been doing is vb. but i wanted to make a small media player, i tryed it and it didnt work. well only had 3 mouths worth off c++. for the hell of it i made hello world. but it dosent work. whats wrong with it?
#include <iostream.h>
intmain()
{
cout<< "hello world/n";
return 0;
}
i dont c any thing worng. do u?
-
Feb 1st, 2001, 04:30 PM
#2
Monday Morning Lunatic
Try:
Code:
#include <iostream.h>
int main() {
cout << "Hello World\n";
return 0;
}
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Feb 1st, 2001, 04:37 PM
#3
Thread Starter
Banned
thx but. . .
it dosent work. it gives me two errors LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 and Debug/h.exe : fatal error LNK1120: 1 unresolved externals. whats wrong???
-
Feb 1st, 2001, 04:38 PM
#4
Monday Morning Lunatic
You need to make sure that your project type is Win32 Console Application rather than Win32 Application.
You're going to have to make a new project.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Feb 1st, 2001, 04:38 PM
#5
Thread Starter
Banned
brb
-
Feb 1st, 2001, 04:43 PM
#6
Thread Starter
Banned
thx
i hate when i do that. but the other code didnt work before and im sure i had win32 Console App on.
do u know how 2 declare winmm.dll i cannt figer it out.
-
Feb 1st, 2001, 04:47 PM
#7
Monday Morning Lunatic
#include <mmsystem.h>
And add "winmm.lib" to the list of libraries under Project Settings->Linker
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Feb 1st, 2001, 04:47 PM
#8
Thread Starter
Banned
-
Feb 1st, 2001, 04:56 PM
#9
Thread Starter
Banned
error in mmsystem.h
when i run it with out any extra code but the declareing of the mmcontrol it gives me errors, in mmsystem.h.
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) : error C2146: syntax error : missing ';' before identifier 'MMVERSION'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) : fatal error C1004: unexpected end of file found
-
Feb 1st, 2001, 05:00 PM
#10
Monday Morning Lunatic
Did you include <windows.h> before <mmsystem.h> ?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Feb 1st, 2001, 05:05 PM
#11
Thread Starter
Banned
o no
no i didnt, thx. this is my 1st time doing something like this.
-
Feb 1st, 2001, 05:08 PM
#12
Thread Starter
Banned
thx
-
Feb 1st, 2001, 05:11 PM
#13
Monday Morning Lunatic
No problem.
Don't worry about errors and stuff like that, it's all part of the learning process. I've been through it as have pretty much every one else. There's no way round it, but it does get easier as you go on
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Feb 1st, 2001, 05:11 PM
#14
Thread Starter
Banned
y?
y dosent it know lpszOpenFlags???
-
Feb 1st, 2001, 05:16 PM
#15
Monday Morning Lunatic
Context? 
What function are you trying to use?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Feb 1st, 2001, 05:25 PM
#16
Thread Starter
Banned
now. . .
to open but soon to play, stop and close. i got it from the msdn library.
-
Feb 2nd, 2001, 07:27 PM
#17
Thread Starter
Banned
o
do u mean i should put something to tell the program what lpszOpenFlags means? like a file name?
-
Feb 2nd, 2001, 07:31 PM
#18
Monday Morning Lunatic
What function are you trying to use?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Feb 2nd, 2001, 07:37 PM
#19
Thread Starter
Banned
open
right now im just trying to open a file. i found this code:
MCIERROR mciSendCommand(MCIDEVICEID wDeviceID, MCI_OPEN, DWORD dwFlags, (DWORD) (LPMCI_OPEN_PARMS) lpOpen);
wsprintf(lpstrCommand, "open %s %s %s", lpszDevice, lpszOpenFlags, lpszFlags);
they both dont work, but the MSDN libery says it should.
-
Feb 2nd, 2001, 07:42 PM
#20
Monday Morning Lunatic
Did you use:
Code:
TCHAR lpstrCommand[256];
wsprintf(lpstrCommand, "open %s %s %s", lpszDevice, lpszOpenFlags, lpszFlags);
You need to have a properly-allocated buffer.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Feb 2nd, 2001, 08:24 PM
#21
Thread Starter
Banned
if state ment not working
i made a menu to do this, and to do the open funtion i put in this code:
int f;
cin >> f;
if (f == 'open');
cout << endl;
cout << "What is the file location?/n";
TCHAR lpstrCommand[256];
TCHAR lpszDevice[256];
TCHAR lpszOpenFlags[256];
TCHAR lpszFlags[256];
wsprintf(lpstrCommand, "open %s %s %s", lpszDevice, lpszOpenFlags, lpszFlags);
but it dosent work. not matter what you type it skips a space then quits. so right now i dont know if it works. but it runs.
-
Feb 3rd, 2001, 06:22 AM
#22
Monday Morning Lunatic
First thing, you need to use a string, since you can't store text in an integer 
Code:
#include <iostream>
#include <string>
using namespace std;
void main() {
string sCmd, sDev, sOpenFlags, sFlags;
cout << "Command: ";
cin >> sCmd;
if(sCmd == "open") {
cout << endl;
cout << "Device: ";
cin >> sDev;
cout << "Open flags: ";
cin >> sOpenFlags;
cout << "Flags: ";
cin >> sFlags;
sCmd = sCmd + " " + sDev + " " + sOpenFlags + " " + sFlags;
cout << "Command == " << sCmd << endl;
}
// So, to get as a character string, use sCmd.c_str()
}
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Feb 3rd, 2001, 04:58 PM
#23
Thread Starter
Banned
o
o thx, but i remember doing it without strings before, maybe i just forgot last time i did c++ was 3 mouths ago.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|