Click here to Skip to main content
16,009,156 members
Home / Discussions / C#
   

C#

 
QuestionHow to create InstallShield with c#.net 3.5 windows application Pin
Narendra Reddy Vajrala7-Apr-09 5:48
Narendra Reddy Vajrala7-Apr-09 5:48 
AnswerRe: How to create InstallShield with c#.net 3.5 windows application Pin
Rajdeep.NET is BACK7-Apr-09 7:06
Rajdeep.NET is BACK7-Apr-09 7:06 
GeneralRe: How to create InstallShield with c#.net 3.5 windows application Pin
Narendra Reddy Vajrala7-Apr-09 22:58
Narendra Reddy Vajrala7-Apr-09 22:58 
GeneralRe: How to create InstallShield with c#.net 3.5 windows application Pin
nooraldeen1-Dec-09 19:35
nooraldeen1-Dec-09 19:35 
QuestionHow to put Text to speech output into a Direct sound 3d buffer Pin
ETEDS7-Apr-09 3:09
ETEDS7-Apr-09 3:09 
QuestionHow to Create shortcut to our application on client desctop in c#.net 3.5 windows application? Pin
Narendra Reddy Vajrala7-Apr-09 3:02
Narendra Reddy Vajrala7-Apr-09 3:02 
AnswerRe: How to Create shortcut to our application on client desctop in c#.net 3.5 windows application? Pin
Mirko19807-Apr-09 3:42
Mirko19807-Apr-09 3:42 
GeneralRe: How to Create shortcut to our application on client desctop in c#.net 3.5 windows application? Pin
Narendra Reddy Vajrala7-Apr-09 4:16
Narendra Reddy Vajrala7-Apr-09 4:16 
GeneralRe: How to Create shortcut to our application on client desctop in c#.net 3.5 windows application? Pin
Mirko19807-Apr-09 5:04
Mirko19807-Apr-09 5:04 
QuestionTransfer big file from PC to PPC Pin
E_Gold7-Apr-09 2:47
E_Gold7-Apr-09 2:47 
QuestionHow can we use AutoCompleteCustomSource for a TextBox ? Pin
Mohammad Dayyan7-Apr-09 2:43
Mohammad Dayyan7-Apr-09 2:43 
AnswerRe: How can we use AutoCompleteCustomSource for a TextBox ? Pin
DaveyM697-Apr-09 2:54
professionalDaveyM697-Apr-09 2:54 
GeneralRe: How can we use AutoCompleteCustomSource for a TextBox ? Pin
Mohammad Dayyan7-Apr-09 3:26
Mohammad Dayyan7-Apr-09 3:26 
GeneralRe: How can we use AutoCompleteCustomSource for a TextBox ? Pin
DaveyM697-Apr-09 3:41
professionalDaveyM697-Apr-09 3:41 
GeneralRe: How can we use AutoCompleteCustomSource for a TextBox ? Pin
Mohammad Dayyan7-Apr-09 3:42
Mohammad Dayyan7-Apr-09 3:42 
QuestionRetrieve array from unmanaged DLL into C# application Pin
User 127827-Apr-09 2:38
User 127827-Apr-09 2:38 
I'm trying to get an output array from a function in an unmanaged DLL into my C# application. I've already done some googling on this topic and while I've found some articles, none of the suggestions seem to work.

The DLL has a function prototype of
int GetData(int ID, float* Results)


The int that is returned is the length of the array

Internally to send the results back it does
Results=new float[length];
//Fill in results here


In my C# application I use a delegate to get the function results:
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate int delGetData(int TagID, ref IntPtr Results);


I then try and retrieve the results and copy to a managed array doing this:
IntPtr data=IntPtr.Zero;
int Len=GetData(ID, ref data);

if(Len==0)
//something happened, exit

float[] results=new float[Len];
Marshal.Copy(data, results, 0, Len);


I always get an exception on the Marshal.Copy because the source (data) is null.

I have some control over the unmanaged DLL, any suggestions on how to get these to interface?

Thanks

modified 12-Jul-20 21:01pm.

AnswerRe: Retrieve array from unmanaged DLL into C# application Pin
Nicholas Butler7-Apr-09 2:54
sitebuilderNicholas Butler7-Apr-09 2:54 
GeneralRe: Retrieve array from unmanaged DLL into C# application Pin
User 127828-Apr-09 16:41
User 127828-Apr-09 16:41 
AnswerRe: Retrieve array from unmanaged DLL into C# application Pin
Luc Pattyn7-Apr-09 3:42
sitebuilderLuc Pattyn7-Apr-09 3:42 
GeneralRe: Retrieve array from unmanaged DLL into C# application Pin
User 127828-Apr-09 16:42
User 127828-Apr-09 16:42 
QuestionMappings SSIS Pin
Bajker7-Apr-09 2:36
Bajker7-Apr-09 2:36 
QuestionExcel ADO and Cell Format Pin
pjank427-Apr-09 2:08
pjank427-Apr-09 2:08 
QuestionStatus bar Pin
Sajjad Leo7-Apr-09 1:14
Sajjad Leo7-Apr-09 1:14 
AnswerRe: Status bar Pin
stancrm7-Apr-09 1:30
stancrm7-Apr-09 1:30 
GeneralRe: Status bar Pin
Sajjad Leo7-Apr-09 1:39
Sajjad Leo7-Apr-09 1:39 

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.