Constant string problem

J

James

I have a problem with a header file which was written in C++ which I
need to implement in C#.

The header file in C++ IS something like this,
........

#ifdef __cplusplus
extern "C" {

void WINAPI _libmain ( long JobNo );
void * WINAPI _getjobfield ( void *vJobRec, short field, short
subfield );

};
#endif

#define JF_CITY 91
#define JF_FLEET_INITIAL 92
#define JF_UFLEET_SELECT 93
#define JF_CARFLEET 94
#define JF_UDISPATCHNUMBER 95
#define JF_MIN_FARE 96
#define JF_EXTRAS 97
#define JF_OFFLOADJOBNO 98
#define JF_NAME 99
........


#define GETJF_NAME( JR ) ( ( char * )_getjobfield ( JR, JF_NAME,
0 ) )
#define GETJF_ACCOUNT( JR ) ( ( char * )_getjobfield ( JR,
JF_ACCOUNT, 0 ) )
#define GETJF_PHONE( JR ) ( ( char * )_getjobfield ( JR,
JF_PHONE, 0 ) )
#define GETJF_CONTACT( JR ) ( ( char * )_getjobfield ( JR,
JF_CONTACT, 0 ) )
......

I need to simulate this behaviour in C#. aS YOU CAN SEE for example I
have defined JF_NAME to be 99.


And also the methods are defined as Macros like,

GETJF_NAME( JR ) to be ( ( char * )_getjobfield ( JR, JF_NAME, 0 ) )
here JF_NAME should refer to 99 and

and JR is the value we are passing in.

Does anyone have an idea how to do this.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top