Click here to Skip to main content
15,395,065 members
Home / Discussions / C#
   

C#

 
GeneralRe: Dynamic Casting for use in Polymorphic/overloaded methods. Pin
Scott Barr9-Jan-04 4:42
MemberScott Barr9-Jan-04 4:42 
GeneralRe: Dynamic Casting for use in Polymorphic/overloaded methods. Pin
Heath Stewart9-Jan-04 5:15
protectorHeath Stewart9-Jan-04 5:15 
GeneralRe: Dynamic Casting for use in Polymorphic/overloaded methods. Pin
Scott Barr9-Jan-04 5:30
MemberScott Barr9-Jan-04 5:30 
GeneralType convertion and Unmanaged code Pin
Shahin778-Jan-04 10:48
MemberShahin778-Jan-04 10:48 
GeneralRe: Type convertion and Unmanaged code Pin
Heath Stewart8-Jan-04 11:39
protectorHeath Stewart8-Jan-04 11:39 
GeneralRe: Type convertion and Unmanaged code Pin
Shahin778-Jan-04 11:52
MemberShahin778-Jan-04 11:52 
GeneralRe: Type convertion and Unmanaged code Pin
Heath Stewart8-Jan-04 12:16
protectorHeath Stewart8-Jan-04 12:16 
GeneralRe: Type convertion and Unmanaged code Pin
Heath Stewart8-Jan-04 12:37
protectorHeath Stewart8-Jan-04 12:37 
I also got to thinking that the encoding could be the problem. Does this function that you're wanting to P/Invoke only support ANSI characters, Unicode characters, or either ANSI or Unicode depending on the operating system? Depending on what encoding it uses, you should add the CharSet property in the StructLayoutAttribute:
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
public struct CDCAResult
{
  // ...
}
The SizeConst property in the MarshalAsAttribute will make sure that the offsets are correct for the String fields, so assuming that the rest of your fields where the values you were expecting the character encoding is most likely the problem.

 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralRe: Type convertion and Unmanaged code Pin
Shahin778-Jan-04 14:15
MemberShahin778-Jan-04 14:15 
GeneralStartup Switch Options ... Pin
Daniel Negron8-Jan-04 10:08
MemberDaniel Negron8-Jan-04 10:08 
GeneralRe: Startup Switch Options ... Pin
Niels Penneman8-Jan-04 10:43
MemberNiels Penneman8-Jan-04 10:43 
GeneralRe: Startup Switch Options ... Pin
Heath Stewart8-Jan-04 11:34
protectorHeath Stewart8-Jan-04 11:34 
GeneralWriting CD/DVD Pin
Christian Graus8-Jan-04 9:37
mveChristian Graus8-Jan-04 9:37 
GeneralRe: Writing CD/DVD Pin
Mazdak8-Jan-04 9:55
MemberMazdak8-Jan-04 9:55 
GeneralRe: Writing CD/DVD Pin
Christian Graus8-Jan-04 9:59
mveChristian Graus8-Jan-04 9:59 
GeneralRe: Writing CD/DVD Pin
Kentamanos8-Jan-04 10:25
MemberKentamanos8-Jan-04 10:25 
GeneralRe: Writing CD/DVD Pin
Kentamanos8-Jan-04 16:51
MemberKentamanos8-Jan-04 16:51 
GeneralRe: Writing CD/DVD Pin
Christian Graus8-Jan-04 17:08
mveChristian Graus8-Jan-04 17:08 
GeneralRe: Writing CD/DVD Pin
leppie8-Jan-04 10:21
Memberleppie8-Jan-04 10:21 
GeneralRe: Writing CD/DVD Pin
Christian Graus8-Jan-04 10:36
mveChristian Graus8-Jan-04 10:36 
Generalprinting custom page sizes Pin
lostegg8-Jan-04 9:06
susslostegg8-Jan-04 9:06 
GeneralRe: printing custom page sizes Pin
Heath Stewart8-Jan-04 11:30
protectorHeath Stewart8-Jan-04 11:30 
GeneralNull error when adding custom control Pin
KingTermite8-Jan-04 8:39
MemberKingTermite8-Jan-04 8:39 
GeneralRe: Null error when adding custom control Pin
Christian Graus8-Jan-04 8:52
mveChristian Graus8-Jan-04 8:52 
GeneralRe: Null error when adding custom control Pin
KingTermite8-Jan-04 9:00
MemberKingTermite8-Jan-04 9:00 

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.