Go to Post We are here to support each other. - Mike Martus [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #21   Spotlight this post!  
Unread 30-12-2006, 19:59
6600gt's Avatar
6600gt 6600gt is offline
Registered User
AKA: Lohit
FRC #0226 (Hammerhead)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Troy, MI
Posts: 221
6600gt is a jewel in the rough6600gt is a jewel in the rough6600gt is a jewel in the rough
Re: Visual C++ 2005 Designer

Quote:
Originally Posted by Bob22341 View Post
Your problem comes when "child" calls "parent"

In c++ once you have included a file once, you can't do it again without causing build errors. You create a continual loop with including parent and chile again and again.

If you want to go into inheritance issues and calling parent functions you can, there is an easier way. Create another file called "parenta" and copy over all of the code from "parent" Then slightly change all of the function and class names to avoid build errors, and your almost done.

Change "child" to call "parenta" instead of "parent" and problem solved.

"parent" should include "child" which should include "parenta"

Hopefully that solves your problem
This is not for the null reference exception, is it?

Thanks, anyway, but I think I got the original problem one fixed. The dynamic cast thing seems to be working. This program is already taking much longer than excepted...quite frustrating.

Again, thanks...I really need to get going on this thing.



Ok here is my function in DataView.cpp:

Quote:

Main^ main = dynamic_cast<Main^>(this->MdiParent);

for(count = 1; count < 11; count++)
{
while(main->serialPort1->BytesToRead < 1);

value = main->serialPort1->ReadByte();
value <<= 8;
value += main->serialPort1->ReadByte();

List_Select(count, value);

} // FAILS right after this if there is line after

main->done_flag = 1; //Here
main->~Main(); //Or here if the above line is commented out
System.NullReferenceException

I don't get it: I am just calling something else form the main after the ReadByte(), but I get an Null exception.

Any Ideas?

Last edited by 6600gt : 30-12-2006 at 20:06.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual C++ 2005 Forms 6600gt Programming 7 20-09-2006 00:05
LEGO digital designer tiffany34990 Chit-Chat 2 08-10-2005 07:13
Bridge Designer Cyberguy34000 Chit-Chat 4 13-08-2005 21:07
Graphic Designer / Animator Jay5780 Career 1 05-06-2001 20:05


All times are GMT -5. The time now is 02:09.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi