Hi,
  I'm trying to write a wrapper for H5TB and pfb the code. I'm able to call 
H5TBmake_table but getting a -1 as the result everytime :(. Any help is 
appreciated !

C++ : 
Definition :
[DllImport("hdf5_hldll.dll",
           CharSet=CharSet::Auto,
           CallingConvention=CallingConvention::StdCall)]
extern "C"
herr_t _cdecl H5TBmake_table( [MarshalAs(UnmanagedType::LPStr)]
                                                String^ table_title, 
                                                hid_t loc_id, 

                                                
[MarshalAs(UnmanagedType::LPStr)]
                                                String^ dset_name, 

                                                hsize_t nfields,
                                                const hsize_t nrecords,
                                                size_t type_size,

                                                
[MarshalAs(UnmanagedType::LPArray, ArraySubType=UnmanagedType::LPStr)]
                                                cli::array<String^>^ 
field_names,
                                                
[MarshalAs(UnmanagedType::LPArray)]
                                                array<hsize_t>^ field_offset, 
                                                
[MarshalAs(UnmanagedType::LPArray)]
                                                array<hid_t>^ field_types, 
                                                hsize_t chunk_size, 
                                                void *fill_data,
                                                int compress, 
                                                const void *data );


Signature definition :

namespace HDF5DotNet
{
        generic <class Type>
        herr_t H5TB::MakeTable(
                        String^ title, 
                        H5LocId^ locId, 
                        String^ datasetName,
                        hsize_t fieldsCount,
                        hsize_t recordsCount,
                        size_t typeSize,
                        array<String^>^ fieldNames,
                        array<hsize_t>^ fieldOffsets,
                        array<hid_t>^ fieldTypes,
                        hsize_t chunkSize,
                        H5Array<Type>^ fillData,
                        int compress,
                        H5Array<Type>^ data
                        );
}


Implementation :

namespace HDF5DotNet
{
        generic <class Type>
        herr_t H5TB::MakeTable(
                        String^ title, 
                        H5LocId^ locId, 
                        String^ datasetName,
                        hsize_t fieldsCount,
                        hsize_t recordsCount,
                        size_t typeSize,
                        array<String^>^ fieldNames,
                        array<hsize_t>^ fieldOffsets,
                        array<hid_t>^ fieldTypes,
                        hsize_t chunkSize,
                        H5Array<Type>^ fillData,
                        int compress,
                        H5Array<Type>^ data
                        )
        {
                pin_ptr<Type> _pin_fillData = fillData->getDataAddress();


                void* _fillData = _pin_fillData ;

                pin_ptr<Type> _pin_Data = data->getDataAddress();
                void* _data = _pin_Data;

                for(int i = 0; i < fieldNames->Length; i++)
                        Console::WriteLine( fieldNames[0]->ToString() + 
"------" );

                herr_t err = H5TBmake_table( title, locId->Id, datasetName, 
fieldsCount, recordsCount, typeSize, 
                        fieldNames, fieldOffsets, fieldTypes, chunkSize, 
fillData, compress, data );
                if( err < 0 )
                        Console::WriteLine("Failed creating table");
                return err;
        }
}

Kindly let me know where am I going wrong

Thanks & Regards
Kailash K








This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is 
intended only for the person to whom it is addressed. If you are not the 
intended recipient, you are not authorized to 
read, print, retain, copy, disseminate, distribute, or use this message or any 
part thereof. If you receive this message 
in error, please notify the sender immediately and delete all copies of this 
message.


_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to