Click here to Skip to main content
15,889,858 members
Home / Discussions / C#
   

C#

 
QuestionHow can I use a C++ struct from a C# app? Pin
verence33310-Sep-08 0:29
verence33310-Sep-08 0:29 
AnswerRe: How can I use a C++ struct from a C# app? Pin
leppie10-Sep-08 0:31
leppie10-Sep-08 0:31 
GeneralRe: How can I use a C++ struct from a C# app? Pin
verence33310-Sep-08 0:47
verence33310-Sep-08 0:47 
GeneralRe: How can I use a C++ struct from a C# app? Pin
leppie10-Sep-08 0:59
leppie10-Sep-08 0:59 
GeneralRe: How can I use a C++ struct from a C# app? Pin
verence33310-Sep-08 1:14
verence33310-Sep-08 1:14 
GeneralRe: How can I use a C++ struct from a C# app? Pin
leppie10-Sep-08 1:19
leppie10-Sep-08 1:19 
GeneralRe: How can I use a C++ struct from a C# app? Pin
verence33310-Sep-08 1:52
verence33310-Sep-08 1:52 
AnswerRe: How can I use a C++ struct from a C# app? Pin
Gideon Engelberth10-Sep-08 3:28
Gideon Engelberth10-Sep-08 3:28 
There are several attributes in the System.Runtime.InteropServices namespace that will be useful here. You could try something like this:
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential)]
struct SOMESTRUCT
{
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst:=100)]
    string Field1;
    int Field2;
    double Field3;
}


I don't know if that should be SizeConst:=100 or just SizeConst=100; I just copied it from the VB editor. At the very least, that should point you in the right direction.
GeneralRe: How can I use a C++ struct from a C# app? Pin
verence33310-Sep-08 3:45
verence33310-Sep-08 3:45 
GeneralRe: How can I use a C++ struct from a C# app? Pin
verence33310-Sep-08 21:05
verence33310-Sep-08 21:05 
AnswerRe: How can I use a C++ struct from a C# app? Pin
Alan Balkany10-Sep-08 3:57
Alan Balkany10-Sep-08 3:57 
GeneralRe: How can I use a C++ struct from a C# app? Pin
verence33310-Sep-08 4:20
verence33310-Sep-08 4:20 
GeneralRe: How can I use a C++ struct from a C# app? Pin
Alan Balkany10-Sep-08 4:43
Alan Balkany10-Sep-08 4:43 
GeneralRe: How can I use a C++ struct from a C# app? Pin
verence33310-Sep-08 5:27
verence33310-Sep-08 5:27 
QuestionWhat's difference between a DLL file & an assembly file ? Pin
Mohammad Dayyan10-Sep-08 0:14
Mohammad Dayyan10-Sep-08 0:14 
AnswerRe: What's difference between a DLL file & an assembly file ? Pin
blackjack215010-Sep-08 0:25
blackjack215010-Sep-08 0:25 
GeneralRe: What's difference between a DLL file & an assembly file ? Pin
Mohammad Dayyan10-Sep-08 0:30
Mohammad Dayyan10-Sep-08 0:30 
GeneralRe: What's difference between a DLL file & an assembly file ? Pin
leppie10-Sep-08 0:32
leppie10-Sep-08 0:32 
GeneralRe: What's difference between a DLL file & an assembly file ? Pin
Mohammad Dayyan10-Sep-08 0:35
Mohammad Dayyan10-Sep-08 0:35 
GeneralRe: What's difference between a DLL file & an assembly file ? Pin
leppie10-Sep-08 0:41
leppie10-Sep-08 0:41 
GeneralRe: What's difference between a DLL file & an assembly file ? Pin
Giorgi Dalakishvili10-Sep-08 0:42
mentorGiorgi Dalakishvili10-Sep-08 0:42 
GeneralRe: What's difference between a DLL file & an assembly file ? Pin
Mohammad Dayyan10-Sep-08 0:46
Mohammad Dayyan10-Sep-08 0:46 
GeneralRe: What's difference between a DLL file & an assembly file ? Pin
Giorgi Dalakishvili10-Sep-08 0:49
mentorGiorgi Dalakishvili10-Sep-08 0:49 
GeneralRe: What's difference between a DLL file & an assembly file ? Pin
leppie10-Sep-08 0:58
leppie10-Sep-08 0:58 
AnswerRe: What's difference between a DLL file & an assembly file ? Pin
g_amol10-Sep-08 0:58
g_amol10-Sep-08 0:58 

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.