Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

error using dispose function

Hi all,
 
I'm having a problem, and i will try to explain it here, hope anyone can help me any further.
I'm developing a program with the microsoft visual C++ express edition (version 2005).
in my application, i would like to be able to make a connection to a device by TCPIP (ethernet) and when i push a button, i want to close the connection. the first thing, making a connection, works, but when i try to close the messagebasedsession
(by using mbSession->Dispose(); ) i get an error:
Error 1 error C2039: 'Dispose' : is not a member of 'NationalInstruments::VisaNS::MessageBasedSession' c:\hirschmann\visual c++\fsl communication\Form1.h 328
anyone knows how i should fix this ?
 
Greatings, Hans
0 Kudos
Message 1 of 3
(7,498 Views)

*kick*

does anyone know what I'm doing wrong?
the error occurures when i use this command:

mbSession->Dispose();

0 Kudos
Message 2 of 3
(7,460 Views)

Hi Hanzz,

See the following document on the Microsoft MSDN Library regarding this Compiler error:

 
At the bottem of this document it indicates the same error you are having with the Dispose function. You could replace the:

mbSession->Dispose();

with

delete mbSession;

This will also dispose the object, if it was create with the object with new / gcnew.

Hope this helps,

Regards

Karsten

Message Edited by KvZ on 10-24-2007 10:08 AM

0 Kudos
Message 3 of 3
(7,448 Views)