|
VC_RYK wrote: Is Anything required to achieve it and what waht kind of problem i can face?
You will likely run into Unicode-related issues. That and variable scope are the two biggest issues I've faced when porting one to the other.
VC_RYK wrote: As far as my knowledge is concerned, All upper version products automatically converts the project from older version to new one.
Yes, it converts the project, not the code.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Why VS2005? Consider VS2008 or VS 2010 (though the latter is a bit of a moving target still).
The step from VC6 to VS2005 is the big one though.
Upgrade Wizard will (try to) port your project files - this usually works ok - but you are alon wiht changes requried to your source code.
Compiler: VS 2005 provides improved standard compatibility, the most common issues being for scope, more rigorous checking of templates, and other minor things. For a list of breaking changes, see here[^] and here[^].
Unicode: Project settings now default to unicode. Moving from ANSI/MBCS to Unicode is a completely different story, you may want to take this as a separate step.
"Safe" CRT functions - many functions of the C/C++ Runtime will now generate a warnign that they should be replaced by safe counterparts - mostly to avoid potential buffer overflows and encourage more rigorous error checking. This is often a barrage of warnings, burying everything else under it. For more information, see here[^].
IDE + Build Performance - Get a really good computer. I mean it.
Windows Headers - we had some problems with some of the more arcane windows library headers moving some declarations around, requiring ugly include reordering and supressing some declarations being made / imported. That's unlikely to bite you, but can be an immense time sink.
|
|
|
|
|
Hello how are u?
I am new here and I have a great problem with my WinCE 5.0 application. I want to call an .NET application by my own developed prog (C/C++). I use the function
CreateProcess(_T("/flashdisk/app.exe"), NULL, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, NULL, &ProcInfo).
If I run my prog the CreateProcess function returns SUCCESS but the other prog cries " .NET CF Initialization Error!
The Application failed to load required components... Support info: -2147479552 (80001000)".
If I doubleklick the other program in the WinCE explorer the application starts with no error message.
Under WinCE6.0 I don't have this problem. Do I have to run an other application first before starting the other prog?
|
|
|
|
|
|
What's a KT ?
|
|
|
|
|
I assume you are talking about a Knowledge Transfer; then why not spell it out so everyone can understand the question? However this forum is for C/C++/MFC questions so I suggest you post in General IT Issues, Collaboration or some more appropriate place.
It's time for a new signature.
|
|
|
|
|
Richard MacCutchan wrote: I assume you are talking about a Knowledge Transfer
Wow, I would never have thaught of that. We have enough acronyms out there: is we start giving acronyms to things like "Knowledge Transfer", were will we end
Oh I know, that's what they call txtspk
|
|
|
|
|
|
Precisely...
It is particulary annoying when you have to read some "papers" about any kind of technology (but the worse is for software)
|
|
|
|
|
Cedric Moonen wrote: where will we end
Exactly; I usually have to go here[^] to find the answer. This was one of the few times when it came to me almost immediately. I must say I agree with you, people who post questions where the main item is a TLA (or TLA) are a PITA.
It's time for a new signature.
|
|
|
|
|
Where PITA of course is an ETLA.
|
|
|
|
|
Niklas Lindquist wrote: Where PITA of course is an ETLA.
Personally, I'd describe it as a FLA or a flatbread.
It's time for a new signature.
|
|
|
|
|
A place I worked in the early 80s had at least three acronyms of MRP. It all depended on whom you were talking to.
Once you agree to clans, tribes, governments...you've opted for socialism. The rest is just details.
|
|
|
|
|
Richard MacCutchan wrote: I assume you are talking about a Knowledge Transfer;
I suppose is "Klingon Therapy" instead.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
I am writing a small program in MFC using Dialog based project.
What I want to achive is : On pressing "Up Arrow Key" I want to redraw a rectangle which was already drawn.( want to draw the rectangle in other point).
Can you please help me what I am doing wrong here.
I am setting a variable "iKeyPressed" to "1" "PreTranslateMessage" method when Up Key is pressed.
BOOL CKeyDownTestDlg::PreTranslateMessage(MSG* pMsg)
{
iKeyPressed = 0;
if (pMsg->message == WM_KEYDOWN)
{
if(pMsg->wParam==VK_UP)
{
iKeyPressed = 1;
CKeyDownTestDlg::OnPaint();
}
}
return CDialog::PreTranslateMessage(pMsg);
}
Then in OnPaint() method I am checking the value of "iKeyPressed". If that is "1", then I intend to "Redraw" (erasing out the previously drawn rectangle)rectangle which was drawn earlier.
void CKeyDownTestDlg::OnPaint()
{
if (IsIconic())
{
}
else
{
char c[10];
CPaintDC dc(this);
CString MFCString;
MFCString = c;
if(iKeyPressed==0)
{
dc.Rectangle(5,5,100,20);
AfxMessageBox(_T("iKeyPressed = 0"));
}
if(iKeyPressed==1)
{
CPaintDC dc(this);
AfxMessageBox(_T("iKeyPressed = 1"));
dc.Rectangle(5,5,20,100);
}
CDialog::OnPaint();
}
}
Interestingly, while executing I could see Message "iKeyPressed = 1".
Any help is appreciated.
Thanks,
Arindam D Tewary
|
|
|
|
|
You need to understand how WM_PAINT and OnPaint works. If you call your OnPaint at an arbitrary time what happens is it creates a CPaintDC which won't (or rather probably won't) have any invalid region in it. So all your drawing is clipped to a non-existent region and nothing appears on the screen.
Try calling Invalidate() instead of OnPaint() and see if that improves the situation. Can't remember the parameters off the top of me head so you'll have to look them up! This signals that you want to paint the whole window and will cause a redraw (i.e. your OnPaint()) will get called indirectly. When that happens CPaintDC will be set up properly.
Oh, and only have one object of type CPaintDC in a given OnPaint method, you might get some strangeness otherwise.
Cheers,
Ash
|
|
|
|
|
Arindam Tewary wrote: BOOL CKeyDownTestDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
iKeyPressed = 0;
I think the iKeyPressed = 0 in the above code is you problem. Remove it and change the following piece of code
Arindam Tewary wrote: if(iKeyPressed==1)
{
CPaintDC dc(this); // device context for painting
AfxMessageBox(_T("iKeyPressed = 1"));
dc.Rectangle(5,5,20,100);
}
This way
if(iKeyPressed==1)
{
iKeyPressed = 0
CPaintDC dc(this);
AfxMessageBox(_T("iKeyPressed = 1"));
dc.Rectangle(5,5,20,100);
}
BTW calling OnPaint directly is a bad idea: you should replace it with
InvalidateRect(...);
UpdateWindow();
sequence.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks Mr. Palini for reply.
I just started VC++ MFC couple of days back. I am still not very much comfortable in it after comming from C# background. So I directly called that OnPaint method. I would keep learning about it in comming days for sure.
I used your suggestion but still it does not repaint it. . Any other idea sir?
Thanks,
Arindam D Tewary
|
|
|
|
|
You should remove the Message Boxes calls to see it.
Also you're using too many device contexts in OnPaint .
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi All,
How to catch the new allocation failure exception in MFC
I am using CMemoryException but it is not catching.
I am using bad_alloc exception that also it is not catching.
|
|
|
|
|
With ellipsis you can catch all exceptions, if you are not sure about exception type:
catch (...) {
}
--
"Programming is an art that fights back!"
|
|
|
|
|
|
You are welcome!!
--
"Programming is an art that fights back!"
|
|
|
|
|
Here's a question to consider...
If you're not catching the exception, how do you know it's being thrown? Are you sure it's a memory allocation failure or could it be something else?
Cheers,
Ash
PS: Okay, that was two questions...
PPS: Just out of interest, where are you trying to handle the exception that may or may not have happened? You shouldn't throw exceptions through DLLs supplied by the operating system, so make sure you're trying the catch around all your window procedures or message handlers.
|
|
|
|
|