K
Ken
Good morning everyone,
I am having a problem closing/disposing of objects created
by using IBM's "amqmdnet.dll" . This dll was written
for .NET by Neil Kolban & IBM. My problem is when I click
the button it creates a IBM.WMQ.PCF.PCFMessageAgent class
object. However ,IBM has not followed best practice so
there is no dispose() to release the memory. Setting the
agent = null; does nothing and when I stop running the
app, I receive a system error box which says:
An unhandled exception of
type 'System.NullReferenceException' occured in
amqmdnet.dll. Additional information:Object Reference not
set to an instance of an object. I am hoping someone has
used this dll and can tell me how to release the object in
code.
Thank You in advance for Your Help,
Ken
P.S. below is the
private void button1_Click(object sender, System.EventArgs
e)
{ string queueManagerName
= "W0445D27";
string[] ProcessNames = new string
[]{""};
try
{
IBM.WMQ.PCF.PCFMessageAgent agent1 = new
IBM.WMQ.PCF.PCFMessageAgent(queueManagerName);
agent1 = null;
}
catch( NullReferenceException ne )
{
Console.WriteLine( "Caught
error: {0}.", ne);
}
catch(IBM.WMQ.MQException eq)
{
Console.WriteLine
("Exception: " + eq.ToString());
}
catch(Exception ex)
{
Console.WriteLine
("Exception: " + ex.ToString());
}
}
I am having a problem closing/disposing of objects created
by using IBM's "amqmdnet.dll" . This dll was written
for .NET by Neil Kolban & IBM. My problem is when I click
the button it creates a IBM.WMQ.PCF.PCFMessageAgent class
object. However ,IBM has not followed best practice so
there is no dispose() to release the memory. Setting the
agent = null; does nothing and when I stop running the
app, I receive a system error box which says:
An unhandled exception of
type 'System.NullReferenceException' occured in
amqmdnet.dll. Additional information:Object Reference not
set to an instance of an object. I am hoping someone has
used this dll and can tell me how to release the object in
code.
Thank You in advance for Your Help,
Ken
P.S. below is the
private void button1_Click(object sender, System.EventArgs
e)
{ string queueManagerName
= "W0445D27";
string[] ProcessNames = new string
[]{""};
try
{
IBM.WMQ.PCF.PCFMessageAgent agent1 = new
IBM.WMQ.PCF.PCFMessageAgent(queueManagerName);
agent1 = null;
}
catch( NullReferenceException ne )
{
Console.WriteLine( "Caught
error: {0}.", ne);
}
catch(IBM.WMQ.MQException eq)
{
Console.WriteLine
("Exception: " + eq.ToString());
}
catch(Exception ex)
{
Console.WriteLine
("Exception: " + ex.ToString());
}
}