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

Managed C++/CLI

 
GeneralRe: Having problems with an array of objects Pin
Mark Salsbery24-Jul-07 15:46
Mark Salsbery24-Jul-07 15:46 
GeneralRe: Having problems with an array of objects Pin
George L. Jackson24-Jul-07 15:45
George L. Jackson24-Jul-07 15:45 
AnswerRe: Having problems with an array of objects Pin
Mark Salsbery24-Jul-07 8:32
Mark Salsbery24-Jul-07 8:32 
GeneralRe: Having problems with an array of objects Pin
BuckBrown24-Jul-07 9:54
BuckBrown24-Jul-07 9:54 
GeneralRe: Having problems with an array of objects Pin
Mark Salsbery24-Jul-07 10:18
Mark Salsbery24-Jul-07 10:18 
GeneralRe: Having problems with an array of objects Pin
BuckBrown24-Jul-07 11:14
BuckBrown24-Jul-07 11:14 
GeneralRe: Having problems with an array of objects Pin
Mark Salsbery24-Jul-07 11:37
Mark Salsbery24-Jul-07 11:37 
GeneralRe: Having problems with an array of objects Pin
BuckBrown24-Jul-07 12:15
BuckBrown24-Jul-07 12:15 
Okay, getting closer. This has to be a scope issue. Just as before, the two dimensional array was initialized, then the one dimensional array was initialized (inside the CWafer constructor). Then several functions are called from within the constructor, one of those accesses these arrays. When the function is called the arrays become undefined. I suppose I might be able to pass them as arguments but there is some confusion on how gcnew works. In C++ MFC I would declare types in the header file and then create them with "new" in the constructor. Then if I called a series of functions from the constructor I could "see" within the functions the type as I had defined it in the constructor. If I use "gcnew" then call a function from the constructor the definition is immeadiately lost. I saw this same behavior with another class where my CWafer class had to instantiate a CLtx class (contains some parameters that my CWafer class uses). In the CWafer constructor I instantiated a "CLtx^ LtxFile = gcnew CLtx^;" because I wanted all kinds of CWafer functions to use LtxFile. Unfortunately I had to instantiate the LtxFile inside of each function as it was called. This basic difference in scope is huge and causing me all kinds of problems (current one included). I understand that the garbage collected heap will release the memory when it is no longer needed but why is it reclaiming memory just because I have called a function from within the CWafer constructor?

Buck
GeneralRe: Having problems with an array of objects Pin
Mark Salsbery24-Jul-07 12:49
Mark Salsbery24-Jul-07 12:49 
GeneralRe: Having problems with an array of objects Pin
BuckBrown25-Jul-07 6:43
BuckBrown25-Jul-07 6:43 
GeneralRe: Having problems with an array of objects Pin
Mark Salsbery24-Jul-07 11:47
Mark Salsbery24-Jul-07 11:47 
QuestionTo Setfocus to a control Pin
mikobi24-Jul-07 4:24
mikobi24-Jul-07 4:24 
AnswerRe: To Setfocus to a control Pin
led mike24-Jul-07 4:36
led mike24-Jul-07 4:36 
QuestionNative code step through goes out of sync Pin
originSH24-Jul-07 1:08
originSH24-Jul-07 1:08 
AnswerRe: Native code step through goes out of sync Pin
Bartosz Bien27-Jul-07 11:13
Bartosz Bien27-Jul-07 11:13 
Questionms office automation from NT service in 64 bit OS Pin
indra2023-Jul-07 20:39
indra2023-Jul-07 20:39 
AnswerRe: ms office automation from NT service in 64 bit OS Pin
Christian Graus23-Jul-07 20:46
protectorChristian Graus23-Jul-07 20:46 
GeneralRe: ms office automation from NT service in 64 bit OS Pin
indra2023-Jul-07 21:01
indra2023-Jul-07 21:01 
GeneralRe: ms office automation from NT service in 64 bit OS Pin
Christian Graus23-Jul-07 23:38
protectorChristian Graus23-Jul-07 23:38 
QuestionEliminate the Save As Dialog Box Pin
flias200123-Jul-07 8:56
flias200123-Jul-07 8:56 
AnswerRe: Eliminate the Save As Dialog Box Pin
Christian Graus23-Jul-07 19:29
protectorChristian Graus23-Jul-07 19:29 
Questiondifference between these directives Pin
andersod223-Jul-07 8:51
andersod223-Jul-07 8:51 
AnswerRe: difference between these directives Pin
Mark Salsbery23-Jul-07 10:09
Mark Salsbery23-Jul-07 10:09 
QuestionMixed C++ won't invoke JIT Pin
anthonym723-Jul-07 8:45
anthonym723-Jul-07 8:45 
QuestionNeed for Virtual Function? Pin
Arun Chakaravarthy22-Jul-07 20:37
Arun Chakaravarthy22-Jul-07 20:37 

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.