Re: Write a file from binary data

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Paul (paulnospam_at_laberg.com.au)
Date: 01/24/05


Date: Mon, 24 Jan 2005 15:02:44 +1100

I may be missing your point. If I rewrite the code to be:
o = create("microsoft.xmldom")
o.load("c:\temp\test.xml")
oImage = o.selectSingleNode("//IMAGE")
cImg = oImage.nodeTypedValue
strToFile(cSig, "c:\temp\test.bmp")
It still will crash, assigning a variable to oImage.nodeTypedValue converts
it so that vartype() returns "N", and my problem is that the file functions
require a string as a parameter.

"Cyrus Welch" <cywelch@hotmail.com> wrote in message
news:6FYId.14326$wZ2.2315@newssvr13.news.prodigy.com...
> Paul wrote:
> > I have the following:
> > o = create("microsoft.xmldom")
> > o.load("c:\temp\test.xml")
> > oImage = o.selectSingleNode("//IMAGE")
> >
> > oImage.nodeTypedValue now contains a binary image (bitmap) encoded with
> > bin.base64. I need to write this to a file but fputs, fwrite & strToFile
> > take strings as parameters. Is the only way to do this is to create a
> > function in C to write the binary data?
> >
> >
> A variable of type "C" can contain binary data without any problem.



Relevant Pages

  • Re: add string into the file (somewhere in the middle)
    ... i would like to add specific string into some configuration files. ... You should start reading the reference on file functions ... http://www.celticwolf.com/ | Technical Writing ...
    (comp.lang.php)
  • resolved!
    ... # include // for file functions ... # include <string> // string utilities ... char x; int card, val; ... > Mario. ...
    (alt.comp.lang.learn.c-cpp)