Click here to Skip to main content
15,910,980 members
Home / Discussions / C#
   

C#

 
QuestionAnother managed/unmanaged problem Pin
Kasic Slobodan14-Sep-06 15:32
Kasic Slobodan14-Sep-06 15:32 
AnswerRe: Another managed/unmanaged problem Pin
Nader Elshehabi14-Sep-06 15:58
Nader Elshehabi14-Sep-06 15:58 
GeneralRe: Another managed/unmanaged problem Pin
Kasic Slobodan15-Sep-06 1:59
Kasic Slobodan15-Sep-06 1:59 
QuestionRe: Another managed/unmanaged problem Pin
Kasic Slobodan15-Sep-06 7:53
Kasic Slobodan15-Sep-06 7:53 
AnswerRe: Another managed/unmanaged problem Pin
Nader Elshehabi15-Sep-06 12:38
Nader Elshehabi15-Sep-06 12:38 
GeneralRe: Another managed/unmanaged problem Pin
Kasic Slobodan16-Sep-06 1:29
Kasic Slobodan16-Sep-06 1:29 
GeneralRe: Another managed/unmanaged problem Pin
Nader Elshehabi16-Sep-06 1:44
Nader Elshehabi16-Sep-06 1:44 
GeneralRe: Another managed/unmanaged problem [modified] Pin
Kasic Slobodan17-Sep-06 1:12
Kasic Slobodan17-Sep-06 1:12 
My colleague said:

I can’t send data_name as ref StringBuilder because I get some error when function is called and it works fine if I use char []data_name so please don’t focuse on that.
[MarshalAs(UnmanagedType.SafeArray)] did not help




When I said that data is sent as const I meant that data is sent from application to dll like it’s a const and because of it, data is not returned from dll.

Because I don’t speak English very good I’ll give you an example:

DATA []data = new DATA[count];
data[0].id = 20;
char []data_name = new char[data_size];
data_name[0] = ‘t’;
data_name[1] = ‘e’;
data_name[2] = ‘s’;
data_name[3] = ‘t’;
bbox_table_get(id, (uint)Marshal.SizeOf(typeof(DATA)), data, data_name);


// here is what happens inside the function
// data[0].id is equal to 20
// data_name is equal to "test"
data[0].id = 5;
data_name[0] = ‘b’;
data_name[1] = ‘r’;
data_name[2] = ‘e’;
data_name[3] = ‘s’;
data_name[4] = ‘t’;
// here is what happens inside the function

 

Now when function returns back from dll:

// data[0].id is equal to 20
// data_name is equal to "brest"





-- modified at 9:48 Monday 18th September, 2006
QuestionHow can I download video files programmatically in C# [modified] Pin
desamsetty14-Sep-06 13:18
desamsetty14-Sep-06 13:18 
AnswerRe: How can I download video files programmatically in C# Pin
Dominic Pettifer14-Sep-06 13:35
Dominic Pettifer14-Sep-06 13:35 
AnswerRe: How can I download video files programmatically in C# Pin
scott_hackett18-Sep-06 21:22
scott_hackett18-Sep-06 21:22 
QuestionMemory Leak in C#.NET 2005 Pin
clint198214-Sep-06 10:31
clint198214-Sep-06 10:31 
AnswerRe: Memory Leak in C#.NET 2005 Pin
Christian Graus14-Sep-06 13:49
protectorChristian Graus14-Sep-06 13:49 
GeneralRe: Memory Leak in C#.NET 2005 Pin
clint198215-Sep-06 22:19
clint198215-Sep-06 22:19 
AnswerRe: Memory Leak in C#.NET 2005 Pin
Hamid_RT15-Sep-06 6:41
Hamid_RT15-Sep-06 6:41 
QuestionReturning Key-Value Pairs from Web Service Pin
DISP-Jol14-Sep-06 10:25
DISP-Jol14-Sep-06 10:25 
QuestionPulling values from xml nodes where xml is in string form Pin
Omkar Ghaisas14-Sep-06 9:04
Omkar Ghaisas14-Sep-06 9:04 
AnswerRe: Pulling values from xml nodes where xml is in string form Pin
Stefan Troschuetz14-Sep-06 9:17
Stefan Troschuetz14-Sep-06 9:17 
QuestionWay for a Method() to get the class name of it's caller? Pin
Dominic Pettifer14-Sep-06 8:34
Dominic Pettifer14-Sep-06 8:34 
AnswerRe: Way for a Method() to get the class name of it's caller? Pin
mav.northwind14-Sep-06 8:52
mav.northwind14-Sep-06 8:52 
GeneralRe: Way for a Method() to get the class name of it's caller? Pin
Dominic Pettifer14-Sep-06 11:11
Dominic Pettifer14-Sep-06 11:11 
QuestionSave encrypted data to SQL Server with funny chars Pin
MyRunner2314-Sep-06 7:53
MyRunner2314-Sep-06 7:53 
AnswerRe: Save encrypted data to SQL Server with funny chars Pin
Rob Graham14-Sep-06 8:01
Rob Graham14-Sep-06 8:01 
GeneralRe: Save encrypted data to SQL Server with funny chars Pin
MyRunner2314-Sep-06 8:10
MyRunner2314-Sep-06 8:10 
GeneralRe: Save encrypted data to SQL Server with funny chars Pin
Dominic Pettifer14-Sep-06 8:27
Dominic Pettifer14-Sep-06 8:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.