Jason
6/23/2007 1:21:00 AM
Hi,
I have a c dll which I need to link to from my C# code. I just want
to warn you guys I am not very well versed in C or C++ so any help
would be greatly appreciated.
I wanted to know if the structure I have shown should be modeled as a
Struct or as a Class in C#. Also, since there are callbacks from the
C side, how do I have to maintain my c# objects lifetime ? Finally,
it is the question, of how this struct should look in C#. Again, any
help would be greatly appreciated. Thanks in advance.
#define INTERNAL_USE_ONLY /* For marking fields designated as
internal use only */
typedef struct _ARM_ROUND {
double armr_unit ; /* unit of the rounding operation. eg: 0.125
*/
char armr_target ;
#define TARGET_INDEX 1
#define TARGET_NETRATE 2
#define TARGET_GROSSRATE 3
char armr_method ;
#define METHOD_CEIL 1
#define METHOD_FLOOR 2
#define METHOD_ROUND 3
char *armr_next ; /* to next in link list */
} ARM_ROUND ;
typedef struct _ARMI_INFO {
char *armi_next ; /* Ptr to next armp in linked list
*/
int armi_stage_start_mo ;
int armi_index ;
char armi_index_subname[MAX_INDEXSUBNAME_CHARS+1]; /* LOOKBKnn or
explicit subname */
char armi_amort_type ;
int armi_ntillreset ;
int armi_resetper ;
int armi_paym_ntillreset ;
double armi_init_percap ;
int armi_init_resetper ;
char armi_negam_limit_action ;
double *misc_uservals ;
int *tranche_freqs
double **vindexs
char **class_vsubclasses ; /* the nodes directly under this
class*/
char pibond_issue_description [52] ;
int optrt_nums[OPTR_MAX_TARGETS+1]
INDEX **vindex_info ; /* vector of index info structures */
ARM_ROUND *armi_roundp;
char *grp_fullname ; /* descriptive name of the group */
int ((CALLBACK_PREFIX *script_sym_fcn)(char *, char *, int,
int)); /* optional user callback fcn */
/* internal fields */
INTERNAL_USE_ONLY double armi_subpool_frac ;
INTERNAL_USE_ONLY double armi_subpool_netrate ;
INTERNAL_USE_ONLY double armi_subpool_servrate ;
} ARM_INFO ;