|
Question 1:
For a class Class_A, it has a constructor function Class_A::Class_A() and a deconstructor function Class_A::~Class_A().
My question is when the two functions will be called.
For constructor function, I think it will be called in two cases:
case 1: when declare a Class_A type pointer variable: Class_A * ptrClass_A = new Class_A();
case 2: when declare a Class_A type variable : Class_A objClass_A;
my question arises with deconstructor function,
corresponding to the above case 1: deconstructor function is called when using ' delete ptrClass_A '
I am confused with the second case. It seems to me that deconstructor function will never be called for the above case 2, since there is no a counterpart in case 2 to ' delete ' in case 1.
Question 2
How to dynamically create a control, say a CEdit control.
Should I place a CEdit control (IDC_EDIT0) on the form first, then add a variable (m_EditBox_0) for the control.
In the *.cpp file, I should create a object of CEdit type
CEdit * objCEdit = new CEDit();
finally, associate objCEdit with m_EditBox_0 in some way.
I am not sure if the above steps are correct or not.
Question 3:
My project (Test) is a SDI framework. Somehow the CTestView node in the "Workspace | ClassView" in the Visuatl C++ Ver. 6.0 (SP6) IDE disappearred. However, TestDoc, TestApp and some other nodes are still there.
Also, the files CTestView.h and CTestView.cpp can be opened successfully. Why this could happen. How can I get it back.
Question 4:
I wonder if there is shortcur keys to let prgrammers to go to next/previous breakpoint from current line or current breakpoint.
|
|
|
|
|
cy163@hotmail.com wrote: I am confused with the second case. It seems to me that deconstructor function will never be called for the above case 2, since there is no a counterpart in case 2 to ' delete ' in case 1.
Object is created on stack. Its d'tor will get called in clean up. i.e. when objects goes out of scope.
cy163@hotmail.com wrote: How to dynamically create a control, say a CEdit control.
Should I place a CEdit control (IDC_EDIT0) on the form first, then add a variable (m_EditBox_0) for the control.
In the *.cpp file, I should create a object of CEdit type
CEdit * objCEdit = new CEDit();
You need to call Create function of CEdit class in combination to ShowWindow. No need to create it on form while design.
cy163@hotmail.com wrote: My project (Test) is a SDI framework. Somehow the CTestView node in the "Workspace | ClassView" in the Visuatl C++ Ver. 6.0 (SP6) IDE disappearred. However, TestDoc, TestApp and some other nodes are still there.
Also, the files CTestView.h and CTestView.cpp can be opened successfully. Why this could happen. How can I get it back.
close project. Delete .dsw and open .dsp again.
cy163@hotmail.com wrote: I wonder if there is shortcur keys to let prgrammers to go to next/previous breakpoint from current line or current breakpoint.
You can go to next break point by using f5 key.
to go to previous break point , you need to go to that point, righ clik and selct option 'set next statement'
|
|
|
|
|
Prasad, Thank you for your prompt and great answers.
|
|
|
|
|
Visual C++ 2005 Build Paths can be added manually thru the IDE Tools->Options->Project and Solutions-> VC++ Directories . Now, i observed that installers of many SDKs (such as DirectX SDK) automatically adds these paths (paths to dxsdk\lib , \include \bin ) to VC++.
How can i do the same with my installer so when the installation of my SDK completes, all the paths to lib, include, bin are automatically added there?
I can add those paths using the environment variables INCLUDE, LIB, but those paths are not available to the IDE unless i launch VC++2005 using the "/useenv " switch (devenv /useenv ). (Launching normally does not enable those paths)
Is there a registry key where i can add those paths?
Thanks in advance.
|
|
|
|
|
I would expect the paths to be in a registry key somewhere under HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0
|
|
|
|
|
The path is not saved in the registry, instead it is saved in CurrentSettings.vssettings file in
C:\Documents and Settings\XXX\My Documents\Visual Studio 2005\Settings.
it is an XML file, but there seems to be no easy way to write it..
|
|
|
|
|
Hello
Kindly do me a favour by enlightening me with the difference between MFC's in VC++ & VC++.net
Can i use the same code which is in VC++ 6.0 in VC++.net.
Thank you
Kind Regards
Sandy
|
|
|
|
|
ksandy45 wrote: Kindly do me a favour by enlightening me with the difference between MFC's in VC++ & VC++.net
You may like to have a look at this[^]
ksandy45 wrote: Can i use the same code which is in VC++ 6.0 in VC++.ne
You can.
|
|
|
|
|
Hi Prasad,
Thanks for the help, then what is the difference between these two MFC's. Does .net MFC offer any new classes?
Kind Regards
Sandy
|
|
|
|
|
yes ofcourse.there r some classes mixed with atl which are added in MFC 2003,i mean these classes can be used in ATL as well MFC like CImage,CString etc.you can C more on msdn.
Tasleem Arif
|
|
|
|
|
Thanks a lot Tasleem.
Can you just tell me how Managed VC++ is different from the MFC?
Can the same functionallity be achieved by using the VC++.Net (managed C++).
Kind Regards
Sandy
|
|
|
|
|
VC++.net managed C++ is differnet from MFC in sense
yes functionality can be achieved using managed C++.
1.managed c++ is plateform independant.
2.it support more classes then MFC supports.
Regards.
Tasleem Arif
|
|
|
|
|
Thank you very much Tasleem. I am clear now. So i can use Managed C++ and achieve all the things which a MFC offers and this can done with a great ease.
I hope what i understood is correct?
I think you have a great knowledge in thins field. I would like you to help me, kindly provide me with you are support.
Thanks a lot.
Kind Regards
Sandy
|
|
|
|
|
u r welcomed.
Regards.
Tasleem Arif
|
|
|
|
|
Hi all, I have a problem. Please help me soon
I am coding for multilingual support project - English-French. I use resource dll to load language interface. But, All MessageBox or AfxMessageBox, any buttons Cancel, Yes, No, I can not switch language (English is default) (Using IDOKCANCEL, IDYESNO ..). If I compile my project in the French of Visual Studio, Can I receive true language?
Please help me if you have more solves.
Thank you very much
Software Engineer
|
|
|
|
|
The text on the MessageBox buttons is dependant on the OS systems language. You cannot easily change this within your code.
You might want to take a look at this[^] and implement your own message boxes.
|
|
|
|
|
Thank you for your idea. I will try coding with it. Please send to me if you have any good ideas.
Thank you very much!
Software Engineer
|
|
|
|
|
as stated by WalderMort <bo
<blockquote class="FQ">WalderMort wrote: The text on the MessageBox buttons is dependant on the OS systems language.
So you cannot change it unless you don't make your own version of the message box window. By the way OS dependance it is usually not a problem, since who wants the French release of your program probably has French OS on his PC (and so on...).
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.
|
|
|
|
|
cpallini wrote: French release of your program probably has French OS on his PC
But When I use French OS, I compile my proje
ct, create a setup of this, When I install my setup in other computer which use English OS, My message' buttons are French Language or English??.
Please send to me if you has many good ideas
Thank you very much.
Software Engineer
|
|
|
|
|
dungpapai wrote: But When I use French OS, I compile my proje
ct, create a setup of this, When I install my setup in other computer which use English OS, My message' buttons are French Language or English??.
English language. But, as I said, usually the user knows that and does not complain about. Anyway if you want to fix this behaviour, you can write you own version of the MessageBox, it is not that difficult (or you can take a look to the article suggested by WalderMort).
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.
|
|
|
|
|
Hello, Nice to meet you.
I'd like to know how to check the state of the tray with program. What I want is how to detect the state of which the tray is open or close whether there is a CD in the tray.
When we push the button of CD drive, its tray operates like a toggle switch.
If now it was open, then it will be closed.
And it was close, then it will be opened.
Without a CD in the tray...
Please help me in detail as possible~~~
Studying English and Programming...
|
|
|
|
|
|
Hi,
IIRC it could be done with use of DeviceIoControl with IOCTL_STORAGE_CHECK_VERIFY and IOCTL_STORAGE_EJECT_MEDIA functions.
Anyway, you should find some information about it in DeviceIoControl function reference and its related articles.
Regards
================================================================================
anssi wrote:
If now it was open, then it will be closed.
And it was close, then it will be opened.
Try mciSendCommand. I remember doing it sometime back, don't remember exactly how I did it.
anssi wrote:
mailto:theanssi@naver.com
You are inviting spam by putting your mail ID like this.
================================================================================
Thanks for giving a reply, but I already know MCI command.
What I want is how to detect the state of which the tray is open or close whether there is a CD in the tray.
I also tried the method using MCI command, but the method was restricted because could check the state only there is a CD in the tray.
Please help me in detail as possible~~~
Studying English and Programming...
test
|
|
|
|
|
I get this error!
error C2146: syntax error : missing ';' before identifier
I have Not forget ; I dont now way I get this. Is there someone hat nows way I get it??
|
|
|
|
|
Here ya go...have one of mine...
;
Seriously, posting a few of the lines of code leading up to, and including, the line the error
occurs on would be mucho helpful in determining the problem
|
|
|
|