I'm having difficulty figuring out a simple way to dump unmanaged structure
and/or class data to binary files.
In standard C++:
--------------------------
typedef struct tagS1
{
DWORD dwBlah;
CHAR szBlah[64];
} S1;
...
S1 s1;
FILE *fd = fopen ("c:\....", "wb");
fwrite (&s1, sizeof(s1), 1, fd);
fclose (fd);
--------------------------
I really don't want to have to move a ton of pre-defined structures to
managed code and use BinaryFormatters, pad my strings, etc.
I attempted to use fwrite in managed c++, but it appears to cause an error
in the internal file-locking mechanism.
Ultimately, I'm hoping to take advantage of some of the managed set,
especially easy GUI creation, but I need some pure-C++ functionality (such
as what's described above). Doesn't managed C++ support the standard C++
libraries? If not, isn't that contrary to it's purpose?
Any info or advice would be GREATLY appreciated :)
I'd like to harness some of the ease of the .net framework (better than
MFC), but without losing the ability to write regular old C++. Is it even
possible?

Signature
Bill Merrill
Lead Developer
Merchant Companion
Ronald Laeremans [MSFT] - 07 Oct 2004 09:59 GMT
There is no reason that I know off that fwrite should not work identically.
Do you have a small repro case you could share?
Ronald Laeremans
Visual C++ team
> I'm having difficulty figuring out a simple way to dump unmanaged
> structure
[quoted text clipped - 35 lines]
> MFC), but without losing the ability to write regular old C++. Is it even
> possible?
The unProfessional - 08 Oct 2004 20:35 GMT
Hi Ronald,
Thanks alot for your time.
I'll put together a quick example and send it on over... Should I email you
directly?
Sincerely,
Bill
> There is no reason that I know off that fwrite should not work identically.
> Do you have a small repro case you could share?
[quoted text clipped - 41 lines]
> > MFC), but without losing the ability to write regular old C++. Is it even
> > possible?
Ronald Laeremans [MSFT] - 09 Oct 2004 01:12 GMT
Yes, you can mail me. The obvious transformation of my posting alias is my
real MS email address.
Ronald
> Hi Ronald,
>
[quoted text clipped - 57 lines]
> even
>> > possible?