Click here to Skip to main content
15,897,334 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Question about memory locations. Pin
Lord Kixdemp1-Jul-06 17:00
Lord Kixdemp1-Jul-06 17:00 
QuestionApplication failed to initialize using Detours [modified] Pin
Sam Hobbs24-Jun-06 15:21
Sam Hobbs24-Jun-06 15:21 
QuestionIE Toolbar or BHO Images and Temp Folder Location Pin
Ranjan Banerji24-Jun-06 15:11
Ranjan Banerji24-Jun-06 15:11 
AnswerRe: IE Toolbar or BHO Images and Temp Folder Location Pin
Michael Dunn24-Jun-06 15:29
sitebuilderMichael Dunn24-Jun-06 15:29 
GeneralRe: IE Toolbar or BHO Images and Temp Folder Location Pin
Ranjan Banerji25-Jun-06 5:51
Ranjan Banerji25-Jun-06 5:51 
GeneralRe: IE Toolbar or BHO Images and Temp Folder Location Pin
Michael Dunn25-Jun-06 7:55
sitebuilderMichael Dunn25-Jun-06 7:55 
GeneralRe: IE Toolbar or BHO Images and Temp Folder Location Pin
Ranjan Banerji25-Jun-06 8:01
Ranjan Banerji25-Jun-06 8:01 
QuestionUnhandled Exception when outputting strings [modified] Pin
capricious_00124-Jun-06 12:50
capricious_00124-Jun-06 12:50 
Hey Guys,

I'm using VC++ 6.0 and I'm having a very stupid problem. I get an unhandled exception error when try to output a string to console. Even the simplest program such as the one below:

main.cpp
#include "stdafx.h"
#include <iostream>
#include <string>

using namespace std;


void main(void )
{

	string s = "test=2321";

	cout << s;

}


Will produce an error. I built the same program in Metrowerks Codewarrior, and the program runs fine. No problems whatsoever. For some reason I have problems with it in VC++. This is what i have in my other include file:

stdfx.h
// stdafx.h : include file for standard system include files,
//  or project specific include files that are used frequently, but
//      are changed infrequently
//

#if !defined(AFX_STDAFX_H__A9693917_A7C9_4A6A_B3E1_58638AE54078__INCLUDED_)
#define AFX_STDAFX_H__A9693917_A7C9_4A6A_B3E1_58638AE54078__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers

//#include <stdio.h>
#include <iostream>
#include <string>

// TODO: reference additional headers your program requires here

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_STDAFX_H__A9693917_A7C9_4A6A_B3E1_58638AE54078__INCLUDED_)


I will also list my project options:

kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/testing_project2.pdb" /debug /machine:I386 /out:"Debug/testing_project2.exe" /pdbtype:sept 


Does anyone know the reason why this is occuring? I would appreciate any light on the issue.

Thanks,

Robbie

-- modified at 18:50 Saturday 24th June, 2006
AnswerRe: Unhandled Exception when outputting strings Pin
Michael Dunn24-Jun-06 13:00
sitebuilderMichael Dunn24-Jun-06 13:00 
GeneralRe: Unhandled Exception when outputting strings Pin
capricious_00124-Jun-06 13:16
capricious_00124-Jun-06 13:16 
AnswerRe: Unhandled Exception when outputting strings Pin
Jun Du24-Jun-06 13:22
Jun Du24-Jun-06 13:22 
AnswerRe: Unhandled Exception when outputting strings [modified] Pin
Sam Hobbs24-Jun-06 15:35
Sam Hobbs24-Jun-06 15:35 
AnswerRe: Unhandled Exception when outputting strings Pin
Stephen Hewitt24-Jun-06 17:41
Stephen Hewitt24-Jun-06 17:41 
QuestionRe: Unhandled Exception when outputting strings Pin
capricious_00125-Jun-06 2:10
capricious_00125-Jun-06 2:10 
Questionasp help Pin
khasiguy24-Jun-06 9:42
khasiguy24-Jun-06 9:42 
AnswerRe: asp help Pin
Michael Dunn24-Jun-06 12:29
sitebuilderMichael Dunn24-Jun-06 12:29 
QuestionGet MAC help Pin
borono24-Jun-06 9:42
borono24-Jun-06 9:42 
AnswerRe: Get MAC help Pin
Michael Dunn24-Jun-06 12:32
sitebuilderMichael Dunn24-Jun-06 12:32 
GeneralRe: Get MAC help Pin
borono24-Jun-06 15:00
borono24-Jun-06 15:00 
GeneralRe: Get MAC help Pin
Michael Dunn24-Jun-06 15:32
sitebuilderMichael Dunn24-Jun-06 15:32 
GeneralRe: Get MAC help Pin
borono24-Jun-06 15:54
borono24-Jun-06 15:54 
QuestionBeautify XML Pin
Ed K24-Jun-06 7:33
Ed K24-Jun-06 7:33 
QuestionHELP! * Accurate Text Extent needing * Pin
Furno Gianluca24-Jun-06 7:09
Furno Gianluca24-Jun-06 7:09 
QuestionC# and C++ and COM variables Pin
Dave_Roach24-Jun-06 6:35
Dave_Roach24-Jun-06 6:35 
QuestionCWnd::OnEnable and CWnd display Pin
Gilles0660024-Jun-06 5:52
Gilles0660024-Jun-06 5:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.