|
How do you exactly serialize the list currently?
Gero
|
|
|
|
|
just walk all te elements using an iterator and call Serialize() against each element while storing but create a new CEmployee and serialize that and load.
|
|
|
|
|
Then do it like this:
// Storing
for each element in the list
ar.WriteString(object.GetRuntimeClass()->m_lpszClassName);
object.Serialize(ar);
// Loading
CString strType;
CBaseType *pType = NULL;
for number of objects stored in archive
ar.ReadString(strType);
// Check which object was stored based on strType
// and load it
pType = new CStoredType();
((CStoredType *)pType)->Serialize(ar);
// insert (CStoredType *)pType into list
Hope this helps,
Gero
|
|
|
|
|
we all know how to develop a collection of List or Array, i mean: develop real classes of them for using.
but i have no idea how to develop a collection of dictionary or map or bag etc.
i think a dictionary is based on List or Array with key sorted.
is the guess correct? can u give me some clues?
thx
includeh10
|
|
|
|
|
yah,
thats where you begin and later optimise the operations.Ues a map rather then a list of pairs.The map can do all the dirty work for you and do it better in most cases.
Conan
|
|
|
|
|
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
i don't like a reply with no looking and no thinking
includeh10
|
|
|
|
|
Hello,
How to get the print feature for different doc templates.
Just handling id_file_print doesn't do anything.Could any one help by listing the steps or something.
Bye.
|
|
|
|
|
In MFC, its the view which handles the printing of data from a document. All CView derived class's have the OnPrint() member function, which gets called once per page of output. You have to implement that printing code in this function for your document template view class.
Take a look at the examples in the printing section here.
Roger Allen
Sonork 100.10016
I have a terminal disease. Its called life!
|
|
|
|
|
hi evry1
i have got a strange prob ,whenever i select context sensitive help option from appwizard , the project created does not builds,it just hangs and is unable to create help files.i tried directly exec the "makehelp" file
but it says that some hcw file is missing,.
I have even tried reinstllg VC++ but to no avail.
pls i need urgent help as myproject rquires this feature
thnx
bhushan
|
|
|
|
|
The makehelp.bat file generate the yourprojectname.hm file used by the help compiler to match topic ID's with the dialog/control ID's in your application. You only need to run this .bat file when you add new ID's to your project etc.
HCW.EXE is the microsoft supplied help compiler. On my PC this is installed in Program files\Microsoft visual studio\common\tools. You may need to correctly setup your VS environment variables so that it can find the tool when you come to compile your help file.
Goto Tools:Options in VS studio. Sleect Directories and the sub option Executable files. Make sure the path top the location of your installed tools directory is present.
Roger Allen
Sonork 100.10016
I have a terminal disease. Its called life!
|
|
|
|
|
In windows registry (RegOpenKeyEx ) what means KEY_ENUMERATE_SUB_KEYS ? Is this more than reading it?
I'm confused when using KEY_READ or KEY_QUERY_VALUE . Thanks
|
|
|
|
|
KEY_ENUMERATE_SUBKEYS : you request the right to enumerate the sub keys:
the registry is a tree structure, e.g. in the following B and C are subkeys of A
key A
key B
key C
key D
KEY_QUERY_VALUE: request the right to call RegQueryValueEx to read a value of the item
KEY_READ combines KEY_QUERY_VALUE, _ENUMERATE_SUBKEYS, KEY_NOTiFY (subscribe to change notifications), and STANDARD_RIGHTS_READ (currently: read the security descriptor of the key).
Auch den Schatten will ich lieben weil ich manchmal lieber frier' Rosenstolz [sighist]
|
|
|
|
|
so when reading a value from registry KEY_QUERY_VALUE should be okay instead of KEY_READ. At least it works.
|
|
|
|
|
Hi i have the following piece of code
temp= some_memoryAddress
while(temp)
{
doSmth();
temp = anotherMemoryAddress
}
what does the expression while(temp) do, i never seen memory address as an condition in the while loop.
Thanks
|
|
|
|
|
This is equal to:
temp= some_memoryAddress
while(temp != 0)
{
doSmth();
temp = anotherMemoryAddress
}
Clippy: It seems you're mantaining someone else's code, who knew C++ better than you. Good luck!
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
doSmth should do something and change anotherMemoryAddress, otherwise this code doesn't make any sense. some_memoryAddress should be initially non-NULL.
The while loops until anotherMemoryAddress is NULL. This is normally the case when doSmth fails or doSmth has enumerated all memory addresses of anything.
-Dominik
|
|
|
|
|
great! this is the answer i need!!!
<quote>The while loops until anotherMemoryAddress is NULL
so this equals to
while(memory_address != NULL)
{
DoSomth();
}
Regard,
|
|
|
|
|
Exactly
-Dominik
|
|
|
|
|
As I said: I want to read the summary information out of an word file.
I got a definition page of a wordfile (v8.0) at http://www.wotsit.org.
But the offsets described in this file seems to be invalid.
Infos:
SummaryInformation -> STTBFASSOC (Table of Associated Strings)
STTBFASSOC -> offset in FIB: 410 0x019A fcSttbfAssoc long
the FIB starts at offset 0x0000
Maybe somebody had the same problem ... and fixed it? So that he can help me...
thx
Martin
|
|
|
|
|
the following expression:
for( ; ; )
{
doSmth();
}
Can anyone explain what the for(; ; ) does! Thank you
|
|
|
|
|
It is an infinite loop, exactly the same as:
while(1) { }
-Dominik
|
|
|
|
|
It loops forever.
No setup, No exit condition, No incrementer
|
|
|
|
|
thanks!!!
|
|
|
|
|
I use a <defines.h>
where I #define EVER (;;), so writing this:
for EVER {}
will loop for ever
neat!
|
|
|
|
|
thanks for the tip, Hugo! It's quite usefull and make so much sense
|
|
|
|