.NET/Link: Explicitly define data type to be sent to .NET object?
- To: mathgroup at smc.vnet.net
- Subject: [mg85675] .NET/Link: Explicitly define data type to be sent to .NET object?
- From: heiko <heiko.damerau.news at web.de>
- Date: Tue, 19 Feb 2008 01:53:26 -0500 (EST)
Hello, To get some data from Mathematica to a .NET object, I need to avoid confusion between different integer or real data types in Mathematica and C++. Is it somehow possible to explicitly define the type of a variable being sent from Mathematica to C++? Some more detailed description of the problem: The .NET object contains several overloaded methods for different data types, e.g. void insert(SByte value), void insert(Int16 value), void insert(Int32 value), void insert(Int64 value), etc. When I now send integer data from Mathematica to the object using object at insert[...] the data is apparently always sent to the insert(Int64 value) method; even if the integer in Mathematica only contains a value from 0 to 255. This is, however, not the method I need to call, but e.g. void insert(SByte value). As I haven't written the .NET library myself, I cannot just change the names of the methods inside. How can I tell .NET/Link in Mathematica that I want the integer/ real data in Mathematica to be transferred to a specific integer or real data type in C++? Thanks a lot in advance for any help! Best regards, Heiko