|
You mean in what way I added virtual copy constructor?
Here below is the code:
CValueObjectBase* CashflowVO::clone() const
{
return new CashflowVO(*this);
}
Here CValueObjectBase is base class and clone method is pure virtual method. The clone method of derived class copies the object and return base class pointer.
Hope I have provided the right information.
|
|
|
|
|
I thought constructors couldn't be virtual, since they require complete information to create the object.
|
|
|
|
|
Cyrilix wrote: I thought constructors couldn't be virtual, since they require complete information to create the object.
You are correct, hence my question to him as to how he managed to pull this off.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Actually, this is a method which does the job of constructor.
Here below is the code snippet:
class CashflowVO derived from CValueObjectBase
>>>>>>>>>>>>>>>>>>>>
CValueObjectBase* CashflowVO::clone() const
{
return new CashflowVO(*this);
}
>>>>>>>>>>>>>>>>>>>>
Clone methos is pure virtual method in CValueObjectBase. The below code calls the respective clone method of derived object. Here pValueObjectBaseOrg can be any of the derived class, but respective object is getting copied and pointer is returned to pValueObjectBase.
>>>>>>>>>>>>>>>>>>>>
CValueObjectBase * m_pValueObjectBase = m_pValueObjectBaseOrg->clone();
>>>>>>>>>>>>>>>>>>>>
Hope I make sense here.
|
|
|
|
|
Besides the question that needs an answer (what the heck is a virtual copy constructor???)
the memory usage increase was hardly "drastic". Is there a reason you're worried about how
much memory (even if you could get an accurate measurement of it) your app is using in a
debug configuration?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Yes. The statistics I provided here are for sample data. When I ran my applicaiton with full production data the debug binary consumes 1.5 GB of virtual memory. Before the change the debug binary used to consume around 700 MB memory. There is not much difference in memory usage with release binary before and after the change.
I want to know whether virtual copy constructor adds more symbols to debug binary.
Thanks, Nani
|
|
|
|
|
how to programmatically add the values of a apecific field in a .mdb file.(only that field is blank, the other fields are filled)
thanks
|
|
|
|
|
Which is the programming language are you using ?
You can use ADO to serve your purpose.
Regards,
Paresh.
|
|
|
|
|
|
Hi all,
First of all I'm sorry about asking this type of question here but, after searching for 2 hours without no success and asking people on Tek Tips and DevX, I'm frustrated as hell.
How do you link to a dll (odbc32.dll) in Borland C++, I know how to do it in VS2005, but borland is another story.
Can anyone please help me??
Many Thanks
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
I don't know right now if there is any option dialog for this (currently working with VC++ Builder 6.0) but you can also include the #pragma preprocessor directive, assuming you have set the additional library (something like: "<installpath>\lib\psdk") path in a way, that odbc32.lib can be found:
#pragma comment ( lib, "odbc32.lib" )
|
|
|
|
|
|
I just tried a project which links with other libs that are shipped with the source code:
It seems that you can simply add the *.lib file to your project. However I don't know if this will work with Platform SDK libraries.
Yes, this is a way that worked in my project when linking against shell32.lib. I just placed it in the source code where I needed the API call.
|
|
|
|
|
Thanks you for the help.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: How do you link to a dll (odbc32.dll) in Borland C++...
What version? Are you compiling/linking from within an IDE, or a command prompt?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i want to get homedirectory of current user like(C:\Documents and Settings\current username).
is there any API to get it.
Thanks in advance
RYK
|
|
|
|
|
SHGetFolderPath, just pass in the CSIDL for the desired folder.
|
|
|
|
|
You can call SHGetFolderPath(CSIDL_PROFILE) or read the %USERPROFILE% variable
|
|
|
|
|
|
Hi
I am not experienced at MFC.I want to ask that how can I display a jpeg format picture simply.I need that for a project in Windows CE and OleLoadPicture and IPicture methods are unsupported by Windows CE.So is there any other way without using these methods?
Thanks for any help
|
|
|
|
|
Try LoadImage function [^], setting hInst=NULL , lpszName equal to the path of your file, and fuLoad=LR_LOADFROMFILE . Please note that I don't know if it works with jpeg files on Windows CE (maybe asking to the Mobile Development[^] forum guys will help...).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
It does work with jpeg files on Windows CE
Taylor, MCP,MSc
|
|
|
|
|
Thx
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I tried the method you said in Visual C++ 6 but that did not show jpeg format picture(that works for bmp format).Can you say where can be my mistake.I wrote like that;
HBITMAP bmpHandle = (HBITMAP)LoadImage(NULL,
strPictureName,
IMAGE_BITMAP,
0,
0,
LR_LOADFROMFILE);
|
|
|
|
|
Try
HBITMAP bmpHandle = (HBITMAP)LoadImage(NULL,
strPictureName,
IMAGE_BITMAP,
0,
0,
LR_DEFAULTSIZE | LR_LOADFROMFILE);
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|