|
is this supposed to be a question ? i mean, grammaticaly speaking, you missed the punctuation and the fundamentals of "how to well form a sentence"...
i think you wanted to say : "What is the difference between copy constructors and assignment operators for a know type ?".
well, if yes, the answer is simple. the copy constructor can be called once in an object life (at the beginning), when the operator can be called anytime.
technically, they do what you tell them to do, so the object can result in being in the same state after both operations, but all depends on what you coded there...
|
|
|
|
|
MY QUESTION IS
What the copy constructor is doing we can do the same thing through assignment operator.So what is the advantage of copy constructor
class A
A a;
A b;
a=b;
|
|
|
|
|
sarojkumarjena wrote: MY QUESTION IS
Dont use caps while expecting others to help.
sarojkumarjena wrote: What the copy constructor is doing we can do the same thing through assignment operator.So what is the advantage of copy constructor
copy constructor is called when object is function argument , passed by value.
when object is returning by value, and object is initializing using other object. i.e.
class A
A a;
A b=a;
|
|
|
|
|
copy constructors are sometimes called implicitely when using templates containers, or things like this.
if you don't provide one, you'll get a compiler error saying that no copy constructor were found for the type xxx...
moreover, when passing objects by value to/from functions, the objects are duplicated, thus the copy constructor
|
|
|
|
|
sarojkumarjena wrote: What the copy constructor is doing we can do the same thing through assignment operator.So what is the advantage of copy constructor
The assignment operator destroys/replaces an existing object. The copy constructor creates an object as copy of another object.
|
|
|
|
|
SilentSilent wrote: The assignment operator destroys an existing object
false in the sense that it doesn't call the object's destructor, but true in the sense that it modifies the object integrity
|
|
|
|
|
Any constructor, including a copy constructor, builds the object from uninitialized memory. Once the object is "built" all the class's invariants have been established.
An assignment operator sets the state of the object but the class invariants have already been established by a constructor.
Steve
|
|
|
|
|
You might what to implement the copy construtor or assignment operator to do a deep copy instead of shallow copy and also if you want to do any specific thing while doing the copy.
-Prakash
|
|
|
|
|
Hi all,
sorry for posting this question here, but I know that VC++ developers are the best.
Does Windows Media Player Mobile supports audio plug-ins? I want to develop an equalizer and I wonder if there is a support for this.
Plz also, I wonder if I can email microsoft for programming questions, is there an email for microsoft to give such support??
Regards
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
Mohammad A Gdeisat wrote: Does Windows Media Player Mobile supports audio plug-ins? I want to develop an equalizer and I wonder if there is a support for this.
yes they do! you have to visit MSDN.microsoft.com and search MEDIA player!
Mohammad A Gdeisat wrote: Plz also, I wonder if I can email microsoft for programming questions, is there an email for microsoft to give such support??
for that you have to own the MSDN library, they are equiped with 5 support instance
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Thanks for your reply,
I was taking a tour in media player sdk, and I read the following about windows media player mobile:
ThatsAlok wrote:
Windows Media Player 10 Mobile uses the same UI plug-in model as the desktop Windows Media Player. However, Windows Media Player 10 Mobile can only interact with background UI plug-ins. Because of the similar plug-in models, the same API calls that apply to background UI plug-ins on the desktop also apply to background UI plug-ins on a Windows Mobile device.
In the sdk, microsoft divided plug-ins into four classes:
1. Custom visualizations
2. User interface plugins.
3. DSP plug-ins
4. Rendering plug-ins.
so, can I conclude that WMP mobile does not support dsp plug-ins?? in other words, does this mean I cant develop an equalizer for Pocket WMP??
Thank you
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
Mohammad A Gdeisat wrote: the sdk, microsoft divided plug-ins into four classes:
Mohammad A Gdeisat wrote: n the sdk, microsoft divided plug-ins into four classes:
1. Custom visualizations
2. User interface plugins.
3. DSP plug-ins
4. Rendering plug-ins
Mohammad A Gdeisat wrote: o, can I conclude that WMP mobile does not support dsp plug-ins??
isn't above two statement are contradictory!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
sorry, but what I mean here is that the desktop version of Windows Media Player supports the above four plugin classes, however, a subset of this support is included in the Mobile (PDA) version of media player which is the user interface plug-ins.. please re-read the SDK quote and tell me what you think...
Thanks alot for your time
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
Mohammad A Gdeisat wrote: please re-read the SDK quote and tell me what you think...
could you point me exact SDK link!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
|
|
You Spammer!!!
read the posting guidelines first
|
|
|
|
|
Thanks for your forum,but this forum is for questions
|
|
|
|
|
bang bang...
you know what ? your post is simply useless... codeproject is the best programming forum/resource over the web
go die with your spam, looser.
|
|
|
|
|
toxcct wrote: codeproject is the best programming forum/resource over the web
I agree,everyday better yesterday. (Search comments )
|
|
|
|
|
manosza wrote: Here is the link: Forum
Manos.
now you will suffer CodeProject Death! for advertising other forum in programming forum!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
hi
I am using VC++6 and MSXML6.0 and manipulating with DOM,
the problem is
I created a root node say <root> and gave a default namespace using either
setAttribute("xmlns","http://..") or createNode(1,"xmlns","http://..");
and when i saved the xml it was found the every child node or tag had the attribute "xmlns" like this
<root xmlns="http://..">
<child1 xmlns=""/>
<child2 xmlns=""/>
</root>
y is it so and also how to avoid this
thanks in advance
|
|
|
|
|
state the code for creation of child node
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
here is the code for setting child
pe=m_XML->createElement("Header");
if(pe!=NULL)
{
pa=m_XML->createAttribute("a1");
if(pa!=NULL)
{
pa->value=Convert("val1");
pe1->setAttributeNode(pa);
}
pa=m_sclXML->createAttribute("a2");
if(pa!=NULL)
{
pa->value=Convert("val2");
pe1->setAttributeNode(pa);
}
m_XML->documentElement->appendChild(pe);
pe.Release();
}
were pe is IXMLDOMElementPtr,pa is IXMDOMAttributePtr
|
|
|
|
|
Hi
I create a dialog and use the CUniButton from the website to create button on the dialog. The size of dialog is 640x480. Now I use SHLoadImageFile to load a 640x480 bitmap and load the HBITMAP return from SHLoadImageFile into SetBkgndHandle function. If I make the button edge transparent, the button background bitmap will replace the edge and math the bitmap in the dialog.
But if the bitmap is bigger than 640x480, it will cause the mismatch between the button background bitmap and the bitmap in the dialog.
I wnat to compress the bitmap, but if I use StretchBlt and get a new HDC, it's unhelpful for the question.
What method could solve the question??
Any suggestion is useful!! Thanks!!
|
|
|
|