Re: Calling DLL function from C# and char** parameter type
- From: "Rudy Velthuis" <newsgroups@xxxxxxxxxxxx>
- Date: Mon, 14 Jan 2008 10:26:59 -0800
TomazK wrote:
[DllImport("libmysqld.dll")]
private static extern int mysql_server_init(int argc, string[] argv,
string[] groups);
{
string[] argv = new string[1];
argv[0] = "mysql_test";
string[] groups = new string[2];
groups[0] = "libmysqd_server";
groups[1] = "libmysqd_client";
mysql_server_init(0, argv, groups);
}
Assuming that argc is an argument count, it should probably not be 0,
and assuming that to each arg there is a group, you should probably
have argc=2, and also have two (2)strings in each array:
{
string[] argv = new string[2];
argv[0] = "mysql_test";
argv[1] = argv[0];
string[] groups = new string[2];
groups[0] = "libmysqd_server";
groups[1] = "libmysqd_client";
mysql_server_init(2, argv, groups);
}
Of course, I have no idea which strings are valid. Try to convert a C
or C++ example, if you have one, to C#.
--
Rudy Velthuis http://rvelthuis.de
"The object of war is not to die for your country but to make
the other *** die for his."
-- General George Patton (1885-1945)
.
- Follow-Ups:
- References:
- Calling DLL function from C# and char** parameter type
- From: Siol
- Re: Calling DLL function from C# and char** parameter type
- From: Tomaz Koritnik
- Re: Calling DLL function from C# and char** parameter type
- From: Rudy Velthuis
- Re: Calling DLL function from C# and char** parameter type
- From: TomazK
- Calling DLL function from C# and char** parameter type
- Prev by Date: Re: DataGridView + DataTable Speed
- Next by Date: Resume Exception After Handling Exception in C#
- Previous by thread: Re: Calling DLL function from C# and char** parameter type
- Next by thread: Re: Calling DLL function from C# and char** parameter type
- Index(es):