|
thank you led mike.
i have done debugging of the program it is giving stack overflows dialog.
so you can check the code where it is giving me this error. My main moto is to compare bitmaps if you have any code related to this field do help me.
I will be very thankful to you.
Thank You
kaushal kishore sharma
|
|
|
|
|
|
Why are you selecting bitmaps into memory DCs, but then getting window DCs
to get pixel values from?
Where is the error occurring?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
thank you sir.
i am doing my selecting bitmap work using memorydc since beginning.
i do not myself, where is the problem. It is executing but giving blank window and a dialog box written "pixel MFC Application has encountered a problem and needs to close. We are sorry for the inconvenience."
and after this i click on debug then it is giving "Stack overflow"
so please help me.
Thank You
kaushal kishore sharma
|
|
|
|
|
kaushal kishore sharma wrote: i do not myself, where is the problem.
Then how do you know the problem is in the code you posted?
Like others have mentioned, you need to debug this.
Put a breakpoint at the start of your posted code and step
through line by line.
Are the LoadImage() calls succeeding?
Are the SelectObject calls succeeding?
Are any calls succeeding?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I've read this thing: http://www.codeproject.com/KB/winsdk/console_event_handling.aspx[^]
but it's still not clear where i put the codes...
the main idea is:
that the user is not possible to close the console window by pressing X.
Please help me, i've spend houres searching
|
|
|
|
|
Hi all,
I have a new problem...I'm trying to do a matrix of rectangles in my drawcli like application, I have created my own rectangle class CRectangle and I'm trying to draw on screen a matrix of 640x480 rectangles. My problem is the slowness of the application. I have implement a for loop to draw on screen the rectangles, and I have store the matrix of rectangles in a CTypedPtrList. Could you give me any ideas to make the application going faster?
The code is pasted below:
In this part I implement the matrix of rectangles and I store it in the CTypedPtrList
void CGOEView::OnElementiCaricamatrice()
{
if(rMatr==0)
{
CGOEDoc* pDoc = GetDocument();
int x=50;
int y=-60;
rMatr++;
m_pTempElement=0;
CClientDC aDC(this);
OnPrepareDC(&aDC);
for(int j=0;j<480;j++)
{
for(int i=0;i<640;i++)
{
CPoint* m_FirstPoint=new CPoint(x,y);
CPoint* m_SecondPoint=new CPoint((x+2),(y-2));
m_pTempElement=new CRectangle(*m_FirstPoint,*m_SecondPoint,pDoc->GetElementColor(),m_DimPen);
pDoc->AddElement(m_pTempElement);
m_pTempElement=0;
delete m_pTempElement;
x=x+3;
}
y=y-3;
x=50;
}
}
}
Then in the part of the code pasted below I draw the rectangle element on screen:
void CGOEView::OnDraw(CDC* pDC)
{
CGOEDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
CElement* mElement=0;
if(rMatr!=0)
{
POSITION bPos = pDoc->GetHeadElectrode();
while(bPos)
{
mElement = pDoc->GetNextElectrode(bPos);
TRACE( "The value of x is %d\n", rMatr );
if(pDC->RectVisible(mElement->GetBoundRect()))
{
sel=FALSE;
mElement->Draw(pDC,m_pSelected,sel);
}
}
}
}
Thank for the help
|
|
|
|
|
that is a windows painting 101 issue. You need to study double buffering. Sometimes in Windows/MFC it's called working with a memory DC
CreateCompatibleDC[^]
Google search[^]
led mike
|
|
|
|
|
Thank you very much it resolve almost all the problems...now I have only a great memory leakage to erase. Could you help also with this problem?
|
|
|
|
|
Laan82 wrote: Could you help also with this problem?
Not sure what help you need, here is a guess.
Anytime you use new to allocate heap memory there needs to be a corresponding delete .
Laan82 wrote: CPoint* m_FirstPoint=new CPoint(x,y);
CPoint* m_SecondPoint=new CPoint((x+2),(y-2));
led mike
|
|
|
|
|
thank you the problem is exactly this I take care only of the problem derived from my list and I don't think of the problem derived from the pointer at the point Thank you very much!
|
|
|
|
|
Hi,
I'm trying to distribute an application that i made:
The first step was to find a way to create an installer: for now i found ISTools, seems ok for me.
I tested it and worked fine, but when i tried to install the application in an other PC Without VStudio installed, it doesn't worked.
After some tests i realized that the problem has something to do with visualstudio properties because I've created a simple HelloWorld program in VisualStudio 2005 and this simple program works fine in the PC where it was created (it has the VisualStudio Installed), but when I try to execute the release *exe created in an other PC (simply copying the exe file to the other PC), it doesn't worked: And gives the flowing error:
"It's not possible to initiate the application because the application is not well configured. The re-installation of the Application may resolve the problem"
(this is the translation from the Portuguese text).
Is there is something more that i've to install? Is there some configurations that i've to make?
The both OS are windows XP.
Thanks in advance,
Filipe Apóstolo
|
|
|
|
|
Have you seen this?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Ok that worked, i've installed the package.
Tanks.
However the first sample application that uses Gtkmm (doesn't worked), but in this case I've installed GTK+ and Gtkmm runtime packages. Now I'll try to find why.
Tank you!
|
|
|
|
|
will the same work for vc++ 6.0 also?
|
|
|
|
|
Did you fail to notice the big Visual C++ 2005 mentioned several times in that article?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
No Idin't . I found the problem, it was the runetime versions packages that dint matched. Now its fine.
But thanks for your Help
|
|
|
|
|
In addition to David's reply, you can also link statically to the C-runtime liraries and MFC libraries. You won't need to install the redistribution package on the target machine. Of course, the size of your exe will be much larger.
|
|
|
|
|
Hello evrybody,
I have big project with lots of source files. The project compiles well, until I don't know how it started to recompile each time I incure the mere code change.
I noticed the incremental compilation option, as well the minimal rebuild option in the linked tab of the project options propertysheet.
I set them to what they should be, and I deactivated all sorts of optimizations, wether at compile time or link time.
No use :
It's like the IDE has no history of what has been compiled or built : always it recompiles evrything, and I have to wait the unbearable 3 or 4 minutes to see the concret effect of the source change or to finally realize that there is a stupid error for which I have to wait another 4 minutes.
Please help.
Our Philosophy, Mohammed Baqir Al Sadr
modified on Monday, October 6, 2008 10:23 AM
|
|
|
|
|
Is the computer's date/time set correctly?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
No David, no. And there is no way I can set the clock correctly.
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|
|
hINTModuleState wrote: And there is no way I can set the clock correctly.
You can't set the clock on your local PC? Without that, you'll have to deal with a rebuild each time because VS thinks that all files have been modified.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
And since when does he think that the file have been modified ? Since the future : between the files creation date
and their "anterior" modification date which actually the case for certain files ???
I have lacnhed the IDE lmultiple times
and opened each file of the project many times, and built the project many time without
changing the clock after I acrtually changed it 3 weeks ago? Is that not sufficient for it to look at the time difference between the .obj
files creation dates and the last modification dates for the corresponding source files to
see that nothing has happened at the source code since the last compilation ??
I can't change the clock to the actual date, without setting the clock back to July evrything will stop.
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|
|
hINTModuleState wrote: I can't change the clock to the actual date, without setting the clock back to July evrything will stop.
What are you talking about?
If you can't change your clock, then change all the date/times on
the files. Look up the "touch" utility, or write your own. Of course
when you write your own it's going to rebuild every time
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thank you very much indeed, especuially for the touch utility : if the only solution is to synchronize my source file with the machine date/time, then it already came to my mind to mix ::FindNextFile API and the WIN32_FIND_DATA structure in a source code that would do the thing programmatically. But to my luck, and your help This touch utility is a tool ready for the job.
Mark Salsbery wrote: What are you talking about?
Of course I am talking about the ttremendous trial software that I use, and which unless I play with the clock and other things I can never use.
I still wonder what the "creation date" attribute of the source file has to do with this recompilation behaviour.
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|