|
you need to find a way to distinguish old-format files from new-format files.
one way is to use the version info in the Serialization object:
IMPLEMENT_SERIAL (CFoo, CObject,VERSIONABLE_SCHEMA|XXXXX)
void CFoo::Serialize( CArchive& ar )
{
CObject::Serialize( ar );
if ( ar.IsStoring() )
{
...
}
else
{
int nVersion = ar.GetObjectSchema();
switch(nVersion)
{
case 2:
read new version data
break;
case 1:
read data for that version
break;
case 0:
}
}
Image Toolkits | Image Processing | Cleek
|
|
|
|
|
But i have the following
IMPLEMENT_SERIAL (CFoo, CObject, 1)
For both Old one and for new one that has the add one more serialize vriable.
Will not it return same for
int nVersion = ar.GetObjectSchema();
If it will , then how can i handle it.
thanx
Regards.
|
|
|
|
|
zahid_ash wrote:
For both Old one and for new one that has the add one more serialize vriable
you have to change the version number when you change the schema.
Image Toolkits | Image Processing | Cleek
|
|
|
|
|
thanx i understand it. i will try on it
one more thing In
IMPLEMENT_SERIAL (CFoo, CObject,VERSIONABLE_SCHEMA|XXXXX)
is it neccesry to write VERSIONABLE_SCHEMA or only an integer is enough
as i did
IMPLEMENT_SERIAL (CFoo, CObject, 1)
thanx
Regards.
|
|
|
|
|
according to the MSDN on GetObjectSchema:
A CObject-derived class may use VERSIONABLE_SCHEMA combined (using bitwise OR) with the schema version itself (in the IMPLEMENT_SERIAL macro) to create a “versionable object,” that is, an object whose Serialize member function can read multiple versions. The default framework functionality (without VERSIONABLE_SCHEMA) is to throw an exception when the version is mismatched.
Image Toolkits | Image Processing | Cleek
|
|
|
|
|
HI
In my IMPLEMENT_SERIAL is as follows for both old and new versions:
IMPLEMENT_SERIAL (CFoo, CObject, 1)
then
int nVersion = ar.GetObjectSchema();
is returning -1 that means version is unknown .
now how can i distinguish the versions..
thanks
Regards.
|
|
|
|
|
|
|
How do I make use of the Microsoft Excel class from my C++ class component to dynamically load and process an excel sheet?
|
|
|
|
|
The Fun begins! LOL
You need to use the Excel Object model.
Search the MSDN for these KB's.
KB309301
KB194906
KB308407
KB307473
Just to name a few. These should help get you started. You can also search on "Excel Object Model".
Good Luck!
Larry J. Siddens
|
|
|
|
|
Hello
Can any one tell me how i can change my console display mode to full screen mode in a dos based c++ program.
We Believe in Excellence
|
|
|
|
|
You will have to use the SetConsoleWindowInfo function to set the size. But before that you have to use functions like GetConsoleWindow, GetConsoleScreenBufferInfo for the actual effect to take place.
|
|
|
|
|
Hi all,
I want to get through a proxy server which needs NTLM authentication.
I want to know the following:
1) Username and password (IE and FF can do this without interacting with the user)
2) How to set up the headers
I am using WinInet (CInternetSession).
Thanks!
Geert
Want to spread the newest version of your software automatically? Use Updater!
Visit my website: http://geert.yoki.org
|
|
|
|
|
Greetings,
I am getting the following warnings. I have some classes whch overide the Create function, but with very different arguement lists. Somehow though the compiler thinks they might be meant to be the same.The arguement lists look very different to me, how can it be assuming they are smiliar?
thanks in advance,
Aristotel
<br />
BOOL Create(CWnd* pParentWnd, const RECT& rect, UINT nID, DWORD dwStyle , int nMinVal, int nMaxVal);<br />
warning #1125: function "CWnd::Create(LPCTSTR={LPCSTR={const CHAR={char} *}}, LPCTSTR={LPCSTR={const CHAR={char} *}}, DWORD={unsigned long}, const RECT &, CWnd *, UINT={unsigned int}, CCreateContext *)" is hidden by "CLevelMeter::Create" -- virtual function override intended?
BOOL Create(CWnd* pParentWnd, const RECT& rect, UINT nID, DWORD dwStyle /*=WS_VISIBLE*/, int nMinVal, int nMaxVal);
<br />
BOOL Create(CWnd *pParentWnd, const RECT &rect, UINT nID, DWORD dwStyle);<br />
warning #1125: function "CWnd::Create(LPCTSTR={LPCSTR={const CHAR={char} *}}, LPCTSTR={LPCSTR={const CHAR={char} *}}, DWORD={unsigned long}, const RECT &, CWnd *, UINT={unsigned int}, CCreateContext *)" is hidden by "CMultitapControl::Create" -- virtual function override intended?
BOOL Create(CWnd *pParentWnd, const RECT &rect, UINT nID, DWORD dwStyle);
Edit/Delete Message
|
|
|
|
|
Try putting virtual in front of the declaration.
EX:
virtual BOOL Create(CWnd* pParentWnd, const RECT& rect, UINT nID, DWORD dwStyle /*=WS_VISIBLE*/, int nMinVal, int nMaxVal);
Hope this helps.
Larry J. Siddens
|
|
|
|
|
Hi Larry,
Unfortunately that didn't do it. Very strange...such a different arguement list yet it thinks its meant to be an over ride...hmmm...
Do let me know if any other ideas come arround. I will keep looking as well.
Thanks,
Aristotel
|
|
|
|
|
Email me your code (all that I need is for compiling) and I will take a look.
Larry J. Siddens
|
|
|
|
|
Hello Larry...(sorry for the delay)...
The code is part of a rather large commercial project..so i need to try and trim it down to the simplset level so that i can email you the relevant parts.
Regards,
Aristotel
|
|
|
|
|
Has anyone done a comparison between the bog-standard MSVC++ and the plug-in C++ compiler from Intel.
Inital investigations from my team had a stunning decrease in compilation times and some old websearches suggest that the code produced is more optimised.
The version we were trying is available on a 30 license from
http://www.intel.com/software/products/ etc...
Jim Yarlett - trying to bring order from chaos
|
|
|
|
|
Hi,
I am trying to create a XML parser for the VC++ project. The parser needs to parse the xml file and get a specific tag value from the xml file.
Can someone provide me an insight on how to implement it.
Appreciate any help.
Thank you
-Raman
|
|
|
|
|
Maybe you'll find some interesting things here[^]
|
|
|
|
|
Thanks but I couldn't find my answer there.
|
|
|
|
|
look for IXMLDomDocument Interface in your local msdn Copy
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Hi.
I'd like to know how can i get full path of installed programs seen when yhou select Add/Remove program in control panel.
In the registry "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall", i could find the name of installed programs but, i can't get full path of its program.
Thanks.
hi.
|
|
|
|
|
There is no requirement that there be any mapping between the uninstall program information in the registry and the location or source of the install program or other related program files.
|
|
|
|