Re: Calling DLL function from C# and char** parameter type
- From: "TomazK" <unknown@xxxxxxx>
- Date: Tue, 15 Jan 2008 18:04:56 +0100
Yes, argc is a count and it doesn't matter if I specify 2 or 0 or any other
number. It's the same in all cases.
regards
Tomaz
"Rudy Velthuis" <newsgroups@xxxxxxxxxxxx> wrote in message
news:xn0fl6q8t8425pr00o@xxxxxxxxxxxxxxxxxxxxx
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)
.
- 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
- Re: Calling DLL function from C# and char** parameter type
- From: Rudy Velthuis
- Calling DLL function from C# and char** parameter type
- Prev by Date: COM+ versioning
- Next by Date: TransactionScope using
- 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):
Loading