Click here to Skip to main content
16,004,974 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: File association Pin
-Dy5-Aug-02 0:24
-Dy5-Aug-02 0:24 
GeneralInheritance without the classwizard Pin
-Dy30-Jul-02 22:57
-Dy30-Jul-02 22:57 
GeneralRe: Inheritance without the classwizard Pin
Tomasz Sowinski30-Jul-02 23:46
Tomasz Sowinski30-Jul-02 23:46 
GeneralIScriptControl question Pin
Hans Ruck30-Jul-02 22:01
Hans Ruck30-Jul-02 22:01 
Questiong-d dammit... where the hell is this defined??? Pin
Roman Nurik30-Jul-02 21:00
Roman Nurik30-Jul-02 21:00 
AnswerRe: g-d dammit... where the hell is this defined??? Pin
Nish Nishant30-Jul-02 21:08
sitebuilderNish Nishant30-Jul-02 21:08 
GeneralRe: g-d dammit... where the hell is this defined??? Pin
Roman Nurik31-Jul-02 7:13
Roman Nurik31-Jul-02 7:13 
GeneralCArrays of CArrays! Pin
JennyP30-Jul-02 18:17
JennyP30-Jul-02 18:17 
Hello,

I've a data structure which is nested CArray structures 3 deep (years full of single years full of days full of hours).

Here is my .h code:

/* Structure to hold schedule information.  Intent:<br />
SchYear[year].SchDay[DayOfYear].SchGoal[goal_sched_this_day].Num (or) ..Minutes.0<br />
*/<br />
struct t_SchGoal {<br />
	UINT Num		: 21; // Goal Number<br />
	UINT Minutes		: 11; // # of minutes this requires in this day<br />
};<br />
<br />
struct t_SchDay {<br />
	CArray <t_SchGoal, t_SchGoal&> SchGoal;<br />
	UINT AvailableMinutes	: 30;<br />
	UINT bOverridden		: 1; // Flag if user has overridden the default Available Minutes for that Day.<br />
};<br />
<br />
struct t_SchYear {<br />
	CArray <t_SchDay, t_SchDay&> SchDay;<br />
};<br />
/* END schedule structure stuff..........................................*/



Then, there's the member of my document:

CArray <t_SchYear, t_SchYear&> m_SchYears;

In the CDoc init routine, I set all of the "AvailableMinutes" to 60 and I can verify this with the VC++ debugger (shows the nested m_SchYears structure tree and "AvailableMinutes" = 60).

However, when I try to access this value in code:

AvailMinutes = m_SchYears[YearIndex].SchDay[DayOfYear].AvailableMinutes;

I get nothing but 0 (instead of 60 that I KNOW is in there).

Upon trying the following code:

AvailMinutes = ((m_SchYears.GetAt(YearIndex)).SchDay.GetAt(DayOfYear)).AvailableMinutes;

The compiler complains that there is no copy constructor for my structures which is true since they're not classes. CArray has two return values for operator []--one of which is a &TYPE which is why I'm able to get away with the first line. However, it doesn't work.

I would rather not make indidual classes of each of these structures but I fear I may have to. Does anyone have any insight in to finding a way to get what I want? Or general academic comments on this situation?

Thanks! Wink | ;)

JennyP
GeneralRe: CArrays of CArrays! Pin
JennyP30-Jul-02 18:22
JennyP30-Jul-02 18:22 
GeneralRe: CArrays of CArrays! Pin
Nish Nishant30-Jul-02 18:44
sitebuilderNish Nishant30-Jul-02 18:44 
GeneralRe: CArrays of CArrays! Pin
Daniel Lohmann30-Jul-02 21:13
Daniel Lohmann30-Jul-02 21:13 
GeneralRe: CArrays of CArrays! Pin
Roman Nurik30-Jul-02 18:58
Roman Nurik30-Jul-02 18:58 
GeneralRe: CArrays of CArrays! Pin
Roman Nurik30-Jul-02 19:00
Roman Nurik30-Jul-02 19:00 
GeneralRe: CArrays of CArrays! Pin
JennyP30-Jul-02 20:11
JennyP30-Jul-02 20:11 
GeneralRe: CArrays of CArrays! Pin
Alexandru Savescu30-Jul-02 22:45
Alexandru Savescu30-Jul-02 22:45 
GeneralRe: CArrays of CArrays! Pin
Daniel Lohmann31-Jul-02 2:35
Daniel Lohmann31-Jul-02 2:35 
GeneralRe: CArrays of CArrays! Pin
JennyP31-Jul-02 6:19
JennyP31-Jul-02 6:19 
GeneralRe: CArrays of CArrays! Pin
Roman Nurik31-Jul-02 7:16
Roman Nurik31-Jul-02 7:16 
GeneralPrint Preview - Sanity Check Please Pin
Russell Robinson30-Jul-02 17:34
Russell Robinson30-Jul-02 17:34 
GeneralRe: Print Preview - Sanity Check Please Pin
Chris Losinger30-Jul-02 18:44
professionalChris Losinger30-Jul-02 18:44 
GeneralRe: Print Preview - Sanity Check Please Pin
Roman Nurik30-Jul-02 19:02
Roman Nurik30-Jul-02 19:02 
GeneralMultiple Line Edit Box Pin
Stew30-Jul-02 17:33
Stew30-Jul-02 17:33 
GeneralRe: Multiple Line Edit Box Pin
Chris Losinger30-Jul-02 18:45
professionalChris Losinger30-Jul-02 18:45 
GeneralRe: Multiple Line Edit Box Pin
Stew31-Jul-02 8:11
Stew31-Jul-02 8:11 
GeneralRe: Multiple Line Edit Box Pin
Chris Losinger31-Jul-02 8:15
professionalChris Losinger31-Jul-02 8:15 

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.