473,396 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Memory leakage !!

I have placed MS comm control on Test dialog, While initiate the dialog it
is occupying around 2MB space, I am unable to free this space. I am giving
the snippets of the code.

MSComm m_ctlComm;

m_ctlComm.SetCommPort(1);

m_ctlComm.SetInBufferSize(1024);

m_ctlComm.SetOutBufferSize(512);

m_ctlComm.SetSettings("9600,n,8,1");

m_ctlComm.SetInputMode(1);//0 - Text and 1 - Binary.

m_ctlComm.SetRThreshold(0);// To Raise OnCommEvent() method.

m_ctlComm.SetSThreshold(0);

try

{

m_ctlComm.SetPortOpen(TRUE);

}

catch(CException* e)

{

AfxMessageBox("Port is already open. ",MB_ICONSTOP);

return FALSE;

}

After executing this code, it was occupying aroung 2MB space, and I am
unable to release this space, even after closing the dialog in SDI
application. Can you help me to release these memory?

Thanks in advance,
Nov 17 '05 #1
1 1123
I have read somewhere about MSComm control creating an extra copy of data
when GetInput(...) is invoked, and that can be solved by using Attach method
of COleVariant.

"Sirria" <me@me.com> wrote in message
news:OM**************@TK2MSFTNGP12.phx.gbl...
I have placed MS comm control on Test dialog, While initiate the dialog it
is occupying around 2MB space, I am unable to free this space. I am giving
the snippets of the code.

MSComm m_ctlComm;

m_ctlComm.SetCommPort(1);

m_ctlComm.SetInBufferSize(1024);

m_ctlComm.SetOutBufferSize(512);

m_ctlComm.SetSettings("9600,n,8,1");

m_ctlComm.SetInputMode(1);//0 - Text and 1 - Binary.

m_ctlComm.SetRThreshold(0);// To Raise OnCommEvent() method.

m_ctlComm.SetSThreshold(0);

try

{

m_ctlComm.SetPortOpen(TRUE);

}

catch(CException* e)

{

AfxMessageBox("Port is already open. ",MB_ICONSTOP);

return FALSE;

}

After executing this code, it was occupying aroung 2MB space, and I am
unable to release this space, even after closing the dialog in SDI
application. Can you help me to release these memory?

Thanks in advance,

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: frustrated | last post by:
Before I begin, I must first make the following disclaimer: Although I have considerable programming experience, I do not consider myself by any means to be an expert C++ programmer. The following...
2
by: Sambucus | last post by:
Hi group! I am using C++ and java with JNI to get some text in a RICHEDIT to my java program. I do so by accessing a C++ method every second. It all works fine except that it leaks memory every...
7
by: andylcx | last post by:
hi all: I have a code like below, is there any serious memory leakage in my code. I am confusion now but no idea how to fix it. In the member function of class A, I create a new object of class B...
10
by: s.subbarayan | last post by:
Dear all, I happen to come across this exciting inspiring article regarding memory leaks in this website: http://www.embedded.com/story/OEG20020222S0026 In this article the author mentions:...
18
by: Ramasubbu Ramasubramanian XR (AS/EAB) | last post by:
What is memory leakage, could any one explain with sample code
1
by: Gaël | last post by:
Hi everybody! I have a really big problem with ASP.NET application. I noticed that the w3wp.exe memory size, increase with the time and the use of my website. When it raise a certain value, w3wp...
0
by: kiran kumar | last post by:
Hi All, I am working on embedded python on C these days. I feel there is a memory leakage in this code. I have used our own memory pool and all the python code will use the heap from this memory...
14
by: madhawi | last post by:
i want to know that on what situation memory leakage happan and what is the solution to solve the problem of memory leakage.
3
by: Godzilla | last post by:
Hello, I have a program that create and pop an object off a queue, but it is experiencing some memory leakage. I have been unable to detect where the memory leakage occur. The strange thing is...
11
by: prpradip | last post by:
I have an ImageList (_imageList). In _imageList I have put large numbers of Icons. Now what I need is to get Handle of all Icons that I put in _imageList, so that I can destroy (DestoryIcon) them...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.