|
Maxwell Chen wrote: Me too!
well, I read your replies to the original post and I should say that you tried your best to help him.
Regards,
Vijay.
|
|
|
|
|
hi vijay and all ..i read ur replay and i understood ..in feature i follow surely..i am new in this filed like VC++ ,code project also...
my question is ..
how to create serial no in a file ?
the output of file like this only..
1.
2.
3.
Thanks
raju.k
|
|
|
|
|
raju.k wrote: how to create serial no in a file ?
Several ways exist. One such way is:
FILE *pFile = fopen(..., "w");
fprintf(pFile, "1.\n");
fprintf(pFile, "%d.\n", 2);
int x = 3;
fprintf(pFile, "%d.\n", x);
fclose(pFile);
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
I have a treecontrol containing files and folders as it items.Now i have added drag and drop support to and from explorer to my tree control.Everything is working fine but,when i drag a item from tree control i have created a drag image and assigned it to a pointer variable of CImageList class and using it i have dragged the image during drag.It works well inside the view but whrn the cursor leaves the the view it is getting struct at the border of the view.How can i move the image on to the explorer.I have registered my view as a droptarget.
Thanks
|
|
|
|
|
I think codeproject has an example about drag to Explorer did you see it?
|
|
|
|
|
I am able to drag but image is getting struck at the end of the view.I have reffered Micheal dunn's example.
Thanks
modified on Monday, January 28, 2008 7:14:26 AM
|
|
|
|
|
Hello everyone,
Just want to check whether my understanding is correct,
Both (1) and (2) only covers Windows C++ platform.
1. If there is uncaught exception, destructor is not ensured to be called for active object;
2. All the resources (handles, memory, etc.) for current process will be released when uncaught exception causing process to terminate.
thanks in advance,
George
|
|
|
|
|
For this kind of questions, you can test by yourself with DebugView tool.
Maxwell Chen
|
|
|
|
|
Hi Maxwell,
I have used this tool before, but I do not think it has capability to monitor whether there is resource leak and whether destructor is called or not.
Maybe my knowledge about this tool is limited, and it is appreciated if you could help to give more information.
regards,
George
|
|
|
|
|
George_George wrote: capability to monitor whether there is resource leak
DebugView can. And no special setting is required.
George_George wrote: whether destructor is called or not.
You are the coder. You should trace this by yourself.
Maxwell Chen
|
|
|
|
|
Hi Maxwell,
I have tried to use DebugView to find whether there is memory leak and leaked memory is released finally when process terminates, but there is no output in DebugView. Anything wrong?
int main()
{
char* p = new char [100];
p [0] = 'a';
p [100] = 'z';
return 0;
}
regards,
George
|
|
|
|
|
You have to add the detection utility in your code.
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <ctrdbg.h>
void main()
{
int* p = new int;
_CrtDumpMemoryLeaks();
}
Then DebugView display something when you execute the output program.
Maxwell Chen
|
|
|
|
|
Thanks Maxwell,
I have tested your code and it works!
But I think it has limitation that it could only detect memory leak. How to detect others, like handles and locks? If DebugView could automatically monitor such resources, it will be great!
regards,
George
|
|
|
|
|
George_George wrote: How to detect others, like handles and locks?
There is a Add-In for VC++ called the "Deleaker" for what you want.
Maxwell Chen
|
|
|
|
|
|
Shareware, but you still can use it after expired.
(Don't ask me. I do not use it. I take care of my code by myself.)
Or maybe you would consider to switch to Managed C++ world. Everything is managed. You won't have to worry about leaks.
Maxwell Chen
|
|
|
|
|
Thanks Maxwell,
I am looking forward to a utility from Visual Studio or Microsoft itself, because it is helpful. Do not know whether utilities like Process Explorer has such functions.
regards,
George
|
|
|
|
|
You can use perfmon tool by Microsoft to count handles.
Maxwell Chen
|
|
|
|
|
Thanks Maxwell,
You mean using Handle Count counter of process object? How about number of locks?
regards,
George
|
|
|
|
|
dear all
how to calculate one constant by a multiple array, for example: 6 x 2by3 arrat..how to express by formula, thanks
Li Zhiyuan
5/10/2006
|
|
|
|
|
you have to iterate the multiplication on all the array elements, for instance
double a[2][3];
int i,j;
for (i=0; i<2; i++)
for (j=0; j<3; j++)
a[i][j]= (double)rand()/RAND_MAX;
for (i=0; i<2; i++)
for (j=0; j<3; j++)
a[i][j] = 6.0 * a[i][j];
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.
[my articles]
|
|
|
|
|
Hi friends....
i am trouble with my project to working in handling one text file.I have one file in this file has contains data its all(datas) are created are run time only.
I wanna created the serial numbers on creating run time datas.
Thanks in Advance!!!
Raju.k
raju.k
|
|
|
|
|
Hi Raju,
Tell us what u want to do.
|
|
|
|
|
hi..thanks for ur replay/
i wanna create serial no file...without using keyword
Thanks
Raju.K
raju.k
|
|
|
|
|
Do you mean adding serial numbers to the file names? Such as:
AAA00001.tmp
AAB00002.tmp
ABD00003.tmp
ACF00004.tmp
Maxwell Chen
|
|
|
|