Private declare sub make lib "makebar. dll "_
(Ucdata as byte, byval nlen as long, byval szfilename as string, byval nclumn as long, byval nerr as long, byval nhlratio as long)
Dim A () as byte
A = strconv (text1.text, vbfromunicode)
Make a (0), ubound (a)-lbound (A) + 1, "abc.bmp", clng (text2.text), clng (text3.text), clng (text4.text)
C #
[Dllimport ("makebar. dll", entrypoint = "make")]
Private Static extern void make (ref byte ucdata, long nlen, string szfilename, long nclumn, long nerr, long nhlratio );
Byte [] A = system. Text. encoding. utf8.getbytes (text1.text );
Make (Ref A [0], A. length, "abc.bmp", long. parse (text2.text), long. parse (text3.text), long. parse (text4.text );
I am not very sure about the ref parameter. In the old VB, if byval is not written, it is byref, but it seems that in C #, ref can only pass simple variables, such as A, and "A [0]" cannot be passed by Ref. If a [0] does not need to be changed after the process, remove the two ref.