|
raviteja2020 wrote: Please go through the code and point out the mistake in the code.
Please, use the debugger to find out the bogus code and (optionally) post here the relevant part.
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]
|
|
|
|
|
The code is compiling properly.
Debugger showing no errors but its not showing expected output.
|
|
|
|
|
Well, now you should have some insights about what's going wrong, so please post the relevant code.
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]
|
|
|
|
|
void CPictureBox::ShowBitmap(CPaintDC *pdc)
{
CDC dcMem;
dcMem.CreateCompatibleDC(pdc);
CRect lRect;
GetClientRect(lRect);
lRect.NormalizeRect();
CBitmap* pOldBitmap = (CBitmap*)dcMem.SelectObject(&m_bmpBitmap);
pdc->StretchBlt(0,0,lRect.Width(),lRect.Height(),&dcMem,0,0,bm.bmWidth,bm.bmHeight,SRCCOPY);
}
This part might be the major problem, since its not displaying the picture.
modified on Friday, September 11, 2009 7:08 AM
|
|
|
|
|
raviteja2020 wrote: pdc->StretchBlt(0,0,lRect.Width(),lRect.Height(),&dcMem,0,0,bm.bmWidth,bm.bmHeight,SRCCOPY);
Why are you using bm (instead of m_bmpBitmap ) in the above line?
BTW use the code block button when posting code snippets.
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]
|
|
|
|
|
protected:
CString m_sResults;
CBitmap m_bmpBitmap;
i read in somewhere that BITMAP, instead of CBitmap, variable has to be used for image display, copy and resize.
I've attempted using bmpBitmap also. The compiler shows these errors
C:\Documents and Settings\Admin\Desktop\SockIm1\PictureBox.cpp(48) : error C2065: 'bmpBitmap' : undeclared identifier
C:\Documents and Settings\Admin\Desktop\SockIm1\PictureBox.cpp(48) : error C2228: left of '.bmWidth' must have class/struct/union type
C:\Documents and Settings\Admin\Desktop\SockIm1\PictureBox.cpp(48) : error C2228: left of '.bmHeight' must have class/struct/union type
I felt that it must be all right if i use bm instead of bmpBitmap
|
|
|
|
|
raviteja2020 wrote:
i read in somewhere
raviteja2020 wrote: C:\Documents and Settings\Admin\Desktop\SockIm1\PictureBox.cpp(48) : error C2065: 'bmpBitmap' : undeclared identifier
Your variable name is m_bmpBitmap , not bmpBitmap .
raviteja2020 wrote: I felt that it must be all right if i use bm instead of bmpBitmap
OK, but the you've to do
m_bmpBitmap->GetBitmap(&bm);
pdc->StretchBlt(0, 0, lRect.Width(), lRect.Height(), &dcMem, 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY);
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 everybory.
i using vc++6.0 and MFC. I want input data text in edit box using font Courier.
thanks and wish your help.
regards
nothing
|
|
|
|
|
CDC *pDC = GetDC();
CFont m_Font;
LOGFONT lFont;
memset(&lFont, 0, sizeof(lFont));
lFont.lfHeight =
MulDiv(20, ::GetDeviceCaps(pDC->m_hDC,
LOGPIXELSY), 12 );
lFont.lfWeight = FW_NORMAL;
lFont.lfOutPrecision = OUT_TT_ONLY_PRECIS;
wcscpy( lFont.lfFaceName, _T("Courier"));
// Set the Font
m_Font.CreateFontIndirect(&lFont);
// Set the specified font for the edit ctrl.
m_edit.SetFont(&m_Font);
Величие не Бога может быть недооценена.
|
|
|
|
|
hi u.
when i type text for Edit box (for exam id of Text edit box: IDC_TEXT_BOX). font must using is Courier.
that is function using where ?
nothing
|
|
|
|
|
m_edit in the code is Edit box and if your application is dialog then add that code in InitDialog
if SDI, MDI then add in OnInitialUpdate().
And one more thing, use strcpy instead of wcscpy if you have _UNICODE, UNICODE preprocessor.
Yes, Hope you know that m_edit is of CEditCtrl added using class wizard, once this code is added it will be courier .
Величие не Бога может быть недооценена.
|
|
|
|
|
hi.
I using that is code in function ::OnInitDialog()
//----------------
CDC *pDC = GetDC();
CFont m_Font;
LOGFONT lFont;
memset(&lFont, 0, sizeof(lFont));
lFont.lfHeight = MulDiv(20, ::GetDeviceCaps(pDC-&m_hDC, LOGPIXELSY), 12 );
lFont.lfWeight = FW_NORMAL;
lFont.lfOutPrecision = OUT_TT_ONLY_PRECIS;
strcpy( lFont.lfFaceName, _T("Courier"));
// Set the Font
m_Font.CreateFontIndirect(&lFont);
// Set the specified font for the edit ctrl.
this->SetFont(&m_Font);
//-----------------------------------------------------------
but it wrong.
i wish your help. thanks
nothing
|
|
|
|
|
It will not work because CFont m_Font; object is declared as local object.
1) Make CFont m_Font; object member of your dialog class.
2) Use this code in OnInitDialog() :
m_Font.CreateFont(-11, 0, 0, 0, 100, FALSE, FALSE,
0, ANSI_CHARSET, OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
FF_MODERN, "Courier");
CWnd *pWnd = GetDlgItem(IDC_TEXT_BOX);
pWnd->SetFont(&m_Font);
If you need some additional info on CreateFont (the parameters for example) you can find this info here[^].
I hope this helps!
Regards
Nuri Ismail
|
|
|
|
|
thanks for support of you very much. I hope, in near future, you help for me.
thank you very much.
regards.
nothing
|
|
|
|
|
... ::OnInitDialog()
{
CFont m_Font;
VERIFY(m_Font.CreateFont(
12, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
FW_NORMAL, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
"Courier")); // lpszFacename
CWnd *pWnd = GetDlgItem(IDC_MESSAGE_TEXT);
pWnd->SetFont(&m_Font);
m_Font.DeleteObject();
...
}
=>Data in Edit text is Bold. When I using mouse to choice this Edit text , it show text wrong. seem, it need control of mouse.
for example: show text wrong when type : "y" or "g", it have lost under.
i wish you help me. thanks very much.
regards
nothing
|
|
|
|
|
I want to download a file from linux server using FTP.
But before downloading the file, i want to compare the file creation date and time of remote file with the local one.
so how do i get the remote file's creation date and time?
for local file, we can use the CFile::GetStatus() method to get the date and time.
so how to do this for remote file?
sunnyram
|
|
|
|
|
Check CFtpFileFind class and CFtpFileFind::GetLastWriteTime method.
|
|
|
|
|
Hi
I need to cut one small rectangle piece of image in one full image ..how to do that ..??
Regards
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
That depends.
Do you want to replace the area you cut with a solid colour?
Do you want to put the area you cut into a new array of pixels?
Are there any specific classes you are using?
Most importantly, what have you tried already? This is a very trivial problem, so you're not likely to get a lot of help without first attempting it yourself.
|
|
|
|
|
Sorry ...
already i tried ...but i am very beginner to learn
its really complicated ..so that ..i posted ..
my image contains one full house picture ..i need to cut of top of left corner room ..this is my question .....
Please help me ...how to do that ,..
regards
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
Have a look at BitBlt function [^].
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]
|
|
|
|
|
I want record count.tell me the query how to Count The Number Of Records In An Access Database
Regards
Jitendra
modified on Friday, September 11, 2009 2:26 AM
|
|
|
|
|
SELECT COUNT(*) FROM tablename;
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]
|
|
|
|
|
What do you want to know?
1) How to use ODBC functionaries?
2) How to use OLE DB functionaries?
3) How to use MFC DB functionaries?
4) How to write SQL script?
5) How to use MS-Access user interface?
I know there are 3 different coding ways for database programing in vc++.
1 - using ODBC functions like c style.
2 - using OLE DB functions with ActiveX programing in c or c++ style.
3 - using database class in MFC in c++ style.
Check your mind.
|
|
|
|
|
what is _T("\\sample")???
what type is it???
i have string folder_name to pass to create zip folder... i want to pass normal string to it..how can i do it..
int _tmain(int argc, _TCHAR* argv[])
{
char temp[] = "c:\\tempo\\Zippi.zip";
HZIP hz; DWORD writ;
// EXAMPLE 1 - create a zipfile from existing files
hz = CreateZip(_T('temp'),0);-->this gives an error.how do i pass string var here or how to convert.
ZipAdd(hz,_T("gunjan.txt"), _T("c:\\tempo\\gunjan.txt"));
ZipAdd(hz,_T("kajal.txt"), _T("c:\\tempo\\kajal.txt"));
CloseZip(hz);
_tprintf(_T("Created 'c:\\tempo\\Zippi.zip'\n"));
return 0;
}
gives error:
Compiling...
zipping.cpp
d:\documents and settings\admin\my documents\visual studio 2008\projects\zipping\zipping\zipping.cpp(18) : error C2665: 'CreateZip' : none of the 2 overloads could convert all the argument types
d:\documents and settings\admin\desktop\gunjan\zip.h(22): could be 'HZIP CreateZip(const TCHAR *,const char *)'
while trying to match the argument list '(int, int)'
Build log was saved at "file://d:\Documents and Settings\admin\My Documents\Visual Studio 2008\Projects\zipping\zipping\Debug\BuildLog.htm"
zipping - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
|
|
|
|
|