Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
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 
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 
Hi!

Gideon, yesterday I used your code to solve the problem, but I needed to add just a little thing (the charset in the StructLayout should be equivalent to the one used in the C++ struct; I just used "Auto" and it works). Just in case somebody has the same question, I'll write it here:

using System.Runtime.InteropServices;

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


Thank you very much.
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 
AnswerRe: What's difference between a DLL file & an assembly file ? Pin
Mark Salsbery10-Sep-08 6:15
Mark Salsbery10-Sep-08 6:15 
QuestionEEPROM Smart Card Pin
asp.net.csharp.ir9-Sep-08 23:58
asp.net.csharp.ir9-Sep-08 23: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.