|
how to remove them from map
|
|
|
|
|
|
Thanks this solved my problem....
now one more problem i m having that when these ui threads give me result i send the output to my main window to print it in my list control using SendMessage. like this
if (m_pLogWnd)
{
pasiin_val obj_val;
obj_val.index = test_int;
obj_val.url = test_str;
obj_val.task_n = test_task_name;
m_pLogWnd->SendMessage(LOGMSG, (WPARAM)(CString*)&logmsg, (LPARAM)(&obj_val));
}
m_pLogWnd is been assigned with this of my main window...
now my first problem is when i start and stop my thread various times it gives abort assertion failed error sometimes in wincore.cpp in line 980 and sometimes in afxwin2.inl and it sometimes also say that refrenced memory cannot be accessed..
and second after stopping my thread in some threads it shows output value...
how to resolve it...
|
|
|
|
|
Oh I see, Thanks for your help and explanation!!
Other than code, there is one more option to disable the warning:
In Project Menu --> Project Properties --> C/C++ --> Advanced --> Disable Specific Warnings, we can specify a warning number to be suppressed as follows:
/wdn Disables the specified compiler warning where n is the compiler warning number.
For example,
/wd4786 disables compiler warning C4786.
Best Regards,
Suman
|
|
|
|
|
|
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.
|
|
|
|