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

C#

 
GeneralPassing BStr by refrence to unmanaged dll Pin
schnee2k325-Mar-04 9:45
schnee2k325-Mar-04 9:45 
GeneralRe: Passing BStr by refrence to unmanaged dll Pin
Dave Kreskowiak25-Mar-04 12:03
mveDave Kreskowiak25-Mar-04 12:03 
GeneralRe: Passing BStr by refrence to unmanaged dll Pin
schnee2k325-Mar-04 12:10
schnee2k325-Mar-04 12:10 
GeneralRe: Passing BStr by refrence to unmanaged dll Pin
Dave Kreskowiak25-Mar-04 12:49
mveDave Kreskowiak25-Mar-04 12:49 
GeneralRe: Passing BStr by refrence to unmanaged dll Pin
schnee2k325-Mar-04 13:05
schnee2k325-Mar-04 13:05 
GeneralRe: Passing BStr by refrence to unmanaged dll Pin
Heath Stewart25-Mar-04 13:46
protectorHeath Stewart25-Mar-04 13:46 
GeneralRe: Passing BStr by refrence to unmanaged dll Pin
schnee2k325-Mar-04 14:21
schnee2k325-Mar-04 14:21 
GeneralRe: Passing BStr by refrence to unmanaged dll Pin
Dave Kreskowiak25-Mar-04 14:56
mveDave Kreskowiak25-Mar-04 14:56 
Without seeing the garbage in a debugger, it would appear that the function you called filled in ASCII characters (8-bit), instead of the 16-bit Unicode characters that StringBuilder is looking for.

One clue would be how long is the string compared to the length you expect. Is it just about half as long?

Another would be to look at the values in the chars[] array in the StringBuilder. Parse out the values for high and low bytes and check them against the ASCII table to see if your actually getting two 8-bit characters crammed into a single 16-bit character field.


RageInTheMachine9532
GeneralRe: Passing BStr by refrence to unmanaged dll Pin
schnee2k325-Mar-04 15:06
schnee2k325-Mar-04 15:06 
GeneralRe: Passing BStr by refrence to unmanaged dll Pin
Heath Stewart26-Mar-04 3:06
protectorHeath Stewart26-Mar-04 3:06 
GeneralRe: Passing BStr by refrence to unmanaged dll Pin
Heath Stewart26-Mar-04 3:18
protectorHeath Stewart26-Mar-04 3:18 
GeneralRe: Passing BStr by refrence to unmanaged dll Pin
schnee2k326-Mar-04 4:27
schnee2k326-Mar-04 4:27 
GeneralRe: Passing BStr by refrence to unmanaged dll Pin
Heath Stewart26-Mar-04 4:31
protectorHeath Stewart26-Mar-04 4:31 
GeneralRe: Passing BStr by refrence to unmanaged dll Pin
schnee2k326-Mar-04 4:35
schnee2k326-Mar-04 4:35 
GeneralRe: Passing BStr by refrence to unmanaged dll Pin
Dave Kreskowiak26-Mar-04 7:44
mveDave Kreskowiak26-Mar-04 7:44 
Questiontranslation vb to c# ? Pin
el69os25-Mar-04 8:59
el69os25-Mar-04 8:59 
AnswerRe: translation vb to c# ? Pin
Daniel Turini25-Mar-04 9:09
Daniel Turini25-Mar-04 9:09 
AnswerRe: translation vb to c# ? Pin
Michael Flanakin25-Mar-04 11:14
Michael Flanakin25-Mar-04 11:14 
GeneralRe: translation vb to c# ? Pin
el69os26-Mar-04 1:55
el69os26-Mar-04 1:55 
GeneralRe: translation vb to c# ? Pin
Michael Flanakin26-Mar-04 2:06
Michael Flanakin26-Mar-04 2:06 
AnswerRe: translation vb to c# ? Pin
Jeremy Kimball25-Mar-04 14:04
Jeremy Kimball25-Mar-04 14:04 
GeneralRe: translation vb to c# ? Pin
Michael Flanakin25-Mar-04 18:15
Michael Flanakin25-Mar-04 18:15 
GeneralRe: translation vb to c# ? Pin
Daniel Turini26-Mar-04 0:56
Daniel Turini26-Mar-04 0:56 
GeneralRe: translation vb to c# ? Pin
el69os26-Mar-04 2:01
el69os26-Mar-04 2:01 
AnswerRe: translation vb to c# ? Pin
el69os26-Mar-04 1:57
el69os26-Mar-04 1:57 

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.