Click here to Skip to main content
15,897,371 members
Home / Discussions / C#
   

C#

 
GeneralRe: Call Shell Command Pin
Stephane Rodriguez.30-Apr-03 19:52
Stephane Rodriguez.30-Apr-03 19:52 
GeneralRe: Call Shell Command Pin
Andy Davey1-May-03 17:37
Andy Davey1-May-03 17:37 
GeneralRe: Call Shell Command Pin
Amauw Scritz2-May-03 20:02
Amauw Scritz2-May-03 20:02 
GeneralRe: Call Shell Command Pin
Amauw Scritz3-May-03 18:56
Amauw Scritz3-May-03 18:56 
GeneralRe: Call Shell Command Pin
Stephane Rodriguez.3-May-03 21:04
Stephane Rodriguez.3-May-03 21:04 
GeneralCalling unmanged DLL Pin
Andy Davey30-Apr-03 14:25
Andy Davey30-Apr-03 14:25 
GeneralRe: Calling unmanged DLL Pin
Andy Davey30-Apr-03 14:50
Andy Davey30-Apr-03 14:50 
GeneralRe: Calling unmanged DLL Pin
James T. Johnson30-Apr-03 15:07
James T. Johnson30-Apr-03 15:07 
Use the MarshalAs attribute on the struct's fields to specify how it should convert the string.

Untested/uncompiled:

[StructLayout(LayoutKind.Sequential, Pack=4, CharSet=CharSet.Ansi)]
struct FOO
{
  [MarshalAs(UnmanagedType.ByValTStr, SizeConst=20)]
  public string szSymbol;
  public uint dwVolume;
}
Now if szSymbol is going to be modified by the P/Invoke'd method then you need to use a StringBuilder rather than string to avoid any problems that may occur due to string interning.

James

"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation

GeneralRe: Calling unmanged DLL Pin
Andy Davey30-Apr-03 15:21
Andy Davey30-Apr-03 15:21 
GeneralRe: Calling unmanged DLL Pin
James T. Johnson30-Apr-03 15:42
James T. Johnson30-Apr-03 15:42 
GeneralRe: Calling unmanged DLL Pin
leppie1-May-03 7:13
leppie1-May-03 7:13 
GeneralCreating a control from a handle Pin
leppie30-Apr-03 13:21
leppie30-Apr-03 13:21 
GeneralRe: Creating a control from a handle Pin
Stephane Rodriguez.30-Apr-03 19:48
Stephane Rodriguez.30-Apr-03 19:48 
GeneralRe: Creating a control from a handle Pin
leppie1-May-03 7:08
leppie1-May-03 7:08 
GeneralRe: Creating a control from a handle Pin
J. Dunlap1-May-03 7:14
J. Dunlap1-May-03 7:14 
GeneralRe: Creating a control from a handle Pin
Stephane Rodriguez.1-May-03 7:30
Stephane Rodriguez.1-May-03 7:30 
GeneralRe: Creating a control from a handle Pin
leppie1-May-03 8:13
leppie1-May-03 8:13 
QuestionControl?? Pin
Silverdelange30-Apr-03 11:21
sussSilverdelange30-Apr-03 11:21 
AnswerRe: Control?? Pin
Ray Hayes30-Apr-03 12:10
Ray Hayes30-Apr-03 12:10 
GeneralRe: Control?? Pin
Jon Newman2-May-03 1:56
Jon Newman2-May-03 1:56 
GeneralCool tool Pin
Kant30-Apr-03 10:34
Kant30-Apr-03 10:34 
GeneralRe: Cool tool Pin
Stephane Rodriguez.30-Apr-03 10:51
Stephane Rodriguez.30-Apr-03 10:51 
GeneralRe: Cool tool Pin
J. Dunlap30-Apr-03 11:13
J. Dunlap30-Apr-03 11:13 
GeneralModal Forms Pin
Mark Kimball30-Apr-03 10:25
Mark Kimball30-Apr-03 10:25 
GeneralRe: Modal Forms Pin
Stephane Rodriguez.30-Apr-03 11:24
Stephane Rodriguez.30-Apr-03 11:24 

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.