Click here to Skip to main content
15,903,362 members
Home / Discussions / C#
   

C#

 
QuestionBest technique to deal with a large number of forms? Pin
Member 9628-Nov-05 13:58
Member 9628-Nov-05 13:58 
AnswerRe: Best technique to deal with a large number of forms? Pin
AETaylor28-Nov-05 20:42
AETaylor28-Nov-05 20:42 
QuestionSlight problem when removing an item from a list box, somethhing about an enumerator Pin
Anthony Mushrow28-Nov-05 13:33
professionalAnthony Mushrow28-Nov-05 13:33 
AnswerRe: Slight problem when removing an item from a list box, somethhing about an enumerator Pin
Christian Graus28-Nov-05 15:29
protectorChristian Graus28-Nov-05 15:29 
QuestionHow to provide default implementations? Pin
peterchen28-Nov-05 12:18
peterchen28-Nov-05 12:18 
AnswerRe: How to provide default implementations? Pin
User 665828-Nov-05 12:27
User 665828-Nov-05 12:27 
GeneralRe: How to provide default implementations? Pin
peterchen28-Nov-05 12:42
peterchen28-Nov-05 12:42 
AnswerRe: How to provide default implementations? Pin
Robert Rohde28-Nov-05 12:45
Robert Rohde28-Nov-05 12:45 
GeneralRe: How to provide default implementations? Pin
[Marc]28-Nov-05 14:46
[Marc]28-Nov-05 14:46 
GeneralRe: How to provide default implementations? Pin
peterchen28-Nov-05 20:13
peterchen28-Nov-05 20:13 
AnswerRe: How to provide default implementations? Pin
Leslie Sanford28-Nov-05 12:51
Leslie Sanford28-Nov-05 12:51 
Questioncoordinates of mouse on picturebox Pin
haytham_mohammad28-Nov-05 12:12
haytham_mohammad28-Nov-05 12:12 
AnswerRe: coordinates of mouse on picturebox Pin
Christian Graus28-Nov-05 12:13
protectorChristian Graus28-Nov-05 12:13 
GeneralRe: coordinates of mouse on picturebox Pin
haytham_mohammad28-Nov-05 13:40
haytham_mohammad28-Nov-05 13:40 
GeneralRe: coordinates of mouse on picturebox Pin
Christian Graus28-Nov-05 13:43
protectorChristian Graus28-Nov-05 13:43 
QuestionI got a list of processes in a list box, how do i get rid of the 'System.Diagno...' part? Pin
Anthony Mushrow28-Nov-05 11:59
professionalAnthony Mushrow28-Nov-05 11:59 
AnswerRe: I got a list of processes in a list box, how do i get rid of the 'System.Diagno...' part? Pin
Curtis Schlak.28-Nov-05 12:41
Curtis Schlak.28-Nov-05 12:41 
QuestionHow to "%04i" in C#? Pin
peterchen28-Nov-05 11:57
peterchen28-Nov-05 11:57 
AnswerRe: How to "%04i" in C#? Pin
Christian Graus28-Nov-05 12:15
protectorChristian Graus28-Nov-05 12:15 
GeneralRe: How to "%04i" in C#? Pin
peterchen28-Nov-05 12:17
peterchen28-Nov-05 12:17 
GeneralRe: How to "%04i" in C#? Pin
Christian Graus28-Nov-05 12:18
protectorChristian Graus28-Nov-05 12:18 
QuestionConnecting to MSDE with Visual studio C# Pin
kourvoisier28-Nov-05 11:43
kourvoisier28-Nov-05 11:43 
AnswerRe: Connecting to MSDE with Visual studio C# Pin
Christian Graus28-Nov-05 12:16
protectorChristian Graus28-Nov-05 12:16 
QuestionPassing a struct from c# to c in vs.net Pin
spellman28-Nov-05 11:14
spellman28-Nov-05 11:14 
I am attempting to call legacy c code from C#. I've compiled the c code into a dll in VS.net and am trying to call one of its functions from C#. One of the parameters that the c function is looking for is a pointer to a structure( c_func(C_DEF_STRUCT *cStr) ). The structure is defined as follows:

typedef struct C_DEF_STRUCT {
char aChar;
long a_len;
long b_len;
long c_len;
long d_len;
long e_len;
long f_len;
long unsigned char *aPtr;
long unsigned char *bPtr;
long unsigned char *cPtr;
long unsigned char *dPtr;
long unsigned char *ePtr;
long unsigned char *fPtr;
long unsigned char *gPtr;
} C_DEF_STRUCT;

I created a struct in C# as follows:

[StructLayout(LayoutKind.Sequential)]
public struct DEF_STRUCT
{
public char aChar;
public Int32 a_length;
public Int32 b_length;
public Int32 c_length;
public Int32 d_length;
public Int32 e_length;
public Int32 f_length;
public Int32 g_length;
public Int32 size;
public byte[] aPtr;
public byte[] bPtr;
public byte[] cPtr;
public byte[] dPtr;
public byte[] ePtr;
public byte[] fPtr;
public byte[] gPtr;
}

On the C# side, I before calling the C function I did the following:

DEF_STRUCT myStruct = new DEF_STRUCT();
myStruct.aPtr = new byte[5000];

Then I proceeded to fill aPtr.

When calling the C function, I'm passing myStruct along as a reference ( c_func(ref myStruct) ).

The contents of aPtr is not getting sent over correctly. I get an address on the C side, but the contents of the array does not match what is on the C# side.

I'm not sure how to solve this problem. Any suggestions would be great.
QuestionIs there any other way to open a web page than Process.Start? Pin
Anthony Mushrow28-Nov-05 11:05
professionalAnthony Mushrow28-Nov-05 11:05 

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.