|
|
CPallini wrote: Well, I don't disable warnings: they make me feel less alone
Well - I know this feeling:
The compiler is the only one who understands me at least sometimes.
Failure is not an option - it's built right in.
|
|
|
|
|
Hi!! You're not alone!! Me too never disable but solve warnings only if it is necessary.
Warnings are one of my companion!!
Best Regards,
Suman
|
|
|
|
|
To print data from my CFormView, I am using MFC Print architecture (OnPreparePrinting, OnBeginPrinting, OnEndPrinting etc.) . OnPrint manages printing (and OnDraw for screen). On Dot-matrix printer, need to print 3 or 4 text-invoices one by one (one below another), on one A4 size paper (data is from CFormView).
How/Where to set paper size (height) to say 2.55 inches, so that I can print single invoice without ejecting A4 paper (on Dot-Matrix printer).
If possible, I wish to use MFC Doc-View Print architecture otherwise Win32 printing.
Please help me with some code-snippet.
Thanks for any help
Ana
Ana_v123
|
|
|
|
|
Check the following code project article
http://www.codeproject.com/printing/printerorientation.asp
I hope it helps
|
|
|
|
|
The following is a code snippet for checking the subdirectories.
This code is crashing in the highligted line when sStr is "C:\".If it is "D:\" or "E:" it is working.
void CBatchPrintDlg::ChkForSubDir( CString sStr, HTREEITEM hTree )
{
struct _finddata_t c_file;
long hFile;
::SetCurrentDirectory((LPCTSTR)sStr);
if( (hFile = _findfirst( "*.*", &c_file )) != -1L )
{
if ( IsDirectory ( c_file.attrib ) )
InsertItemTOTree( (LPCTSTR)c_file.name, hTree );
//m_tree.InsertItem((LPCTSTR)c_file.name, hTree );
while( _findnext( hFile, &c_file ) == 0 )
{
if ( IsDirectory ( c_file.attrib ) )
{
InsertItemTOTree( (LPCTSTR)c_file.name, hTree );
//m_tree.InsertItem((LPCTSTR)c_file.name, hTree );
//break;
}
}
_findclose( hFile );
}
}
Please help.
Thanks.
|
|
|
|
|
sheetal_06 wrote: "C:\".If it is "D:\" or "E:"
Do all of these have subdirectories ?
|
|
|
|
|
ya all have sub directories.
|
|
|
|
|
Since you are using MFC, why not utilize CFileFind ? It's much cleaner. What exactly is your code supposed to be doing? There's no need to call SetCurrentDirectory() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Are you sure sStr is C:\ when you got error and also why you dont use of value return of SetCurrentDirectory?
|
|
|
|
|
Hi all,
I'nm trying to read the data in a UDL file, but I think it is binary(despite being readable in Notepad), and all my attempts to read one has failed, generally getting some gibberish such as "y;[" and a load of blank spaces.
Can anyone help me in this regards
Many Thanks
Regards,
-- modified at 4:43 Thursday 19th July, 2007
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Take a look at this article here; scroll down and look at the "Binary files" section
Hope this helps!
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
|
|
|
|
|
Thanks for the response, I've tried it, but with this result:
memblock="y;["
Isn't a udl file in unicode ??
If so how would one do it ?
Thanks again ...
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
I could not find the specifications for ‘.udl’, but I saw no indication that it has to be Unicode (just statements like plain text). I would open it as plain text, Unicode, and binary with a hex editor and look at it closely. After that a little research should provide the answer.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Assuming this file is in UTF-16 encoded UNICODE, ie every character is a 16 bit word, Notepad may have put a header on the file to indicate this (despite it supposedly being plain text ). I would try opening it in notepad and then saving in a separate file with UTF-8 encoding. Ordinary text processing code should then be able to read it. If not you've got a binary file.
If you have to read the unmodified UDL file then you'll need to find the size of that header ( I think it's four bytes but I'm not sure ), skip over it and then read wide characters a wchar_t or WORD or short at a time from the file.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
|
Hi,
I am using VC++ 6.0 for my project,in which I am using DialogBox and in
dialogBox I am using picture control.So i want to change picture at run time
so how can I do this.
Thanks and Regards
Atul Mahajan
|
|
|
|
|
Use the STM_SETIMAGE message. See the MSDN documentation for more information.
Hope this helps!
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
|
|
|
|
|
Hi PerspX!
im using VC6.0, in my dialog based application if i try to load the bitmap with the following code in OnPaint() Function, its taking more memory and its not clearing,
CPaintDC dc(this); // device context for painting
HBITMAP m_Bmap;
CRect rect;
HDC memdc;
CString path,m_ifilename1,m_ifilename2;
path=AfxGetApp()->m_pszHelpFilePath;
for(int i=1;i<=path.GetLength();i++)
{
if(path.Mid(i,18)=="VTS_VC_0003_070605")
{
path = path.Mid(0,i+18);
break;
}
}
m_ifilename1 = path + "\\"+"3.bmp";
GetClientRect(&rect);
m_Bmap=(HBITMAP)::LoadImage(NULL,m_ifilename1,IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
memdc=::CreateCompatibleDC(dc.m_hDC);
::SelectObject(memdc,m_Bmap);
BitBlt(dc.m_hDC,0,0,rect.right,rect.bottom,memdc,0,0,SRCCOPY);
i need to know whether its possibble to load jpeg image in dialog background (to reduce the memory) ?
pls help me
thanks in advance
Abdul Khathir A.
|
|
|
|
|
What's the source of the bitmap? A resource? A File? What type of bitmap?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Thanks,I overlooked the docs."
|
|
|
|
|
You can use of SetBitmap with a new handle to bitmap.
|
|
|
|
|
Hi,
I have added functionality to add history in my list control by using the following function.
BOOL GetHistory(CStringList & list)
{
STATURL url;
CString strUrl;
ULONG uFetched;
IUrlHistoryStg2Ptr history;
IEnumSTATURLPtr enumPtr;
if(FAILED(CoCreateInstance(CLSID_CUrlHistory,
NULL,
CLSCTX_INPROC_SERVER,
IID_IUrlHistoryStg2,
( void**)&history)))
{
return false ;
}
if(FAILED(history->EnumUrls(&enumPtr)))
return false;
while(SUCCEEDED(enumPtr->Next(1,&url,&uFetched)))
{
if(uFetched==0)
break;
strUrl = url.pwcsUrl;
list.AddTail(strUrl);
}
return true;
}
Only IE history is added to my list control.How can i add history of other browsers also.
|
|
|
|
|
revanth1985 wrote: How can i add history of other browsers also.
Do they store history data in the C:\Documents and Settings\<user>\Local Settings\History folder?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
ya.only IE histroy is located in the above location.But if i browse using other browsers such as mozilla,opera etc,i am not getting the history.I want to load history of all the browsers in a list control.How can i go further?
|
|
|
|
|
revanth1985 wrote: But if i browse using other browsers such as mozilla,opera etc,i am not getting the history.
So where do they store their history information?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|