|
The function seems not to leak. Can you post the code of the loop where you're calling CheckClient::Run ?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
hi,
i am new to MFC,can any one suggest me a tutorial site?
thanks in advance
|
|
|
|
|
|
Thanks for the Information given.
Now one more Problem,I have created a MFC Dll(Mydll),the Class Name is CMyClass with a function Function1().How can i use the dll in the asp page?i want to use the above function.will be waiting for ur reply
|
|
|
|
|
I don't know much hardly anything about ASP, but I would guess you can make the class in your DLL a COM object to take advantage of it from ASP. You will need to find an MFC sample about COM.
Chris Richardson
C/C++ Include Finder[^]
|
|
|
|
|
Hi,
I am working on the application wherein i have to download the file from the URL mentioned.
But the problem is I have to support the resume operations for broken downloads...using mfc.
How do i do this using mfc. Please give me your inputs.
TIA,
Snowy
|
|
|
|
|
Once you have instance of an CHttpFile object and an instance of a CFile object, you can make a calls similar to the following:
DWORD dwStartAt = oLocalFile.SeekToEnd();
pHttpFile->Seek(dwStartAt, CFile::begin);
Then you can begin the loop of pHttpFile->Read and oLocalFile.Write calls.
Let me know if you need a larger code sample.
Ron Ward
|
|
|
|
|
I read the article named "The Cryptography API, or How to Keep a Secret", written by Robert Coleridge. He told that in order to compile the sample of this article I only need MS Visual C++ version 4.2 or later and Windows NT 4.0 or later. In fact, I cannot compile it with MS Visual C++ 6.0. I use MS Windows 2000 professional.
I'm also failed in building my own application using Cryptographic API. In spite of including wincrypt.h , I still catch the undefined compile errors.
In order compile my application, do I have to add any macro in my code or download any service pack for my Visual Studio?
|
|
|
|
|
vuduo wrote:
In order compile my application, do I have to add any macro in my code or download any service pack for my Visual Studio?
Try this one:
#define _WIN32_WINNT 0x0500
This should do the trick.
--
karl
|
|
|
|
|
Hi
I have a CTreeCtrl in a window which is the child window of another window (main window).
When I deselect (with SelectItem(NULL)) my selection when my CTreeCtrl window has the focus, the result is as expected.
However when I deselect my selection when the main window has the focus, my CTreeCtrl clears selection but sets the selection to the first visible item as soon as the window with the CTreeCtrl gets the focus again. Is this intended or a Windows bug? This is very annoying and I can't find a workaround
Anyone knows how to deal with this?
By the way I set the option "Show selection always", so my problem isn't linked to that
|
|
|
|
|
hello @all,
i have:
char r1[1000];
how can i delete the char r1???
thanks you
sunny
|
|
|
|
|
you can't "delete" something that you didn't create with "new".
-c
WWT2D?
|
|
|
|
|
If you mean clearing out the array do this: r1[0] = '\0'; (All clear!)
|
|
|
|
|
georgiek50 wrote:
If you mean clearing out the array do this: r1[0] = '\0'; (All clear!)
This assumes you are using r1 as a character string rather than an array of bytes.
If you want to "clear out" an array, try:
memset(r1,0,1000);
|
|
|
|
|
Even though it is an array of byte wouldn't \0 take care of everything? which brings me to ask another question. If I declared an array of bytes say array[100] but then only needed to fill the first fifty. Do I need a NULL character like in a string? If yes how would I set it. If no, why not?
|
|
|
|
|
georgiek50 wrote:
Even though it is an array of byte wouldn't \0 take care of everything? which brings me to ask another question. If I declared an array of bytes say array[100] but then only needed to fill the first fifty. Do I need a NULL character like in a string? If yes how would I set it. If no, why not?
I didn't make myself clear. If you are using the array of bytes as a null-terminated cstring:
strcpy(r1,"This is a string");
Then terminating at the "zero'th" position will clear out the string. For example, if you said:
strcpy(r1,"0123456789 This is a string");
r1[15] = 0;
printf("%s\n", r1);
The output would be "0123456789 This "
If you then dumped the first 20 bytes of r1:
for(int i = 0; i < 20; i++)
{
printf("0x%02X ", r1[i]);
}
You would get something like:
0x30 0x31 0x32 ... 0x39 0x20 0x54 0x68 0x69 0x73 0x00 0x69 0x73 ...
That's the convention for null-terminated cstrings (not to be confused with CString); a 0 terminates the string. If it is just an array of bytes, then 0 is just another value.
|
|
|
|
|
Ok, I see what you're saying now.
|
|
|
|
|
Is there an easy way to put a bitmap in the status bar?
I've been looking into it...and my solution is to derive a class from CStatusBar and then add bitmap functionality manually.
I would think there is an easier way to do this.
john
|
|
|
|
|
Crash Operator wrote:
my solution is to derive a class from CStatusBar
Yeah, and then override virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
Check out the MSDN article Q149407 (HOWTO: How to Display a Bitmap in a CStatusBar Pane)
Hope it helps!
Dylan Boycott Bush Punch GWB
|
|
|
|
|
I am using the following code to get the image drawn on a hidden window.
CBitmap bitmap;
CDC memDC;
memDC.CreateCompatibleDC(NULL);
bitmap.CreateCompatibleBitmap(&memDC, 600,400);
CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
memDC.Rectangle (100,100,300,300);
memDC.Ellipse (100,100,400,400);
memDC.BitBlt(0, 0, 600,400,NULL, 0, 0, SRCCOPY);
and then saving this image as a bitmap file.
But passing NULL in BitBlt (bcz i want to draw images in hidden window) i get the background color of my
image as black.
How to change bgcolor to white.
|
|
|
|
|
I have a list control that uses LVS_OWNERDATA and uses custom draw. When I do a SetItemCountEx to redraw the window, the list erases and repaints causing flicker. Is there any standard way to handle this flicker OR do I have to handle EraseBackgound and do some logic there to erase only the area without items. I will have to paint the background where there are no items.
All this looks like workarounds to me, and I think I am missing something very obvious.
Thomas
My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
modified 29-Aug-18 21:01pm.
|
|
|
|
|
|
I want the list control header to look flat (like with the LVS_NOSORTHEADER), but I want the OnColumnClick notification. Is there a standard way to do it? Or do I have to subclass and implement drawitem?
I would prefer to have the header control drawn using the default code (I do not want to get involved in the font sizing with different dpi screens and such other details), so, if I subclass the header, can I fire the LVN_COLUMNCLICK myself?
My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
modified 29-Aug-18 21:01pm.
|
|
|
|
|
I think you can trap for left mouse clicks on your list control and then do a hit test on the header control. Then you could launch your sort function within the mouse click rather than the looking for the OnColumnClick notification. Like the following:
CHeaderCtrl* header = m_ListCtrl.GetHeaderCtrl();
if (header)
{
CPoint headerPoint = point;
LV_HITTESTINFO hitTestInfo;
header->ScreenToClient(&headerPoint);
hitTestInfo.pt = headerPoint;
::SendMessage(header->m_hWnd, HDM_HITTEST, 0, (LONG)(HD_HITTESTINFO FAR*)(&hitTestInfo));
if (hitTestInfo.iItem >= 0) // User hit a header column
{
// Do sort routine here
}
}
Ron Ward
|
|
|
|
|