Click here to Skip to main content
15,921,941 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDAO.... Pin
Anonymous24-Mar-03 7:07
Anonymous24-Mar-03 7:07 
GeneralMDI child windows Pin
Steven M Hunt24-Mar-03 6:56
Steven M Hunt24-Mar-03 6:56 
GeneralRe: MDI child windows Pin
Maximilien24-Mar-03 7:08
Maximilien24-Mar-03 7:08 
GeneralThe example of using CStringList needed Pin
Sharkky24-Mar-03 6:35
Sharkky24-Mar-03 6:35 
GeneralRe: The example of using CStringList needed Pin
Ravi Bhavnani24-Mar-03 8:20
professionalRavi Bhavnani24-Mar-03 8:20 
Questionhow to converts a string that has been encoded for transmission in a URL into a decoded string? Pin
rafaelcn24-Mar-03 6:31
rafaelcn24-Mar-03 6:31 
GeneralPeculiar timing problem when creating UI ... Pin
Maximilien24-Mar-03 6:25
Maximilien24-Mar-03 6:25 
GeneralSerialize 2D-array and app slowdown *long thread* Pin
Jakob Bysewski24-Mar-03 6:20
Jakob Bysewski24-Mar-03 6:20 
Hi!
I've the following code:

In my CDocument based class:

//Scripting support
class CScript
{
public:
CString sString0, sString1, sString2, sString3, sString4;
int i0, i1, i2, iID;
};

//Script IDs
#define MOVE_PLAYER 0
#define TEXTBOX 1
#define CHOICE_TEXTBOX 2
#define GIVE_ITEM 3
#define MOVE_OBJECT 4
#define HAS_ITEM 5
#define IF_ELSE 6
//End scripting


class CMyMap
{
public:
CMyMap()
{x=0; y=0; id=0; iMax[0]=0; iMax[1]=0; iMax[2]=0; iHitpoints=0; bWalk=true;};

CMyMap(int nx, int ny, int nid)
{x=nx; y=ny; id=nid; iMax[0]=0; iMax[1]=0; iMax[2]=0; iHitpoints=0; bWalk=true;};

int x, y, id, iMax[3], iHitpoints;

bool bMoveable, bDestroyable, bTileSave, bWalk;

CScript cs_arrayScript[3][100];
};

class CTheEditDoc : public CDocument
{
[...]
public:
CArray<CMyMap, CMyMap&> dv_arrayMaps;

// Overrides
void Serialize(CArchive &ar);
[...]
}

void CTheEditDoc ::Serialize(CArchive &ar)
{
CDocument::Serialize(ar);

if (ar.IsStoring())
{
dv_arrayMaps.Serialize(ar);
}
else
{
dv_arrayMaps.Serialize(ar);
}

UpdateAllViews(NULL);
}

My problem 0:
When saving my document everything works fine, but when it comes to reloading it cs_arrayScript[3][100] is filled with waste (all other variables are loaded corectly). Is the Serialize function of CArray unable to serialize my 2D-array properly?

My problem 1:
While the User works with my app the CArray dv_arrayMaps is filled. After some CMyMaps (I think about 10-15) are pushed into it the app slows down a whole step. Is there a way around it? Am I handling to much data?
[I tried dv_arrayMaps.FreeExtra()]

Build a system that even a fool can use, and only a fool will use it.
Questiongetting length of a character string? Pin
dazinith24-Mar-03 6:10
dazinith24-Mar-03 6:10 
AnswerRe: getting length of a character string? Pin
Chris Losinger24-Mar-03 6:17
professionalChris Losinger24-Mar-03 6:17 
GeneralRe: getting length of a character string? Pin
dazinith24-Mar-03 7:44
dazinith24-Mar-03 7:44 
GeneralRemove border of View Pin
jeremysay24-Mar-03 4:57
jeremysay24-Mar-03 4:57 
GeneralRe: Remove border of View Pin
Joaquín M López Muñoz24-Mar-03 5:00
Joaquín M López Muñoz24-Mar-03 5:00 
GeneralRe: Remove border of View Pin
jeremysay24-Mar-03 5:43
jeremysay24-Mar-03 5:43 
GeneralRe: Remove border of View Pin
Tim Smith24-Mar-03 5:50
Tim Smith24-Mar-03 5:50 
Generaldetecting if cursor is over a listview item Pin
Kuniva24-Mar-03 4:53
Kuniva24-Mar-03 4:53 
GeneralRe: detecting if cursor is over a listview item Pin
Ravi Bhavnani24-Mar-03 5:56
professionalRavi Bhavnani24-Mar-03 5:56 
QuestionAdding custom infos when building an application ? Pin
T.T.H.24-Mar-03 4:40
T.T.H.24-Mar-03 4:40 
AnswerRe: Adding custom infos when building an application ? Pin
Tim Ranker24-Mar-03 10:52
Tim Ranker24-Mar-03 10:52 
GeneralMemory Resident Databases Pin
Patje24-Mar-03 4:28
Patje24-Mar-03 4:28 
Generalchanging icon of an addin,pleeze hlp! Pin
schaereran@gmx.net24-Mar-03 4:18
schaereran@gmx.net24-Mar-03 4:18 
GeneralReading from a text file __ help me__ Pin
Scozturk24-Mar-03 4:11
professionalScozturk24-Mar-03 4:11 
GeneralRe: Reading from a text file __ help me__ Pin
jhwurmbach24-Mar-03 4:26
jhwurmbach24-Mar-03 4:26 
Generalnormalizing pathnames Pin
berndg24-Mar-03 4:04
berndg24-Mar-03 4:04 
GeneralRe: normalizing pathnames Pin
PJ Arends24-Mar-03 5:14
professionalPJ Arends24-Mar-03 5:14 

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.