Click here to Skip to main content
16,007,126 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Arrays and enums in an extended control Pin
poppabaggins10-Sep-08 6:50
poppabaggins10-Sep-08 6:50 
QuestionProblem with encoding in Ms Outlook extension Pin
pawelwaw10-Sep-08 0:36
pawelwaw10-Sep-08 0:36 
AnswerRe: Problem with encoding in Ms Outlook extension Pin
led mike10-Sep-08 5:17
led mike10-Sep-08 5:17 
GeneralRe: Problem with encoding in Ms Outlook extension Pin
pawelwaw10-Sep-08 21:30
pawelwaw10-Sep-08 21:30 
QuestionWhat is stack semantics? Pin
Arman Ghazanchyan9-Sep-08 12:18
Arman Ghazanchyan9-Sep-08 12:18 
AnswerRe: What is stack semantics? Pin
Mark Salsbery9-Sep-08 13:14
Mark Salsbery9-Sep-08 13:14 
GeneralRe: What is stack semantics? Pin
Arman Ghazanchyan9-Sep-08 14:44
Arman Ghazanchyan9-Sep-08 14:44 
GeneralRe: What is stack semantics? Pin
Mark Salsbery9-Sep-08 15:44
Mark Salsbery9-Sep-08 15:44 
VBDT wrote:
So what I understand so fare about stack semantics is that it is a way of creating an object that is the same as in native C++, creating objects in the stack. As I can guess from the name “stack semantics” stands for STACK LOGIC. Is this right?


No. "Semantics" in this case means the code just looks like a
native C++ stack allocation. Ref objects can only be allocated on
the managed heap. The stack semantics are just a more native-C++ way
of coding local, short-lived objects.

Essentially, this:
{
   // stack semantics

   FileStream filestream(...);
   ...
}

is the same as this:
{
   // dynamic allocation semantics

   FileStream ^filestream = gcnew FileStream(...);
   ...
   delete filestream;
}

In both cases above, the object is allocated using gcnew,
and when the object goes out of scope, the class destructor
is called. The difference is, the compiler adds those gcnew/delete
calls for you when you use stack semantics.

Mark

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: What is stack semantics? Pin
Arman Ghazanchyan9-Sep-08 16:21
Arman Ghazanchyan9-Sep-08 16:21 
Questionguide created file.exe for vc++6.0. thanks very much Pin
aa_zz8-Sep-08 16:16
aa_zz8-Sep-08 16:16 
QuestionSome basic questions! Pin
Arman Ghazanchyan8-Sep-08 8:53
Arman Ghazanchyan8-Sep-08 8:53 
AnswerRe: Some basic questions! Pin
Mark Salsbery8-Sep-08 9:40
Mark Salsbery8-Sep-08 9:40 
GeneralRe: Some basic questions! Pin
Arman Ghazanchyan8-Sep-08 9:54
Arman Ghazanchyan8-Sep-08 9:54 
GeneralRe: Some basic questions! Pin
Mark Salsbery8-Sep-08 9:57
Mark Salsbery8-Sep-08 9:57 
QuestionRe: Some basic questions! Pin
Arman Ghazanchyan8-Sep-08 9:56
Arman Ghazanchyan8-Sep-08 9:56 
AnswerRe: Some basic questions! Pin
Mark Salsbery8-Sep-08 10:01
Mark Salsbery8-Sep-08 10:01 
GeneralRe: Some basic questions! Pin
Arman Ghazanchyan8-Sep-08 10:06
Arman Ghazanchyan8-Sep-08 10:06 
QuestionTurning Existing Pile of Code into DLL Pin
Oddball5-Sep-08 5:08
Oddball5-Sep-08 5:08 
AnswerRe: Turning Existing Pile of Code into DLL Pin
led mike5-Sep-08 5:20
led mike5-Sep-08 5:20 
GeneralRe: Turning Existing Pile of Code into DLL Pin
Oddball5-Sep-08 5:28
Oddball5-Sep-08 5:28 
QuestionTo Fill DataSource of my ComBobox with Paper Orientation Enumeration Pin
mikobi2-Sep-08 19:52
mikobi2-Sep-08 19:52 
QuestionRAR compression Pin
dSolariuM29-Aug-08 19:38
dSolariuM29-Aug-08 19:38 
AnswerRe: RAR compression Pin
Paul Conrad30-Aug-08 8:05
professionalPaul Conrad30-Aug-08 8:05 
QuestionUpgrading vc 2003 project to vc 2008 Pin
Robin Imrie28-Aug-08 22:24
professionalRobin Imrie28-Aug-08 22:24 
AnswerRe: Upgrading vc 2003 project to vc 2008 Pin
Mark Salsbery29-Aug-08 9:19
Mark Salsbery29-Aug-08 9:19 

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.