HighTechTalks DotNet Forums  

Need help with C Header file definition to C#

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss Need help with C Header file definition to C# in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Jason
 
Posts: n/a

Default Need help with C Header file definition to C# - 06-22-2007 , 09:21 PM






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 ;


Reply With Quote
  #2  
Old   
Jason
 
Posts: n/a

Default Re: Need help with C Header file definition to C# - 06-26-2007 , 12:30 PM






Come on guys there has to be some brave soul out there who knows how
to do this. Any help would be extremely appreciated.


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.