Click here to Skip to main content
15,898,035 members
Home / Discussions / C#
   

C#

 
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 
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 
I am right about ref and out, trust me. Interop is something I've studied more in-depth than anything with .NET, and I study everything pretty deeply. Smile | :)

Anyway, I didn't look over the whole thing initially since Dave was helping you.

Following the messages below this one, you're right that chars in .NET are natively 16-bits, but they can be marshalled as 8-bit chars as well depending on the MarshalAsAttribute, or the StructLayoutAttribute and the DllImportAttribute (using the CharSet property for each) if you don't specify the MarshalAsAttribute (not always a need to).

So you're not really changing what a char is in managed code, but you're changing how its marshalled to and from unmanaged code.

 

Microsoft MVP, Visual C#
My Articles
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 
Generalnewer version Pin
el69os26-Mar-04 2:05
el69os26-Mar-04 2:05 
GeneralAbout DirectX9 and C# Pin
cemlouis25-Mar-04 8:59
cemlouis25-Mar-04 8:59 

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.