|
See CXImage article on the codeproject I think it will be helpful for you.
|
|
|
|
|
Hello everyone,
In a class T, if there is a conversion opeator G, we always define it like this,
operator G()
without return type. So the implicit return type is G or G&? I can not find it in the C++ programming language book.
thanks in advance,
George
|
|
|
|
|
George_George wrote: In a class T, if there is a conversion opeator G, we always define it like this,
operator G()
The above is not true, you can do, as well
operator G &(){...}
of course the return type will be G in the former case, G& in the latter one.
BTW what book have you?
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.
|
|
|
|
|
Thanks CPallini,
I am always reading the book written by Bjarne. In the book, all conversion operators are defined as
operator G(),
example,
opeator int().
So, your points are, we can have both,
1. operaor G(), example operator int() -- returns a copy of object
2. operator G&(), example operator int&() -- returns reference
right?
regards,
George
|
|
|
|
|
Yes, but (probably) he never defines a operator G() (or operator G&() ) for class G (because, though legal, it is misleading and a bit weird).
Usually it is useful to have a conversion operator returning a related type, but not the type of the class itself, e.g. the LPCTSTR conversion operator of CString class .
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.
|
|
|
|
|
Hi CPallini,
Something wrong in your reply.
We should define conversion operator G() or G&() for class other than G, for example, class F.
CPallini wrote: Yes, but (probably) he never defines a operator G() (or operator G&()) for class G (because, though legal, it is misleading and a bit weird).
regards,
George
|
|
|
|
|
George_George wrote: Something wrong in your reply
OMG, I missed the class T at the very beginning of your OP . You're right.
George_George wrote: We should define conversion operator G() or G&() for class other than G, for example, class F
That's true and probably we (usually) prefer to define an operator G() rather than a G&() one.
As you pointed out, we should do that way, because defining the operator G() (or G&() ) for class G though legal, is misleading.
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.
|
|
|
|
|
Thanks for your clarification, CPallini!
regards,
George
|
|
|
|
|
If you mean "The C++ Programming Language" by Stroustrup, the reference in my copy (3rd edition) is on page 275, section 11.4 (Conversion Operators), where it says:
"Note that the type being converted to is part of the name of the operator and cannot be repeated as the return value of the conversion function."
If you want to return a G&, use operator G& .
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Thanks Mike,
Then we need to conversion operators,
1. type conversion operator;
2. type reference conversion operator.
Right?
regard,
George
|
|
|
|
|
Hi every one
how can i create one cpl file?
is there any compiler that crate cpl file?
please help me
|
|
|
|
|
Do you want to make Control Panel files(.cpl)?
|
|
|
|
|
|
You can create a dll file that can be registred usign regsvr32 command.
Finally change the extension from .dll to .cpl register it and you will see this in control panel.
ritz1234
|
|
|
|
|
|
ritz1234 wrote: change the extension from .dll to .cpl register it and you will see this in control panel
Apllets have a different entry point.
|
|
|
|
|
|
Hi,
I need to write some data in the CD (ofcourse through a CD writer) and need to read it programatically.
But my concern is that it should not be recorded in the CDFS. So it is obviously a hidden data...
I am not sure about the API(s) which can be used for this. Will DeviceIOControl help?
Thanks in advance.
|
|
|
|
|
An option (though remaining in the CDFS) maybe steganography , there are a lot of articles here at CP, most of them written by Corinna John (she's able to hide info almost anywhere ) http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=475133[^].
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.
|
|
|
|
|
Thank you for the reply. But I need to keep the data in CD itself, not as a file.
|
|
|
|
|
His point is that you can keep it in a file on the CD.
Then you can probably use easier APIs to write a file(s) to a CD as per normal.
(And no, I have no idea about those APIs, but they'll make it a lot easier than raw device driver stuff to read and write your secret data.
Iain.
|
|
|
|
|
Thank you for the reply. Yes, I got his idea, ofcourse. But I have to write in the CD itself.
|
|
|
|
|
For write to cd see this[^] article.
|
|
|
|
|
Thank you. I have to do a deep look in to that.
|
|
|
|
|
Hello All
I am trying to catch a right button down event for a control before the form sends it to this control;
Is there any way to do that?
|
|
|
|