Hi
I am developing an app in which I have used a MSComm object. I have opened
the
port, performed the transactions, and then closed the port.
But when I check in the task mamager, the memory being held by the MSComm is
not being released. I am using the SetPortOpen method.
Is there any way of releasing this memory explicitly.
Regards. 4 3453
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.
COleVariant var = MSComm1.GetInpu t();
This makes an extra copy of the data and leaves it lying around.
Instead use this...
COleVariant var;
var.Attach (MSComm1.GetInp ut());
Then you can access the data using SafeArrayAccess Data. Don't forget to use
SafeArrayUnacce ssData for unlocking...
Cheers
Jagadeesh
"AA" <no*@noreply.co m> wrote in message
news:u6******** ******@TK2MSFTN GP10.phx.gbl... Hi I am developing an app in which I have used a MSComm object. I have opened the port, performed the transactions, and then closed the port. But when I check in the task mamager, the memory being held by the MSComm
is not being released. I am using the SetPortOpen method. Is there any way of releasing this memory explicitly. Regards.
Thanks for your immediate help Jagadeesh.
However, please look at my issue below : This code is from MSDN :
MSComm mlComm;
mlComm.SetCommP ort(1);
mlComm.SetInBuf ferSize(1024);
mlComm.SetOutBu fferSize(512);
mlComm.SetSetti ngs("9600,n,8,1 ");
mlComm.SetInput Mode(1);
mlComm.SetRThre shold(0);
mlComm.SetSThre shold(0);
// try catch loop
try
{
m_ctlComm.SetPo rtOpen(TRUE);
}
catch(CExceptio n* e)
{
AfxMessageBox(" Open already. Please check!!. ",MB_ICONST OP);
return FALSE;
}
It is taking around 3.5 MB space, which is not released even after I return
to the main app after closing the port.
Please suggest.
"Jagadeesh VN" <ja*********@ho tmail.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. 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.
COleVariant var = MSComm1.GetInpu t(); This makes an extra copy of the data and leaves it lying around. Instead use this... COleVariant var; var.Attach (MSComm1.GetInp ut());
Then you can access the data using SafeArrayAccess Data. Don't forget to
use SafeArrayUnacce ssData for unlocking...
Cheers Jagadeesh
"AA" <no*@noreply.co m> wrote in message news:u6******** ******@TK2MSFTN GP10.phx.gbl... Hi I am developing an app in which I have used a MSComm object. I have
opened the port, performed the transactions, and then closed the port. But when I check in the task mamager, the memory being held by the
MSComm is not being released. I am using the SetPortOpen method. Is there any way of releasing this memory explicitly. Regards.
I think, its taking some memory for the initialization. Even if you create
another instance of MSComm, then the memory usage wont go up. It happens
only for the first time.
"AAg." <no*@noreply.co m> wrote in message
news:uM******** ******@tk2msftn gp13.phx.gbl... Thanks for your immediate help Jagadeesh. However, please look at my issue below : This code is from MSDN : MSComm mlComm;
mlComm.SetCommP ort(1);
mlComm.SetInBuf ferSize(1024);
mlComm.SetOutBu fferSize(512);
mlComm.SetSetti ngs("9600,n,8,1 ");
mlComm.SetInput Mode(1);
mlComm.SetRThre shold(0);
mlComm.SetSThre shold(0);
// try catch loop
try
{
m_ctlComm.SetPo rtOpen(TRUE);
}
catch(CExceptio n* e)
{
AfxMessageBox(" Open already. Please check!!. ",MB_ICONST OP);
return FALSE;
}
It is taking around 3.5 MB space, which is not released even after I
return to the main app after closing the port.
Please suggest.
"Jagadeesh VN" <ja*********@ho tmail.com> wrote in message news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. 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.
COleVariant var = MSComm1.GetInpu t(); This makes an extra copy of the data and leaves it lying around. Instead use this... COleVariant var; var.Attach (MSComm1.GetInp ut());
Then you can access the data using SafeArrayAccess Data. Don't forget to use SafeArrayUnacce ssData for unlocking...
Cheers Jagadeesh
"AA" <no*@noreply.co m> wrote in message news:u6******** ******@TK2MSFTN GP10.phx.gbl... Hi I am developing an app in which I have used a MSComm object. I have opened the port, performed the transactions, and then closed the port. But when I check in the task mamager, the memory being held by the
MSComm is not being released. I am using the SetPortOpen method. Is there any way of releasing this memory explicitly. Regards.
Hi Jagadeesh
Without the MSComm GetInput also, it is giving the same memory usage.
Can there be any other API or method to explicitly clear this memory?
Regards.
"Jagadeesh VN" <ja*********@ho tmail.com> wrote in message
news:u6******** ******@TK2MSFTN GP11.phx.gbl... I think, its taking some memory for the initialization. Even if you create another instance of MSComm, then the memory usage wont go up. It happens only for the first time.
"AAg." <no*@noreply.co m> wrote in message news:uM******** ******@tk2msftn gp13.phx.gbl... Thanks for your immediate help Jagadeesh. However, please look at my issue below : This code is from MSDN : MSComm mlComm;
mlComm.SetCommP ort(1);
mlComm.SetInBuf ferSize(1024);
mlComm.SetOutBu fferSize(512);
mlComm.SetSetti ngs("9600,n,8,1 ");
mlComm.SetInput Mode(1);
mlComm.SetRThre shold(0);
mlComm.SetSThre shold(0);
// try catch loop
try
{
m_ctlComm.SetPo rtOpen(TRUE);
}
catch(CExceptio n* e)
{
AfxMessageBox(" Open already. Please check!!. ",MB_ICONST OP);
return FALSE;
}
It is taking around 3.5 MB space, which is not released even after I return to the main app after closing the port.
Please suggest.
"Jagadeesh VN" <ja*********@ho tmail.com> wrote in message news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. 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.
COleVariant var = MSComm1.GetInpu t(); This makes an extra copy of the data and leaves it lying around. Instead use this... COleVariant var; var.Attach (MSComm1.GetInp ut());
Then you can access the data using SafeArrayAccess Data. Don't forget
to use SafeArrayUnacce ssData for unlocking...
Cheers Jagadeesh
"AA" <no*@noreply.co m> wrote in message news:u6******** ******@TK2MSFTN GP10.phx.gbl... > Hi > I am developing an app in which I have used a MSComm object. I have opened > the > port, performed the transactions, and then closed the port. > But when I check in the task mamager, the memory being held by the MSComm is > not being released. I am using the SetPortOpen method. > Is there any way of releasing this memory explicitly. > Regards. > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: jinoy |
last post by:
how can i detect an incoming caller's telephone keystroke using modem,
using mscomm or other?
how can i detect an outgoing call using mscomm?
how can i get a caller id using mscomm?
|
by: Peter Krikelis |
last post by:
Hi,
I am trying to develope a User Control Library that
features MScomm control. I test my user control in a test
application. When I run the application I receive the
following:
An unhandled exception of
type 'System.Runtime.InteropServices.COMException'
occurred in axinterop.mscommlib.dll
|
by: morgal |
last post by:
That is one reason I quit using MS custom controls, you
have to buy the license. In VB 6 they give you a try it
license and then you develop a huge application or small
one and find out you don't have rights to use the
control. You have to contact the manufacturer of the
control--MS may not be the manufacturer, in the original
VB 6 docs it told you who to contact. Then you must pay
them what they are asking, some are a one time fee and...
|
by: Barry Martin |
last post by:
I am using an activex control mscomm to control a serial
port in VB.NET. I place the control on the main form and
set its port, baud rate, etc. properties. After creating
a code module that needs to access the serial port, I
cannot seem to be able to access the mscomm control from
within a code module. In VB6 you could use the statement
frmMain.Mscomm1.output = "some data string" in the code
module but this won't work in VB.NET. Does...
|
by: Barry |
last post by:
I am using the mscomm activex control in vb.net. I can
add the control to the toolbar which will allow me to
drop it onto a form. As long as I am in the code space
for that form it works fine. When I try to output some
text to the serial port via AxMscomm1.output = "some
text" within a code module, the compiler says that
AxMscomm1 is not defined. Can anyone tell me how I pass a
reference to the mscomm control located on one form from...
| |
by: Carl Gilbert |
last post by:
Hi
I'm trying to open a vb6 project in vb.net which uses the mscomm component.
When running the vb upgrade wizard in vb.net, an error is raised:
Upgrade failed, unable to load reerenced component
mscomm32.ocx (1.1.0)
You need to install this component before you upgrade the project.
Does anyone know how to install the mscomm component.
|
by: swati2106 |
last post by:
HI,
I have develop a apllication , To store the GPS data in database, for that , to read GPS data I have used the Mscomm port,
In which I create the object of class RS232
n open that port,
n store the data in to one string type variable , msStr
but some time it store the Mscomminput, n some times it stores nothing, but in mscomm.input will have a GPS data,
why it is So?
|
by: cmdolcet69 |
last post by:
I get the following error message when I output to the mscomm:
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in COM.exe
Additional information: Exception from HRESULT: 0x800A1F52.
No one has been able to tell me why this isn't working. I know VB 2003 doesn't have serial control however I need to send this with the mscomm.
It will break at the line : comm1.Output = Packet(i)
|
by: daveman |
last post by:
Hello,
I'm encountering a "Blue Screen of Death" when I try to send data to a bluetooth sensor via a serial port, using the MSCOMM ActiveX object. I was wondering if anyone has any ideas how to fix the problem.
As some background, I am trying to use VB to communicate with a Wi-Tilt bluetooth accelerometer, a sensor which sends data over a COM serial port. I have no problem talking to the device in Hyperterminal; it streams data into...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |