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

Managed C++/CLI

 
GeneralRe: How to run project in c++ in .net Pin
Christian Graus16-Jan-07 8:25
protectorChristian Graus16-Jan-07 8:25 
QuestionWhich contains what?? Pls help Pin
nills_here15-Jan-07 8:02
nills_here15-Jan-07 8:02 
AnswerRe: Which contains what?? Pls help Pin
Mark Salsbery15-Jan-07 8:25
Mark Salsbery15-Jan-07 8:25 
Questionfile creation directory Pin
dellthinker14-Jan-07 19:04
dellthinker14-Jan-07 19:04 
AnswerRe: file creation directory Pin
Christian Graus15-Jan-07 0:09
protectorChristian Graus15-Jan-07 0:09 
QuestionHelp. C++ newbie has problems :p Pin
gumi_r@msn.com13-Jan-07 14:57
gumi_r@msn.com13-Jan-07 14:57 
AnswerRe: Help. C++ newbie has problems :p Pin
Christian Graus13-Jan-07 15:41
protectorChristian Graus13-Jan-07 15:41 
GeneralRe: Help. C++ newbie has problems :p Pin
gumi_r@msn.com13-Jan-07 16:44
gumi_r@msn.com13-Jan-07 16:44 
The only pointer in my class is double* val that is a double array that stores all my matrix items.

Destructor only executes delete [] val and sets the pointer to NULL on exit.
No other pointers are set during the constructor.

The thing is that I'm not getting an error anywhere that i can see when I step through with the debugger. Everything executes perfectly if I put a breakpoint on the exit bracket of my destroy() method (Destructor calls this method, I implemented this way so I can log every call to my destroy method even if called from inside the class like in the assign operator where I have to delete *val before reassigning.) Once I hit the breakpoint and I press continue and the only thing it should do is step out of the Destroy() method and return to the the Test app I get the error. I dont know what's going on at all.

1. Only pointer in my class is private member double *val;
2. Only pointer used in constructor is *val that is set with a new double[whatever];
3. Destructor calls private method destroy() where I delete [] val and log to the console that the destructor was called.

You can see the initMatrix method in my first post, but just for clarification, I'll show the involved methods here:

<rep>
<br />
void FMatrix::initMatrix(unsigned int r,unsigned int c, bool initValues)<br />
{<br />
	rw=r;<br />
	cl=c;<br />
	val=new double[rw*cl];<br />
<br />
#ifdef _DEBUG<br />
	cout <<"++ Matrix created." << endl;<br />
#endif<br />
<br />
	if (initValues)<br />
	{<br />
		for (int i=0;i<rw;i++)<br />
		{<br />
			for (int j=0;j<cl;j++)<br />
				*(val+i*cl+j)=0;<br />
		}<br />
	}<br />
}<br />
<br />
FMatrix::FMatrix(unsigned int dim)<br />
{<br />
	initMatrix(dim,dim,true);<br />
}<br />
<br />
FMatrix::~FMatrix()<br />
{<br />
	destroy();<br />
}<br />
<br />
void FMatrix::destroy()<br />
{<br />
	delete[] val;<br />
	val=NULL;<br />
#ifdef _DEBUG<br />
	cout << "-- Matrix destroyed." << endl;<br />
#endif<br />
}<br />

GeneralRe: Help. C++ newbie has problems :p Pin
Christian Graus13-Jan-07 17:37
protectorChristian Graus13-Jan-07 17:37 
GeneralRe: Help. C++ newbie has problems :p Pin
gumi_r@msn.com13-Jan-07 17:43
gumi_r@msn.com13-Jan-07 17:43 
GeneralRe: Help. C++ newbie has problems :p Pin
Christian Graus13-Jan-07 17:52
protectorChristian Graus13-Jan-07 17:52 
GeneralRe: Help. C++ newbie has problems :p Pin
gumi_r@msn.com13-Jan-07 17:59
gumi_r@msn.com13-Jan-07 17:59 
GeneralRe: Help. C++ newbie has problems :p Pin
Christian Graus13-Jan-07 18:11
protectorChristian Graus13-Jan-07 18:11 
GeneralRe: Help. C++ newbie has problems :p Pin
gumi_r@msn.com14-Jan-07 2:12
gumi_r@msn.com14-Jan-07 2:12 
GeneralRe: Help. C++ newbie has problems :p Pin
gumi_r@msn.com14-Jan-07 2:47
gumi_r@msn.com14-Jan-07 2:47 
GeneralRe: Help. C++ newbie has problems :p Pin
Christian Graus15-Jan-07 0:08
protectorChristian Graus15-Jan-07 0:08 
QuestionSql String Connection Error Pin
Ahmed EL Gendy13-Jan-07 11:56
Ahmed EL Gendy13-Jan-07 11:56 
AnswerRe: Sql String Connection Error Pin
Mark Salsbery13-Jan-07 12:35
Mark Salsbery13-Jan-07 12:35 
QuestionProblem with Datasets in C++/CLI ? Pin
Vinod Sankaranarayanan13-Jan-07 1:26
Vinod Sankaranarayanan13-Jan-07 1:26 
AnswerRe: Problem with Datasets in C++/CLI ? Pin
George L. Jackson13-Jan-07 3:57
George L. Jackson13-Jan-07 3:57 
GeneralRe: Problem with Datasets in C++/CLI ? Pin
Vinod Sankaranarayanan15-Jan-07 19:07
Vinod Sankaranarayanan15-Jan-07 19:07 
GeneralRe: Problem with Datasets in C++/CLI ? Pin
George L. Jackson17-Jan-07 15:45
George L. Jackson17-Jan-07 15:45 
QuestionManaged stream to unmanaged VARIANT Pin
picazo12-Jan-07 6:40
picazo12-Jan-07 6:40 
AnswerRe: Managed stream to unmanaged VARIANT Pin
led mike12-Jan-07 7:15
led mike12-Jan-07 7:15 
GeneralRe: Managed stream to unmanaged VARIANT Pin
picazo12-Jan-07 9:38
picazo12-Jan-07 9:38 

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.