Click here to Skip to main content
16,005,141 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: still about modeless dialog Pin
Desmo167-Jul-06 0:30
Desmo167-Jul-06 0:30 
GeneralRe: still about modeless dialog Pin
Desmo167-Jul-06 0:30
Desmo167-Jul-06 0:30 
GeneralRe: still about modeless dialog Pin
Hamid_RT7-Jul-06 0:48
Hamid_RT7-Jul-06 0:48 
GeneralRe: still about modeless dialog Pin
huynhnb7-Jul-06 2:04
huynhnb7-Jul-06 2:04 
GeneralRe: still about modeless dialog Pin
Hamid_RT7-Jul-06 0:47
Hamid_RT7-Jul-06 0:47 
AnswerRe: still about modeless dialog Pin
David Crow7-Jul-06 3:38
David Crow7-Jul-06 3:38 
GeneralRe: still about modeless dialog Pin
Desmo169-Jul-06 21:25
Desmo169-Jul-06 21:25 
Questionexporting int array from c++ dll to clint Pin
Tugberk_Kara6-Jul-06 22:09
Tugberk_Kara6-Jul-06 22:09 
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();
}
}
}



AnswerRe: exporting int array from c++ dll to clint Pin
Justin Tay6-Jul-06 22:44
Justin Tay6-Jul-06 22:44 
GeneralRe: exporting int array from c++ dll to clint Pin
Tugberk_Kara6-Jul-06 22:50
Tugberk_Kara6-Jul-06 22:50 
Question[Message Deleted] Pin
ashish dogra6-Jul-06 20:53
ashish dogra6-Jul-06 20:53 
AnswerRe: border in dialog box Pin
Sarath C6-Jul-06 21:17
Sarath C6-Jul-06 21:17 
GeneralRe: border in dialog box Pin
ashish dogra6-Jul-06 21:22
ashish dogra6-Jul-06 21:22 
GeneralRe: border in dialog box Pin
Rajesh R Subramanian6-Jul-06 21:28
professionalRajesh R Subramanian6-Jul-06 21:28 
GeneralRe: border in dialog box Pin
Sarath C6-Jul-06 21:49
Sarath C6-Jul-06 21:49 
GeneralRe: border in dialog box Pin
ashish dogra6-Jul-06 21:55
ashish dogra6-Jul-06 21:55 
GeneralRe: border in dialog box Pin
Sarath C6-Jul-06 22:30
Sarath C6-Jul-06 22:30 
GeneralRe: border in dialog box Pin
Hamid_RT6-Jul-06 21:53
Hamid_RT6-Jul-06 21:53 
GeneralRe: border in dialog box Pin
Weiye Chen6-Jul-06 22:01
Weiye Chen6-Jul-06 22:01 
GeneralRe: border in dialog box Pin
Hamid_RT6-Jul-06 22:03
Hamid_RT6-Jul-06 22:03 
GeneralRe: border in dialog box [modified] Pin
ashish dogra6-Jul-06 22:15
ashish dogra6-Jul-06 22:15 
GeneralRe: border in dialog box Pin
Weiye Chen6-Jul-06 22:48
Weiye Chen6-Jul-06 22:48 
GeneralRe: border in dialog box Pin
ashish dogra6-Jul-06 23:10
ashish dogra6-Jul-06 23:10 
GeneralRe: border in dialog box Pin
Weiye Chen6-Jul-06 23:23
Weiye Chen6-Jul-06 23:23 
GeneralRe: border in dialog box Pin
ashish dogra6-Jul-06 23:33
ashish dogra6-Jul-06 23:33 

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.