Memory Stream?

Pages: 12
Does anyone have a tutorial on Win32 Memory Stream?

Thanks
No he doesn't, and it's obvious, he means the Windows API .NET Framework's memory stream, as in System::IO::MemoryStream.

I couldn't find a tutorial, but MSDN has a reference:
http://msdn.microsoft.com/en-us/library/system.io.memorystream.aspx


-Albatross
Last edited on
Obviously, I know what he meant. I was kindly redirecting him to something more standard that does pretty much the same job.
closed account (z05DSL3A)
System::IO::MemoryStream is part of the .NET Framework Class Library not Windows API.
If I were to walk into an auto parts store and ask for an ASE lug nut and the guy behind the counter offered me a metric one, as it is more standard and does pretty much the same job, I would complain to the management and probably not shop there anymore.
I don't care about that, you can do what you want. Your lug nut choice won't affect the portability of the code you write in any way.
m4ster r0shi, how hard was it to write "Here's a reference for System::IO::MemoryStream, but I'd advise you to use stringstream instead, as it is a standard solution that does more or less the same thing: *link1* *link2*"? Hmm?

-Albatross
I wanted to leave that to you since you like posting so much ;D
I've actually been relatively inactive recently due to a large project, but that's not the point. Anyways, it's not that hard. If you didn't beat me, I'd give the ASE lug nut but also suggest that the buyer maybe use the metric lug nut instead, as it is standard and a more cross-mechanic solution. It's a win-win solution, because the OP gets to learn about what is standard, and I won't get a call from Duoas. The least you could have gotten out of it was a slightly improved typing speed.

That said, it really is usually a better idea to use a standard solution in place of a non-standard and not cross-platform one, indeed.

-Albatross
Last edited on
Albatross wrote:
I've actually been relatively inactive recently due to a large project

What is this project about?
Last edited on
Actually, it's a compiler for an OO multi-paradigm language. I have all the semantics and grammar down, and a small standard library as well.

I'm pretty sure I used stringstream several times there...

-Albatross
Nice!

Albatross wrote:
I'm pretty sure I used stringstream several times there...

Hahahaha, in your face Duoas :D
All that is a straw man argument.

The OP asked for information on the System::IO::MemoryStream class.
My car only takes ASE lug nuts.

It does not matter how useful, superior, l33t, mega-awesome, etc anything else is. Giving me a metric lug nut won't hold the wheels on my car. Giving the OP a non-answer doesn't help him use System::IO::MemoryStream.

No matter what you think of the rightness or wrongness of using it over std::stringstream means nothing to him when he asks for information on System::IO::MemoryStream.

Huff and puff all you like. Albatross's second response is correct.
Duoas wrote:
My car only takes ASE lug nuts.

But stringstream can be used in every c++ program you make, not only in the ones requiring NET framework support...

Duoas wrote:
Giving me a metric lug nut won't hold the wheels on my car.

I suppose what you mean here is that maybe the OP is working on a big Windows project and in this context it makes much more sense to use MemoryStream over stringstream because it interacts better with the other parts of his project (that happen to also be members of the NET framework class library). Yes, maybe MemoryStream is preferable in this case (but this definitely doesn't mean that stringstream won't work!). But, well, since the OP did not complain I suppose this isn't the case, and he found stringstream rather useful...

Duoas wrote:
Huff and puff all you like.

You're the one who's doing that... -.-
Albatross wrote:
Actually, it's a compiler for an OO multi-paradigm language. I have all the semantics and grammar down, and a small standard library as well.


That's a big claim. How many people are on the project? Is it in C++?
moorecm wrote:
That's a big claim. How many people are on the project? Is it in C++?


Indeed, 1, and yes. Okay, I'm using GAS Assembly as an intermediate language, and the whole compiler is a front end to the GNU project's Binutils, so that saves me some work. I don't want to have to deal with the smaller portability issues.

m4ster r0shi wrote:
But, well, since the OP did not complain I suppose this isn't the case, and he found stringstream rather useful...


He/she posted only once before you wrote that... how did he/she communicate to you that he/she found stringstream useful and why would he/she communicate to you that way as opposed to a post here?

-Albatross
Last edited on
I'm just making a fair assumption.
closed account (z05DSL3A)
No matter what you think of the rightness or wrongness of using it over std::stringstream means nothing to him when he asks for information on System::IO::MemoryStream.

The OP asked; Does anyone have a tutorial on Win32 Memory Stream?
I would say that it is quite reasonable to raise varying options in reply to this question. I will admit that std::stringstream would not have been one of them from me, but also neither would System::IO::MemoryStream unless the OP had given any hint of using .net.

The first thing that I thought about, in respect to the question, apart from its vagueness, was to do with the IStream [1] interface and CreateStreamOnHGlobal()[2]

[1] http://msdn.microsoft.com/en-us/library/aa380034(VS.85).aspx
[2] http://msdn.microsoft.com/en-us/library/aa378980(VS.85).aspx
Hey, Albatross, I've been wondering... Say, in this compiler you make, are arrays passed in functions by value or by reference, by default? :D
Pages: 12