|
Yes, thank you very much! I admire you and your work!
By the way, I want to ask for one thing more. I have a dialog. When I right click on that, I want to show Desktop menu context as well as add my own menu item. Could you be kind enough to help me please? Thank you very much!
Have a nice day!
|
|
|
|
|
Check out Raymond Chen's series of posts on hosting a context menu, starting here[^]
|
|
|
|
|
Many thanks to you. I will read it. Have a nice weekend!
|
|
|
|
|
Hi there,
I would like to know if I can call the destuctor explicitly in case of
containership.
Lets consider an example:
class A
{
public:
~A()
{
cout <<"~A()"<
|
|
|
|
|
There's no need of calling the destructor of A explicitly. Since the object of class A is being created in B, after the destructor of B get's called the destructor of class A is also called.
#include <iostream>
using namespace std;
class A
{
public:
~A()
{
cout <<"~A()"<<endl;
}
};
class b
{
a="" a;
public:
~b()
{
="" cout="" <<="" "~b()"="" endl;
="" a.~a();="" try="" uncommenting="" this="" line
="" please="" pay="" extra="" concentration="" here..
}
b()
{
="" cout<<"b's="" constructor\n";
}
};
void="" main()
{
="" b="" b1;
="" *b="new" b();
="" do="" something="" here
="" delete="" b;
}=""
=""
<div="" class="ForumSig">Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
Raj Prathap wrote: In the above case should the destructor of A be called explictly? If I dont call, the destructor for A is never called.
Thanks in advance,
Pratap Reddy
No, It will be called before B's d'tor.
|
|
|
|
|
Raj Prathap wrote: In the above case should the destructor of A be called explictly?
No. It will happen automatically when the A object goes out of scope.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
If this is not the right place, please suggest me the right one...
I wish to display the all the items (Appointments, Calendar, Folders, Email,
Tasks, etc.) by reading the raw data of the OST File...That means I don't
wish to use installing outlook, MAPI, CDO and even third Party tools. It should be done in VC++.
Please suggest me where I will get
The source code for reading the raw data of the OST file (or)
Documents releated to OST file structure (or else)
The source code for Conversion of OST file to PST file...
I'm eagerly waiting for ur response....
Regards,
nag.
|
|
|
|
|
Hi,
If this is not the right place, please suggest me the right one...
I wish to display the all the items (Appointments, Calendar, Folders, Email,
Tasks, etc.) by reading the raw data of the OST File...That means I don't
wish to use installing outlook, MAPI, CDO and even third Party tools. It should be done in VC++.
Please suggest me where I will get
The source code for reading the raw data of the OST file (or)
Documents releated to OST file structure (or else)
The source code for Conversion of OST file to PST file...
I'm eagerly waiting for ur response....
Regards,
nag.
|
|
|
|
|
PST/OST format is microsoft proprietary. You can not find its internal structure. To read pst/ost items you need Microsoft COM controls installed on machine.
Manish Agarwal
manish.k.agarwal @ gmail DOT com
|
|
|
|
|
Hi Manish,
I'm thankful for ur prompt response...For reading PST file, I have seen
Libpst...Just for testing, I tried OST file with this, but no use...
Coming OST file to PST file conversion, I have seen ost2pst tool, but I'm unable to find source code for conversion of OST file to PST file...
Regards,
nag.
|
|
|
|
|
See here[^] maybe its some helpful for you
|
|
|
|
|
I have been playing with PC-lint and reading the Scott Meyers Effective/More Effective C++ books and have a question about implicitly calling constructors. This may be a style issue, or it may turn out to be something more important.
For example, suppose you have a class that contains a std::string (or CString ), and the strings should be empty ("") when the class is created. I have always let the compiler implicitly call the string constructor, and hence would have something that looks like this:
class foo
{
private:
std::string str_;
public:
foo()
{
}
};
However, it has been suggested that all members should appear in the constructors initialization list, and that I should change my constructor to one of the following:
foo() : str_("")
or
foo() : str_()
Which of the abiove you use? Any solid reasons why? Also, in the case of a string, would you explicitly initialize it to an empty string (str_("") ) or call the strings default constructor (str_() )?
Kicking squealing Gucci little piggy.
|
|
|
|
|
Rob Caldecott wrote: Which of the abiove you use? Any solid reasons why? Also, in the case of a string, would you explicitly initialize it to an empty string (str_("")) or call the strings default constructor (str_())?
Since str_("") doesn't serve any better purpose that str_() I would go for str_(). Since a good default constructor will set it's member elements to a predefined state. This should suffice.
|
|
|
|
|
calling str_() would save on having to pass a parameter. (not much of a difference, just me being picky).
|
|
|
|
|
Rob Caldecott wrote: For example, suppose you have a class that contains a std::string (or CString), and the strings should be empty ("") when the class is created. I have always let the compiler implicitly call the string constructor, and hence would have something that looks like this:
class foo{private: std::string str_;public: foo() /* str_ constructor implicitly called */ { }};
you are right.
Rob Caldecott wrote: However, it has been suggested that all members should appear in the constructors initialization list, and that I should change my constructor to one of the following:
foo() : str_("")
or
foo() : str_()
In this case it doesn't make sense to initialize member variable in initialization list. Because, generally, well designed classes takes care of default initialization.
Only difference, here would hapeen is, if you doesn't use member initialization list, default c'tor will be called, and copy c'tor otherwise.
It is advised to use member initialization list, because it save assignment operator call; if you are going to assign some value to member variable.
consider this scenario,
class foo
{
CStrin m_sMyString;
public:
foo()
{
m_sMyString = "This string i want as default";
}
}; where as this is efficient,
class foo
{
CStrin m_sMyString;
public:
foo(): m_sMyString("This string i want as default")
{
}
};
|
|
|
|
|
See member initialization list for more.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
OK - the order of initialization is important, etc. but I am still unsure whether it is good practice to initialize all members, even those (like strings for example), that already have default constructors that can be called implicitly. What do you do in your code for example? Do you initialize everything or just POD types?
Kicking squealing Gucci little piggy.
|
|
|
|
|
Rob Caldecott wrote: Do you initialize everything or just POD types?
Only those that I know for sure don't have their own initialization.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
Hello,
I work in MFC project that use a MSDATGRD.OCX control (DataGrid). It works well but I can not set the with for each colunm that mean I have a function "SizeColWith(20)" but it change all colunm with!
How can I acces the properties for each colunm.
Than you
AutreChien
|
|
|
|
|
I have a html page. I load to VC6 Dialog.
I want to make some button that call the link on html page.
How can i make it?
|
|
|
|
|
tamasan wrote: I have a html page. I load to VC6 Dialog.
How are you loading the HTML page in your dialog?
tamasan wrote: want to make some button that call the link on html page.
Do you want to open the link in a browser window on button click?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I think you need to say more explain but if you want to show html files on dialog you can use CDHtmlDialog
|
|
|
|