如何在Vb 中像 在VC中使用struct 一样,既能够表示用于表示结构化的数据,又能够作为数据缓冲按着固定的格式写成文件?

解决方案 »

  1.   

    dim s as yourstruct
    s.number1=?
    ...
    open filename for Random as #1
    put #1,1,s
    close #1
      

  2.   

    Private Type TestType
       aa As Integer
       bb As String
       cc As Boolean
    End Typedim ee as testtypeee.aa = 12345
    ee.bb = "abcdef"
    ee.cc = Trueopen "C:\1.txt" for output as #1
         print #1,ee
    close #1
      

  3.   

    to: Cooly(☆回答问题不要分儿☆) 
    如果我想把ee 作为一个void* 的指针传给一个用VC写的dll 中的saveData(void * data, char * filename, int datalen) 该如何做?
      

  4.   

    public declare function saveData Lib "test.dll" (byRef data as testtype,buRef filename as string, byval datalen as integer)
      

  5.   

    public declare function saveData Lib "test.dll" (byRef data as testtype,byRef filename as string, byval datalen as integer)
      

  6.   

    对应的VC code 可以这样写吗?
    struct {
      WORD aa;
      char * bb;
      BOOL cc;
    } ee;
    对吗?