Click here to Skip to main content
15,897,518 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: setwindowtext and integers Pin
Hamid_RT7-Oct-08 5:03
Hamid_RT7-Oct-08 5:03 
GeneralRe: setwindowtext and integers Pin
Adam Maras7-Oct-08 9:11
Adam Maras7-Oct-08 9:11 
GeneralRe: setwindowtext and integers Pin
David Crow7-Oct-08 3:33
David Crow7-Oct-08 3:33 
GeneralRe: setwindowtext and integers Pin
CPallini7-Oct-08 22:50
mveCPallini7-Oct-08 22:50 
QuestionAccessing variables in one class from another Pin
jon_fallon6-Oct-08 8:00
jon_fallon6-Oct-08 8:00 
AnswerRe: Accessing variables in one class from another Pin
David Crow6-Oct-08 8:49
David Crow6-Oct-08 8:49 
AnswerRe: Accessing variables in one class from another Pin
CPallini6-Oct-08 9:48
mveCPallini6-Oct-08 9:48 
QuestionComparing bitmap problem Pin
kaushal kishore sharma6-Oct-08 7:15
kaushal kishore sharma6-Oct-08 7:15 
I am using this code for comparing bitmaps.
it is compiling without error but when we execute it just a blank window arrives with a error message and ask to close the program.
Can anyone see what is the solution for this code.

void CPixelView::OnDraw(CDC* pDC)
{
CPixelDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
{
COLORREF color[255][255],color1[255][255];


CBitmap bitmap,bitmap1;
CString file1,file2,strText;
file1.Format("C:\\1.bmp");
file2.Format("C:\\3.bmp");
CDC dcMemory,dcMemory1;
int r[255][255],R[255][255];
HBITMAP hBitmap1 = (HBITMAP)::LoadImage(NULL,file1,IMAGE_BITMAP, 0, 0,LR_LOADFROMFILE );//| LR_CREATEDIBSECTION);
HBITMAP hBitmap2 = (HBITMAP)::LoadImage(NULL,file2,IMAGE_BITMAP, 0, 0,LR_LOADFROMFILE );
// Attach the loaded image to the CBitmap object.
bitmap.Attach(hBitmap1);
bitmap1.Attach(hBitmap2);
dcMemory.CreateCompatibleDC(pDC);
dcMemory1.CreateCompatibleDC(pDC);
dcMemory.SelectObject(&bitmap);
dcMemory1.SelectObject(&bitmap1);
pDC->BitBlt(0,0,200,200,&dcMemory,0,0,SRCCOPY);
pDC->BitBlt(300,300,700,700,&dcMemory1,0,0,SRCCOPY);
//for all the pixels
for(int i=0;i<48;i++)
{
for(int j=0;j<48;j++)
{
HDC hDC = ::GetDC(this->GetSafeHwnd());
HDC hDC1 = ::GetDC(this->GetSafeHwnd());
color[i][j] = ::GetPixel(hDC,i,j);
::ReleaseDC(this->GetSafeHwnd(), hDC);
r[i][j]=GetRValue(color[i][j]);


color1[i][j] = ::GetPixel(hDC1,i,j);
::ReleaseDC(this->GetSafeHwnd(), hDC1);
R[i][j]=GetRValue(color1[i][j]);
}
}//got the pixel values


}
}


Thank You
kaushal kishore sharma
AnswerRe: Comparing bitmap problem Pin
led mike6-Oct-08 7:26
led mike6-Oct-08 7:26 
AnswerRe: Comparing bitmap problem Pin
kaushal kishore sharma6-Oct-08 8:02
kaushal kishore sharma6-Oct-08 8:02 
AnswerRe: Comparing bitmap problem Pin
Hamid_RT6-Oct-08 7:57
Hamid_RT6-Oct-08 7:57 
QuestionRe: Comparing bitmap problem Pin
Mark Salsbery6-Oct-08 8:13
Mark Salsbery6-Oct-08 8:13 
AnswerRe: Comparing bitmap problem Pin
kaushal kishore sharma6-Oct-08 8:30
kaushal kishore sharma6-Oct-08 8:30 
QuestionRe: Comparing bitmap problem Pin
Mark Salsbery6-Oct-08 8:43
Mark Salsbery6-Oct-08 8:43 
QuestionEvent handling in C Pin
massaslayer6-Oct-08 7:06
massaslayer6-Oct-08 7:06 
QuestionConstruct a matrix of rectangles Pin
Laan826-Oct-08 5:30
Laan826-Oct-08 5:30 
AnswerRe: Construct a matrix of rectangles Pin
led mike6-Oct-08 7:25
led mike6-Oct-08 7:25 
GeneralRe: Construct a matrix of rectangles Pin
Laan826-Oct-08 8:53
Laan826-Oct-08 8:53 
GeneralRe: Construct a matrix of rectangles Pin
led mike6-Oct-08 9:48
led mike6-Oct-08 9:48 
GeneralRe: Construct a matrix of rectangles Pin
Laan826-Oct-08 21:29
Laan826-Oct-08 21:29 
QuestionI'cant run my Visual Studio created Apps in an other PC whitout VS installed. Pin
Apstolo6-Oct-08 4:49
Apstolo6-Oct-08 4:49 
QuestionRe: I'cant run my Visual Studio created Apps in an other PC whitout VS installed. Pin
David Crow6-Oct-08 4:51
David Crow6-Oct-08 4:51 
AnswerRe: I'cant run my Visual Studio created Apps in an other PC whitout VS installed. Pin
Apstolo6-Oct-08 5:05
Apstolo6-Oct-08 5:05 
AnswerRe: I'cant run my Visual Studio created Apps in an other PC whitout VS installed. Pin
Chandrasekharan P6-Oct-08 20:37
Chandrasekharan P6-Oct-08 20:37 
QuestionRe: I'cant run my Visual Studio created Apps in an other PC whitout VS installed. Pin
David Crow7-Oct-08 3:10
David Crow7-Oct-08 3:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.