|
This link will help you[^]
Every new day is another chance to change your life.
|
|
|
|
|
thanks a lot. Do I have to install visual studio 2008 for converting my visual c++ 6 (2003) ?
Please give me some guidances.
hanks again
|
|
|
|
|
I dont have much idea on that. Like you i am also new to this. The only difference is i searched the net first and i send you the link which really suited your query. There are other sites which gives you a very good insight on how the migration has to be done.
See this link [^]
Every new day is another chance to change your life.
|
|
|
|
|
mrby123 wrote: Please advise how to proceed
Create a project in VS2010, add the source code from C++ 6 and build the project. Fix all warnings and errors.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
You just need to jump right in and convert it. There's no magical way to do it and the number of warnings and errors you get depend on what your source code has in it and how well you coded according to standard (old compiler used to let you get away with using non-standard C++, new one is better about that but still, MS refuses to follow standards strictly, they implement things they want regardless of current standards).
...oh, and don't forget to save a copy of your unchanged code for reference or if you need to fall back to your original code. If you have source control, create a tag to save the location.
modified 19-Mar-12 13:39pm.
|
|
|
|
|
Like others have stated. Just open the project or solution in vs2010 and let it convert and backup. Then start walking down the list of errors one at a time. If it's just vc++ and no extensions it should be easy.
|
|
|
|
|
|
Gurus,
Please help on this warnning message when I built:
1>d:\test\blast_vib_proc_new\blast_vib_procdlg.cpp(211): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(234) : see declaration of 'fopen'
1>d:\test\blast_vib_proc_new\blast_vib_procdlg.cpp(223): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(234) : see declaration of 'fopen'
|
|
|
|
|
|
thanks, that is useful to me.
|
|
|
|
|
Dear Developers,
Todays I found a surprsing fact on the scenario of functiona overlaoding in C++.
The code segment is here
#include <iostream>
using namespace std;
void display( char* );
void display( const char* );
void main()
{
char *ch1 = "Hello";
const char *ch2 = "Bye";
display(ch1);
display(ch2);
}
void display( char* p )
{
cout << p;
}
void display( const char* p )
{
cout << p;
}
As I know, In function overloading, the arguments must be differ in either in type or count. But its working. and one more surpring fact is that if I am remving pointers on that program. It says.. that function already have a body.
How is it possible????
Please guide me.
Thnaks.
Amrit Agrawal
Software Developer, Mumbai
|
|
|
|
|
Use code tags when you post code.
What do you mean by "removing pointers"?
Amrit Agr wrote: the arguments must be differ in either in type or count. But its working.
The arguments to the methods have different types.
And do you have warnings turned on to the highest level in your C++ compiler?
|
|
|
|
|
Hi, Amrit,
It's working because it's legal to overload functions based on whether the argument refers to a const or non-const type.
So,
void display(const char*) is overloading
void display(char*)
And you're correct. The following couldn't be overloaded. It won't compile because of const conversion used by compiler. It can't figure out which one is the best match.
void display(char);
void display(const char);
void display(char const);
(Technically, the above are redeclaration. It's fine to just define the third one by adding function body. But it won't compile if all of these three functions have function bodies or definitions.)
By the way, to be clearer, the following won't compiler neither because of the same reason.
void display(char*){...} void display(char* const){...}
|
|
|
|
|
I've created an application that paints on the window using GDI functions. It works fine. But because it is still under development it sometimes craches. It seems that if there are certain craches Windows Vista suddenly decides to treat my application in a new way: while drawing on the window it decides it must redraw that was on the screen when i started my application. The effect is that some drawing is lost. Windows continues with this behavour till i reboot my pc. After i booted the same piece of code draws the window correctly. I used Spy++ to find out what's happening. When the window is correctly displayed i see the following:
<00037> 00340626 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:1215 yPos:640
<00038> 00340626 P WM_LBUTTONUP fwKeys:0000 xPos:1215 yPos:640
<00039> 00340626 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:1249 yPos:711
<00040> 00340626 P WM_LBUTTONUP fwKeys:0000 xPos:1249 yPos:711
(I press the mousebutton to start drawing, it draws the window, i press the mousebutton again to close the window)
When things go wrong Spy++ reports the following:
<00037> 00340626 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:1219 yPos:643
<00038> 00340626 P WM_LBUTTONUP fwKeys:0000 xPos:1219 yPos:643
<00039> 004904B2 S WM_WINDOWPOSCHANGING lpwp:0012FE20
<00040> 004904B2 R WM_WINDOWPOSCHANGING
<00041> 004F0646 S WM_WINDOWPOSCHANGING lpwp:0012FE20
<00042> 004F0646 R WM_WINDOWPOSCHANGING
<00043> 00340626 S WM_WINDOWPOSCHANGING lpwp:0012FE20
<00044> 00340626 R WM_WINDOWPOSCHANGING
<00045> 004904B2 S WM_WINDOWPOSCHANGED lpwp:0012FE20
<00046> 004904B2 R WM_WINDOWPOSCHANGED
<00047> 004F0646 S WM_WINDOWPOSCHANGED lpwp:0012FE20
<00048> 004F0646 R WM_WINDOWPOSCHANGED
<00049> 00340626 S WM_WINDOWPOSCHANGED lpwp:0012FE20
<00050> 00340626 S .WM_SIZE fwSizeType:SIZE_RESTORED nWidth:1280 nHeight:770
<00051> 00340626 R .WM_SIZE
<00052> 00340626 R WM_WINDOWPOSCHANGED
<00053> 004904B2 S WM_WINDOWPOSCHANGING lpwp:0012FE20
<00054> 004904B2 R WM_WINDOWPOSCHANGING
<00055> 004F0646 S WM_WINDOWPOSCHANGING lpwp:0012FE20
<00056> 004F0646 R WM_WINDOWPOSCHANGING
<00057> 00340626 S WM_WINDOWPOSCHANGING lpwp:0012FE20
<00058> 00340626 R WM_WINDOWPOSCHANGING
<00059> 00340626 P WM_PAINT hdc:00000000
<00060> 00340626 S WM_ERASEBKGND hdc:D1011D9A
<00061> 00340626 R WM_ERASEBKGND fErased:False
<00062> 00340626 S WM_GETICON fType:True
<00063> 00340626 R WM_GETICON hicon:1CA203B1
<00064> 00340626 S WM_GETICON fType:False
<00065> 00340626 R WM_GETICON hicon:00000000
<00066> 00340626 S WM_GETICON fType:True
<00067> 00340626 R WM_GETICON hicon:089A0417
<00068> 00340626 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:1252 yPos:726
<00069> 00340626 P WM_LBUTTONUP fwKeys:0000 xPos:1252 yPos:726
The big difference is lines numbered 39-67. Does anyone understand what's happening here? And what is a correct solution for this problem? What causes it? It seems that i have to intercept the paint message to tell Windows to shut up. But what worries me is that the hdc is 0.
Any help will be appreciated..
|
|
|
|
|
That just looks like the window position is getting changed. Hard to say what may be wrong from just looking at the messages that Windows is sending your applications window. You probably need to post some of the applicable code.
|
|
|
|
|
I read about Secure erase command that has been implemented in HDD firmware after 2006, under T13 commitee authority. Can this command be invoked from a MFC program?
|
|
|
|
|
C/C++ programs can call any API exposed either via the OS or other applications.
They can also invoke assembly. Even if the MS compilers do not support embedded assembly (I didn't look) one can still invoke assembly via a function pointer cast.
So basically if your equipment supports it then it can be called in C/C++. Doesn't mean it is easy though.
|
|
|
|
|
As jschell suggested, you can probably get tricky and get it accomplished one way or another, but by default, you should assume that the functionality will not be easily accessible unless made available by the hardware driver. Look for a drive that supports it and see if they have their own driver (as opposed to a generic HDD driver which is likely not to have this function) and have an API that allows you to access it.
|
|
|
|
|
1. Can anybody show me an example on running multiple threads from an MFC application?
2. Is this possible in VS6?
...
Thanks in advance 
|
|
|
|
|
There are many examples on the net and here like this one: Introduction to Multi-threaded Code [^].
|
|
|
|
|
|
|
Hello all,
I'm coding CFront, the very first form of C++, I have the .pdf file and using the compiler Code::Blocks, but I'm confused, should I use a project or just code it as file(s) individuality.
Also, how do I "identify" all the source code, in other words, what do I call which file what in order to avoid programming errors, like the .pdf has all the info in it, but as you can see I'm a "precise" person, and don't like to have errors OR tend to make errors a lot.
|
|
|
|
|
Brandon T. H. wrote: as you can see I'm a "precise" person
Who posts vague questions.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Just telling you, I tend to make errors a lot, and I need help to see if I'm doing this right (coding CFront). 
|
|
|
|