Re: Mime type woes in beagle

And as I sent this, I realized i should be more explicit. Here you go.

instead of just calling:

gnome_vfs_mime_type_from_name_or_default you need to use:

[DllImport ("libgnomevfs-2")] extern static IntPtr gnome_vfs_mime_type_from_name_or_default (string filename, string defaultv);

string GetMimeType (string filename, string default)
return GLib.Marshaller.PtrToStringGFree (gnome_vfs_mime_type_from_name_or_default (filename, default));

That should help you out.

Note: GLib.Marshaller is in glib-sharp.dll, so you will have to compile against it.

Todd Berman wrote:
You are getting memory corruption because of the string marshalling.

If you look at how gtk#, MD, etc do string marshalling (MD even has an example from gnome_vfs) you will see how to fix it.

Basically marshalling the string like that is just not gonna work :)


Michael Levy wrote:

I would agree that it looks like memory corruption. Maybe I should try
to send this to another list such as one of the mono lists?


On Wed, Jun 16, 2004 at 12:34:11AM -0500, Jon Trowbridge wrote:

On Sat, 2004-06-12 at 23:44 +0200, Michael Levy wrote:

Unfortunately, I get some strange behaviour. I've written
a small test to demonstrate.

I also get strange behavior, but it seems to be different strange
behavior.  I get weird behavior if I put more than one file on the
command line, or put something on the command line that ends with /.
Maybe some sort of memory corruption?


Dashboard-hackers mailing list
Dashboard-hackers gnome org

Dashboard-hackers mailing list
Dashboard-hackers gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]