Home > Net >  Code written questions?
Code written questions?

Time:09-16

 
# pragma once

Typedef signed __int8 INT8S;
Typedef unsigned __int8 INT8U;
Typedef signed __int16 INT16S;
Typedef unsigned __int16 INT16U;
Typedef signed __int32 INT32S;
Typedef unsigned __int32 INT32U;
Typedef signed __int64 INT64S;
Typedef unsigned __int64 INT64U;
Typedef signed __int32 BOOL32.
Typedef unsigned __int32 HANDLE32;
Typedef unsigned __int64 HANDLE64;

# define _STDCALL_

# ifdef _STDCALL_
# define EXPORT_MODE __stdcall
# the else
# define EXPORT_MODE __cdecl
# endif


# ifdef FMSHDLL_EXPORTS
# define FMSHDLL_API _declspec (dllexport)
# the else
# define FMSHDLL_API _declspec (dllimport)
# endif

Typedef INT32S (EXPORT_MODE * TagCallbackFunction) (INT32S handle, char * PCstr, INT32U PCstrLength, char * EPCstr, INT32U EPCstrLength, char * RSSIstr, INT32U RSSIstrLength);

FMSHDLL_API INT32S EXPORT_MODE SearchAndOpenReader (char * readeruniqueId, INT32U * rlen, INT32S & amp; Handle);


This code is written VC6, could you tell me how to write c # language

CodePudding user response:

Suggested that the next pinvoke generation tools (pinvoke Signature Toolkit)

I'm home isolation, too lazy to install, manual translation, not guarantee right,

INT32S -- -- -- -- -- - a signed int32 -- -- -- -- -- -- -- int32
Char * readeruniqueId -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- stringBuiler
INT32U * -- -- -- -- -- -- -- an unsigned ini32, out parameters -- -- -- -- -- -- -- -- -- - ref uint32
INT32S & amp; Handle -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- this is a pointer to the callback


Int SearchAndOpenReader (stringBuiler readeruniqueId, ref rlen, inptr callbackPoint)//temporary substitute inptr callback statement first, I am here in translation callback

The delegate int32 TagCallback ( inptr handle , string PCstr, uint PCstrLength, string EPCstr, uint EPCstrLength, string RSSIstr, uint RSSIstrLength)

Finally, on the whole, is
Int SearchAndOpenReader (stringBuiler readeruniqueId, ref rlen, TagCallback callbackPoint)

The scarlet letter part I doubt about what he wants and point, first tone, (of course, if you never delegate not to use it, can be directly, null or inptr. Zero preach the past good, anyway for c + +, spelled the same as the ans, pointer null, zero he decide to do, empty, zero he ignored the ans write judgement as a delegate for null, null ignore)

CodePudding user response:

Int SearchAndOpenReader (stringBuiler readeruniqueId, ref uint rlen, TagCallback callbackPoint)

CodePudding user response:

FMSHDLL_API INT32S EXPORT_MODE SearchAndOpenReader (char * readeruniqueId, INT32U * rlen, INT32S & amp; Handle);
The main is how this sentence written in c #

CodePudding user response:

refer to the second floor qq_36786068 response:
int SearchAndOpenReader (stringBuiler readeruniqueId, ref uint rlen, TagCallback callbackPoint)


This is the

CodePudding user response:

reference 4 floor qq_36786068 response:
Quote: refer to the second floor qq_36786068 response:

Int SearchAndOpenReader (stringBuiler readeruniqueId, ref uint rlen, TagCallback callbackPoint)


This is the

 # define _STDCALL_ 

# ifdef _STDCALL_
# define EXPORT_MODE __stdcall
# the else
# define EXPORT_MODE __cdecl
# endif


# ifdef FMSHDLL_EXPORTS
# define FMSHDLL_API _declspec (dllexport)
# the else
# define FMSHDLL_API _declspec (dllimport)
# endif
what is the meaning of this code, how to write in c #?

CodePudding user response:

# define _STDCALL_

# ifdef _STDCALL_
# define EXPORT_MODE __stdcall
# the else
# define EXPORT_MODE __cdecl
# endif


# ifdef FMSHDLL_EXPORTS
# define FMSHDLL_API _declspec (dllexport)
# the else
# define FMSHDLL_API _declspec (dllimport)
# endif

These don't have to write, it is macro statement has nothing to do with c #, just some of the definition of vc editors compile time to let him know, the brothers to make the alias for the system type
  •  Tags:  
  • C#
  • Related