Click here to Skip to main content
15,893,588 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
QuestionHow to use Callback interface from unmanaged code in Managed C++ Pin
dadagiri12322-Oct-11 0:14
dadagiri12322-Oct-11 0:14 
AnswerRe: How to use Callback interface from unmanaged code in Managed C++ Pin
Adam Roderick J26-Oct-11 21:28
Adam Roderick J26-Oct-11 21:28 
GeneralRe: How to use Callback interface from unmanaged code in Managed C++ Pin
Richard MacCutchan26-Oct-11 23:02
mveRichard MacCutchan26-Oct-11 23:02 
AnswerRe: How to use Callback interface from unmanaged code in Managed C++ Pin
Bob Ciora16-Nov-11 0:59
Bob Ciora16-Nov-11 0:59 
QuestionHow and which technology (.NET-WinForms,C++-MIDI MFC based) is the best to use for reading and writing COM Port data? Pin
glitteringsound11-Oct-11 21:55
glitteringsound11-Oct-11 21:55 
Questionprinter driver Pin
dufduf7-Oct-11 20:11
dufduf7-Oct-11 20:11 
AnswerRe: printer driver Pin
Luc Pattyn8-Oct-11 3:48
sitebuilderLuc Pattyn8-Oct-11 3:48 
Question[Need Help] some thing about output Pin
Mike@Shanghai3-Oct-11 22:58
Mike@Shanghai3-Oct-11 22:58 
Hi, everyone. I got some trouble with c++.
IDE: Visual C++ 2010 express
win32 console application

The purpose of this program is: if I input a string such as: "CS101 C++ PROGRAMMING", the string what i've inputed will appear on the screen.

The following is my codes.


#include "stdafx.h"
#include <string>
using std::string;
using std::getline;

#include <iostream>
using std::cin;
using std::cout;
using std::endl;

class GradeBook
{

private:
string courseName;

public:
GradeBook( string name )
{
setCourseName( name );
}

void setCourseName( string name )
{
courseName = name;
}


string getCourseName()
{
return courseName;
}

void displayMessage()
{
cout << "The courseName: " << getCourseName()<<"!" << endl;

}



};

int _tmain(int argc, _TCHAR* argv[])
{

for( int i = 0; i < 2; i ++ )
{ string name;
cout << "Input Grade book [" << i + 1 << "]" << endl;
getline( cin, name );

GradeBook myGradeBook( name );
myGradeBook.getCourseName();

}

return 0;
}



In this program, I've defined a class named GradeBook who has four member functions. In the main function, if i used "myGradeBook.getCourseName()" there will be no result on the screen. If I use "myGradeBook.displayMessage()", the result will appear on the screen.

who can tell me why. Thank you.
AnswerRe: [Need Help] some thing about output Pin
Mike@Shanghai3-Oct-11 23:04
Mike@Shanghai3-Oct-11 23:04 
AnswerRe: [Need Help] some thing about output Pin
Mike@Shanghai3-Oct-11 23:49
Mike@Shanghai3-Oct-11 23:49 
GeneralRe: [Need Help] some thing about output Pin
Richard MacCutchan4-Oct-11 1:28
mveRichard MacCutchan4-Oct-11 1:28 
GeneralRe: [Need Help] some thing about output Pin
Mike@Shanghai4-Oct-11 2:05
Mike@Shanghai4-Oct-11 2:05 
QuestionHow can program tell that itself is running as admin? Pin
Brandon-X120001-Oct-11 5:40
Brandon-X120001-Oct-11 5:40 
AnswerRe: How can program tell that itself is running as admin? Pin
Luc Pattyn1-Oct-11 5:58
sitebuilderLuc Pattyn1-Oct-11 5:58 
GeneralRe: How can program tell that itself is running as admin? Pin
Brandon-X120001-Oct-11 6:13
Brandon-X120001-Oct-11 6:13 
AnswerRe: How can program tell that itself is running as admin? Pin
Luc Pattyn1-Oct-11 6:31
sitebuilderLuc Pattyn1-Oct-11 6:31 
AnswerRe: How can program tell that itself is running as admin? Pin
Richard MacCutchan1-Oct-11 6:02
mveRichard MacCutchan1-Oct-11 6:02 
GeneralRe: How can program tell that itself is running as admin? Pin
Brandon-X120001-Oct-11 6:13
Brandon-X120001-Oct-11 6:13 
GeneralRe: How can program tell that itself is running as admin? Pin
Richard MacCutchan1-Oct-11 6:36
mveRichard MacCutchan1-Oct-11 6:36 
GeneralHandle Leak when Compiling with /clr Option, and _beginthread. Pin
Mike Doner29-Sep-11 6:49
Mike Doner29-Sep-11 6:49 
QuestionShow text after press a button Pin
antonio34327-Sep-11 8:27
antonio34327-Sep-11 8:27 
AnswerRe: Show text after press a button Pin
Albert Holguin29-Sep-11 10:59
professionalAlbert Holguin29-Sep-11 10:59 
Questioncreatefile() API fail for mapped/shared network drives Pin
s v joshi25-Sep-11 23:28
s v joshi25-Sep-11 23:28 
Questioncreate wrapper class in vc ++ Pin
vitthal0902197722-Sep-11 4:31
vitthal0902197722-Sep-11 4:31 
QuestionDifference between a User dump and Kernel dump Pin
rupeshkp72822-Sep-11 0:17
rupeshkp72822-Sep-11 0:17 

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.