[MonoDevelop] Hex editor as a widget for my application?

Tom Spink tspink at gmail.com
Mon Aug 30 17:44:31 EDT 2010


Hi Rampage,

Firstly, I take it you are initialising the byte array with data?

Also, the constructor of a memory stream accepts a byte array as a parameter:

///
var memStream = new MemoryStream(myByteArray);
///

Try using that, to see if it makes a difference.

-- Spink.

On 30 August 2010 22:32, Rampage <atomikramp at email.it> wrote:
> Rampage ha scritto:
>> Abe Gillespie ha scritto:
>>
>>> Make sure you're building against the latest Mono assembly versions.
>>> Do this by right-clicking your project > Options > Build > Runtime
>>> version > <select the highest Mono / .NET profile>
>>>
>>> If that doesn't work then you probably need a newer Mono and MonoDevelop.
>>>
>>> -Abe
>>>
>>> On Mon, Aug 30, 2010 at 11:37 AM, Rampage <atomikramp at email.it> wrote:
>>>
>>>
>>
>> Oh yeah, now it works, thank you very much, now i need some api doc on
>> how to use it.. is there anything on the mono documentation?
>>
>> thanks
>>
>> Francesco
>>
> Ok, here we go, i've managed to understand (probably) how to load stuff
> into the hex editor widget.
>
> but i have a problem:
> if i do:
>
> using Mono.MHex;
> using Mono.MHex.Data;
> using Mono.MHex.Rendering;
> ........
> ................
>
> HexEditor he = new HexEditor();
> HexEditor.HexEditorData.Buffer = ArrayBuffer.Load("filename.ext");
> he.show();
>
> the hex editor widget is displayed correctly with the content from the file
>
> if instead i use the other overload for the Load method that accepts a
> stream like this:
>
> byte[] mybytearray = new byte[10]
> MemoryStream memstream = new MemoryStream();
> memstream.write(mybytearray, 0 mybytearray.Lenght);
>
> HexEditor he = new HexEditor();
> HexEditor.HexEditorData.Buffer = ArrayBuffer.Load(memstream);
> he.show();
>
> the widget is showed up, it looks like it's containing data couse its
> lenght is right according to the size of the stream
> but it's all filled with 00 instead of the stream data.
>
> am i doing something wrong?
>
> Thanks again for your support
> Best regards
> Francesco.
> _______________________________________________
> Monodevelop-list mailing list
> Monodevelop-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monodevelop-list
>


More information about the Monodevelop-list mailing list