Click here to Skip to main content
15,921,837 members
Home / Discussions / C#
   

C#

 
GeneralRe: Marshaling Object Pin
Anh_Tuan7-Jul-06 3:20
Anh_Tuan7-Jul-06 3:20 
Questionrunning a function in a thread Pin
Mridang Agarwalla6-Jul-06 22:21
Mridang Agarwalla6-Jul-06 22:21 
AnswerRe: running a function in a thread Pin
Anh_Tuan6-Jul-06 22:32
Anh_Tuan6-Jul-06 22:32 
GeneralRe: running a function in a thread Pin
Adadurov7-Jul-06 0:22
Adadurov7-Jul-06 0:22 
Questioncreate custom database [modified] Pin
z1z16-Jul-06 22:14
z1z16-Jul-06 22:14 
AnswerRe: create custom database Pin
Paul Conrad6-Jul-06 23:18
professionalPaul Conrad6-Jul-06 23:18 
Questioncombo box issue Pin
V.6-Jul-06 22:10
professionalV.6-Jul-06 22:10 
Questionexporting int array from c++ dll to c# client Pin
Tugberk_Kara6-Jul-06 22:07
Tugberk_Kara6-Jul-06 22:07 
I have a function in cpp file returning int * array and taking int * array as a parameter. It is as:

int * funcArg(int *a ) {
int DLLArg [] = {100,200,300};
a=DLLArg;

return a;
};

I have exported this function in the dll (i have checked it with dumpbin.exe)

But I can not handle this function in c# client. My code in c# is as: ( ıt gives this error. "An unhandled exception of type 'System.Runtime.InteropServices.SafeArrayRankMismatchException' occurred in CSharpClient.exe

Additional information: Safe array of rank 51241 has been passed to a method expecting an array of rank 1."

What should I do? URGENT help!!!

namespace CSharpClient
{

class Class1
{
[DllImport("DenemeNonMfcDll.dll",EntryPoint="?Sub@DLLclass@@QAEHHH@Z")]
public extern static int Sub(int a, int b);

[DllImport("DenemeNonMfcDll.dll")]
[return: MarshalAs(UnmanagedType.SafeArray)]
public extern static int [] funcArg(int [] a);


public static int [] intArray = new int [3] {0,1,2} ;


static void Main(string[] args)
{


foreach (int num in funcArg(intArray) )
{
System.Console.WriteLine(num.ToString());
}

Console.WriteLine("Press any key to continue...");
Console.ReadLine();
}
}
}



QuestionOutlook automation in Citrix MetaFrame supresses notifications [modified] Pin
Corinna John6-Jul-06 22:03
Corinna John6-Jul-06 22:03 
QuestionMousePosition vs lParam Pin
syedhassan46-Jul-06 21:11
syedhassan46-Jul-06 21:11 
AnswerRe: MousePosition vs lParam Pin
fang_eric6-Jul-06 21:20
fang_eric6-Jul-06 21:20 
Questionhourglass mouse still clicking Pin
lushgrass6-Jul-06 19:53
lushgrass6-Jul-06 19:53 
AnswerRe: hourglass mouse still clicking Pin
Nader Elshehabi6-Jul-06 20:38
Nader Elshehabi6-Jul-06 20:38 
GeneralRe: hourglass mouse still clicking Pin
lushgrass6-Jul-06 21:02
lushgrass6-Jul-06 21:02 
AnswerRe: hourglass mouse still clicking Pin
Nader Elshehabi6-Jul-06 21:22
Nader Elshehabi6-Jul-06 21:22 
GeneralRe: hourglass mouse still clicking Pin
lushgrass6-Jul-06 22:24
lushgrass6-Jul-06 22:24 
AnswerRe: hourglass mouse still clicking Pin
Nader Elshehabi6-Jul-06 22:58
Nader Elshehabi6-Jul-06 22:58 
GeneralRe: hourglass mouse still clicking Pin
lushgrass6-Jul-06 23:21
lushgrass6-Jul-06 23:21 
AnswerRe: hourglass mouse still clicking Pin
Nader Elshehabi7-Jul-06 2:46
Nader Elshehabi7-Jul-06 2:46 
GeneralRe: hourglass mouse still clicking [modified] Pin
lushgrass9-Jul-06 16:59
lushgrass9-Jul-06 16:59 
AnswerRe: hourglass mouse still clicking Pin
Nader Elshehabi9-Jul-06 20:49
Nader Elshehabi9-Jul-06 20:49 
GeneralRe: hourglass mouse still clicking Pin
lushgrass9-Jul-06 23:26
lushgrass9-Jul-06 23:26 
AnswerRe: hourglass mouse still clicking Pin
Nader Elshehabi9-Jul-06 23:40
Nader Elshehabi9-Jul-06 23:40 
GeneralRe: hourglass mouse still clicking Pin
lushgrass9-Jul-06 23:48
lushgrass9-Jul-06 23:48 
AnswerRe: hourglass mouse still clicking Pin
Nader Elshehabi10-Jul-06 1:42
Nader Elshehabi10-Jul-06 1:42 

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.