Author Topic: readstream and writestream use "ADODB.stream"  (Read 3086 times)

0 Members and 1 Guest are viewing this topic.

aicr317

  • Guest
readstream and writestream use "ADODB.stream"
« on: January 23, 2010, 01:25:56 PM »
;;;;;;read file
;;;USE "ADODB.STREAM" TO READ [BINDATA],THEN USE "vlax-safearray->list" AND "vlax-variant-value" turn TO [TEXTDATA]


(defun yad-rstream(file / stream rtn)
  (setq stream (vlax-get-or-create-object "ADODB.stream"))
  (vlax-put-property stream 'type 1)
  (vlax-invoke stream 'open)
  (vlax-invoke-method stream 'loadfromfile file)
  (vlax-put-property stream 'position 0)
  (setq rtn (vlax-safearray->list (vlax-variant-value (vlax-invoke-method stream 'read (vlax-get stream 'size)))))
  (vlax-release-object stream)
  rtn
)




but when i use "vlax-safearray-fill" and "vlax-make-safearray" turn [textdata] to [bindata], and use "write" /"savetofile" with "ADODB.tream" ,it is also has something wrong....

who can help me finish the "yad-wstream" function,thank you!

Lee Mac

  • Seagull
  • Posts: 12726
  • London, England
Re: readstream and writestream use "ADODB.stream"
« Reply #1 on: January 23, 2010, 01:30:32 PM »

aicr317

  • Guest
Re: readstream and writestream use "ADODB.stream"
« Reply #2 on: January 23, 2010, 01:39:40 PM »
Perhaps this will help you:

http://www.theswamp.org/index.php?topic=17465.0

I AM AFRAID,THE LINKS WHICH YOU OFFERED,I HAD READ IT LONG AGO,IT CAN NOT HELP WITH MY TEST,PERHAPS THE XP EN OS IS SOMETHING DIFFERENT TO CHINESE OS !

YOU CAN LOOK THIS
http://www.theswamp.org/index.php?topic=31521.0