Click here to Skip to main content
15,913,055 members
Home / Discussions / C#
   

C#

 
GeneralRe: File compare - CRC? Pin
jbradshaw3-Dec-09 3:13
jbradshaw3-Dec-09 3:13 
GeneralRe: File compare - CRC? Pin
PIEBALDconsult3-Dec-09 4:16
mvePIEBALDconsult3-Dec-09 4:16 
GeneralRe: File compare - CRC? Pin
jbradshaw3-Dec-09 9:51
jbradshaw3-Dec-09 9:51 
GeneralRe: File compare - CRC? Pin
PIEBALDconsult3-Dec-09 10:43
mvePIEBALDconsult3-Dec-09 10:43 
QuestionHow to Disable Repair in VisualStudio2008 Setup Project? Pin
Narendra Reddy Vajrala2-Dec-09 5:16
Narendra Reddy Vajrala2-Dec-09 5:16 
Questionmerge two projects Pin
jashimu2-Dec-09 5:07
jashimu2-Dec-09 5:07 
AnswerRe: merge two projects Pin
Narendra Reddy Vajrala2-Dec-09 5:20
Narendra Reddy Vajrala2-Dec-09 5:20 
QuestionPass a struct array to C++ to get data Pin
songll2-Dec-09 4:06
songll2-Dec-09 4:06 
Hi, guys, I have a C# struct array and I need to pass it to C++ code and get it filled with necessary data. Here is my C# code:

      public struct DataStruct
      {
            public string dataName;
            public int slot;
            public int quad;

            public DataStruct(string name, int slot, int quadrant)
            {
                  this.dataName= name;
                  this.slot = slot;
                  this.quad = quadrant;
            }
      }

// C++ function
[DllImport("CppCode.dll")]
public static extern int GetDataList([In, Out] DataStruct[] dataList);

// Create the struct array
DataStruct[] dataList = new DataStruct[512];
// Call C++ function
GetDataList(dataList);

C++ code in CppCode.dll:

struct DataStruct
{
     char * dataName;
     int slot;
     int quad;
};

DLLEXPORT int GetDataList(DataStruct* dataList)
{
      for (int i = 0; i < 100; i++)
      {
            dataList[i].dataName = "qqq";
            dataList[i].slot = i;
            dataList[i].quad = i+1;
      }
      return 0;
}

Please help to find out if I did something wrong. The most strange thing is that this code works fine in some computers but in other computers, it crashes when return back from C++ code.
Thanks a lot!!
AnswerRe: Pass a struct array to C++ to get data Pin
KarstenK2-Dec-09 4:40
mveKarstenK2-Dec-09 4:40 
AnswerRe: Pass a struct array to C++ to get data Pin
Richard MacCutchan2-Dec-09 5:02
mveRichard MacCutchan2-Dec-09 5:02 
GeneralRe: Pass a struct array to C++ to get data Pin
songll2-Dec-09 6:05
songll2-Dec-09 6:05 
GeneralRe: Pass a struct array to C++ to get data Pin
Richard MacCutchan2-Dec-09 6:54
mveRichard MacCutchan2-Dec-09 6:54 
QuestionDynamic Image in Report Viewer? Pin
CelestialCoder2-Dec-09 4:03
CelestialCoder2-Dec-09 4:03 
AnswerRe: Dynamic Image in Report Viewer? Pin
Dave Kreskowiak2-Dec-09 4:22
mveDave Kreskowiak2-Dec-09 4:22 
QuestionDoes anyone know a how / have code to associate your app with a file extension that works in XP, Vista AND Win7 ? Pin
L.Denninger2-Dec-09 2:30
L.Denninger2-Dec-09 2:30 
AnswerRe: Does anyone know a how / have code to associate your app with a file extension that works in XP, Vista AND Win7 ? Pin
Dave Kreskowiak2-Dec-09 4:20
mveDave Kreskowiak2-Dec-09 4:20 
QuestionZedgraph C# how to Pin
vitor282-Dec-09 1:00
vitor282-Dec-09 1:00 
AnswerRe: Zedgraph C# how to Pin
Ashfield2-Dec-09 1:23
Ashfield2-Dec-09 1:23 
GeneralRe: Zedgraph C# how to Pin
vitor282-Dec-09 1:32
vitor282-Dec-09 1:32 
GeneralRe: Zedgraph C# how to Pin
Dave Kreskowiak2-Dec-09 4:18
mveDave Kreskowiak2-Dec-09 4:18 
GeneralRe: Zedgraph C# how to Pin
vitor282-Dec-09 4:37
vitor282-Dec-09 4:37 
AnswerMessage Closed Pin
2-Dec-09 1:46
stancrm2-Dec-09 1:46 
GeneralRe: Zedgraph C# how to Pin
vitor282-Dec-09 2:02
vitor282-Dec-09 2:02 
QuestionMapping a Web folder to a drive - C# Pin
ramzg2-Dec-09 0:10
ramzg2-Dec-09 0:10 
QuestionLost my designer Pin
Rob Philpott1-Dec-09 23:01
Rob Philpott1-Dec-09 23:01 

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.