|
I believe that you should call CString::ReleaseBuffer after having used CString::GetBuffer (Check in MSDN for confirmation) Of course it has nothing to do with files, and I don't know if this may cause the loss of handle resource you are talking about. Actually I don't know what happens really when one forgets to call CString::ReleaseBuffer (memory leak ?) Maybe someone can help overthere ?
|
|
|
|
|
Thank you for your reply.
I have tried to use ReleaseBuffer but no luck. I think that ReleaseBuffer it might cause memory leaks (as you have mentioned) but is not related with the continuously growing of handles - which is the my main problem.
Anything else that I can try.
Thank you.
|
|
|
|
|
For what you are doing, GetBuffer() is not necessary. Remove it.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
micutzu wrote:
Anyone has any idea how I can solve this issue?
What makes you think there is an issue? How do you know that the handle count is not simply a high-water mark?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Well I am using the handle.exe utility from Sysinternals in order to track applications performances and handle usage seems an extremely important issue for me.
Here is a sample of the log generated by handle.exe
748: File C:\samples\Logs<br />
74C: File C:\samples\Logs<br />
750: File C:\samples\Logs<br />
754: File C:\samples\Logs<br />
758: File C:\samples\Logs<br />
75C: File C:\samples\Logs<br />
760: File C:\samples\Logs<br />
764: File C:\samples\Logs<br />
768: File C:\samples\Logs<br />
76C: File C:\samples\Logs<br />
770: File C:\samples\Logs<br />
774: File C:\samples\Logs<br />
778: File C:\samples\Logs<br />
77C: File C:\samples\Logs<br />
780: File C:\samples\Logs<br />
784: File C:\samples\Logs<br />
788: File C:\samples\Logs<br />
78C: File C:\samples\Logs<br />
790: File C:\samples\Logs<br />
794: File C:\samples\Logs<br />
798: File C:\samples\Logs
And since the logging operation is done each second than the amount of extra handles per minute is 60. Considering this I thing that the handle count is an issue.
Thank you for your comments.
|
|
|
|
|
Hi,
I want to display a grpah in a dialog according to the data input from user. A two cordinate graph with markings at specific points according to user's input.
Which way to go ?? ActiveX ??
- KK
- KK
|
|
|
|
|
|
hiho@ll
i try to prog an updateclient, which gets updates from a server
i want this client to be as generous as possible
that means it should work for nearly every programm
to do this i thought about, calling my update client
the updateclient checks who called it, kills the app, updates the app, starts the app again, and shutdown itself
my problem is:
how does the client knows who started him?
how can the client kill the mother app?
how can the client know which file to execute, to start the app?
i could all do this with command line parameters, but is there a "windows" way to do this?
thx@ll
|
|
|
|
|
Came accross this [^] article, don't know how good is it.
suhredayan There is no spoon.
|
|
|
|
|
Hi to All,
I want some help from anybody. I am working on a client server application; the requirement is like this: the client application should have a look & feel of MSN messenger. I mean, I want to create the dialogue or the tab-buttons as we are seeing in MSN messenger. But, I am confused whether I can use vc++ for the same or not, or do I need to use .net. & Also the application should be easily downloadable; I mean the size of the application should be less.
I want some suggestions on the same. Is MSN user interface is built with VC++ or any other language? Thanks in advance
|
|
|
|
|
kalicharan wrote:
or do I need to use .net. & Also the application should be easily downloadable
if you use .net then you application will be windows nt specific!
kalicharan wrote:
I want to create the dialogue or the tab-buttons as we are seeing in MSN messenger
you have to skin your control, there are dozens of example on cp relating to it!
here,
http://www.codeproject.com/dialog/[^]
kalicharan wrote:
Is MSN user interface is built with VC++ or any other language? Thanks in advance
yeah you can try vb for building UI fast!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Would somebody help me please do something in c++ step by step ?
I want to get info. of currently active application: pid and name
By active i don't mean the same application that wants to know
the info.
Example:
from my application i want to know if notepad is currently active
and somebody is writing txt..
REPORT
1/we have wo running applications = myapp and notepad
2/alt tab to myapp
3/status report in my application = myapp is focused
4/alt tab to notepad
5/status report in my application = notepad is focused
6/writing text in notepad
7/status report in my application = notepad is focused
8/status report in my application = event key pressed
|
|
|
|
|
This may help:
[GetForegroundWindow ]for getting handle of application which currently have Keyboard focus
[GetWindowText ] retrieve the Caption Text associated with Windows handle
[GetWindowModuleFileName ] return with the path of application!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I think u will have to use hooks.
Try this link http://www.codeproject.com/dll/hooks.asp
|
|
|
|
|
thx maybe this would help.....just wait me to code some stuff and post reply my result
thx again
Always willing to participate in coding new projects. C++. Multimedia, graphics and hardware.
|
|
|
|
|
I've engaged in a project with the function of displaying DOC and PPT files.
It means that my program can display DOC and PPT files without displaying the menus and toolbars of the MS Office, how can I get it done.
I searched a lot of documents about the Office Automation,but I found none suitable for me.
Thanks for you help!
|
|
|
|
|
You can view doc and ppt files in a webbrowser. Maybe that could be a solution?
Good luck.
No hurries, no worries.
|
|
|
|
|
Look up Active Documents in Google and checkout the MS Binder application.
There should even be a couple of articles on CodeProject that talk about the subject.
"Live long and prosper." - Spock
|
|
|
|
|
Can somebody help me to modify the following program ??
#include iostream
#include cstdlib
#include ctime
#include conio.h
using namespace std;
#define MAX 15 // MAXIMUM CONTENTS IN QUEUE
class queue
{
private:
int t[MAX];
int added; // Addition End
int deleted; // Deletion End
public:
queue()
{
deleted = -1;
added = -1;
}
void del()
{
int tmp;
if ( deleted == -1 )
{
cout << "Queue is Empty";
}
else
{
for ( int j = 0 ; j <= added ; j++ )
{
if( ( j + 1 ) <= added )
{
tmp = t[j + 1];
t[j] = tmp;
}
else
{
added--;
if ( added == -1 )
{
deleted = -1;
}
else
{
deleted = 0;
}
}
}
}
}
void add( int item )
{
if( deleted == -1 && added == -1 )
{
deleted++;
added++;
}
else
{
added++;
if( added == MAX )
{
cout << "Queue is Full\n";
added--;
return;
}
}
t[added] = item;
}
void display()
{
if ( deleted != -1 )
{
for ( int i = 0 ; i <= added ; i++ )
cout << t[i] << " ";
}
else
cout << "EMPTY";
}
};
void main()
{
queue a;
int data[10] = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 };
int n , passCode;
do
{
srand(time(0));
n = rand();
passCode = n % ( ( data[9] - data[0] + 1 ) + data[0] );
cout << "Queue : ";
a.add( data[passCode] );
a.display();
cout << endl;
cout << "At Counter : ";
a.display();
cout << endl;
cout << "Transaction Time Left : " << endl;
cout << "Press ENTER to simulate 1 minute." << endl << endl;
}
while ( cin.get() );
}
|
|
|
|
|
|
Actually my question is following ::
a customer enter a bank and have to queue every 2 minute, a random number generator generate a random number between 1 .... 10, each customer is associated with a random number which indicates the time needed for all his/her transaction to be completed.
use an array to implement the queue .
thanks for your help!!
|
|
|
|
|
khyap wrote:
Actually my question is following ::
I don't see any questions in your post !
In fact you are asking to do your homework for you isn't it ?
If you want any chance to have response to your questions, start it by yourself and post SPECIFIC questions when you get stuck. Don't ask us to do everything for you.
|
|
|
|
|
My question is below , but i don't know whether my solution is correct or not ??
a customer enter a bank and have to queue every 2 minute, a random number generator generate a random number between 1 .... 10, each customer is associated with a random number which indicates the time needed for all his/her transaction to be completed.
use an array to implement the queue .
#include iostream
#include cstdlib
#include ctime
#include conio.h
using namespace std;
#define MAX 15 // MAXIMUM CONTENTS IN QUEUE
class queue
{
private:
int t[MAX];
int added; // Addition End
int deleted; // Deletion End
public:
queue()
{
deleted = -1;
added = -1;
}
void del()
{
int tmp;
if ( deleted == -1 )
{
cout << "Queue is Empty";
}
else
{
for ( int j = 0 ; j <= added ; j++ )
{
if( ( j + 1 ) <= added )
{
tmp = t[j + 1];
t[j] = tmp;
}
else
{
added--;
if ( added == -1 )
{
deleted = -1;
}
else
{
deleted = 0;
}
}
}
}
}
void add( int item )
{
if( deleted == -1 && added == -1 )
{
deleted++;
added++;
}
else
{
added++;
if( added == MAX )
{
cout << "Queue is Full\n";
added--;
return;
}
}
t[added] = item;
}
void display()
{
if ( deleted != -1 )
{
for ( int i = 0 ; i <= added ; i++ )
cout << t[i] << " ";
}
else
cout << "EMPTY";
}
};
void main()
{
queue a;
int data[10] = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 };
int n , passCode;
do
{
srand(time(0));
n = rand();
passCode = n % ( ( data[9] - data[0] + 1 ) + data[0] );
cout << "Queue : ";
a.add( data[passCode] );
a.display();
cout << endl;
cout << "At Counter : ";
a.display();
cout << endl;
cout << "Transaction Time Left : " << endl;
cout << "Press ENTER to simulate 1 minute." << endl << endl;
}
while ( cin.get() );
}
|
|
|
|
|
I don't know whether my solution is correct or not ??
Why just don't you compile and run your program step by step in debug mode to verify yourselves that everything is correct. This is a simple exercise and you will learn more by trying to debug it yourselves.
However, if you have a specific question about syntax/bug/error/function/etc. in your program, then you can ask here...
Good luck!
|
|
|
|
|
because i do not know whether it meet the question requirement or not ??
how to add only one queue in the "At Counter : " ??
|
|
|
|