[gnome-db] Gda# Tests
- From: Daniel Espinosa <esodan gmail com>
- To: gnome-db-list gnome org
- Cc: Dan Winship <danw novell com>
- Subject: [gnome-db] Gda# Tests
- Date: Mon, 10 Oct 2005 14:57:45 -0500
I'm trying to test the following code:
GLib.Value val = Gda.Value.NewString("Testing GDA#");
Console.WriteLine("GValue: %s",(string) val);
And the code generated by api2-codegen use:
[DllImport("gda-3")]
static extern GLib.Value gda_value_new_string(IntPtr val);
public static GLib.Value NewString(string val) {
IntPtr val_as_native = GLib.Marshaller.StringToPtrGStrdup (val);
GLib.Value raw_ret = gda_value_new_string(val_as_native);
GLib.Value ret = raw_ret;
GLib.Marshaller.Free (val_as_native);
return ret;
}
As I see, it calls the external function gda_value_new_string, and
return a GValue, this is correct; but when I try to print the string
using (string) val, I have the next message:
(./Main.exe:17065): GLib-GObject-CRITICAL **: g_value_get_string:
assertion `G_VALUE_HOLDS_STRING (value)' failed
Then the value is no initiated, any idea?
--
Trabajar, la mejor arma para tu superación
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]