Click here to Skip to main content
15,923,164 members
Home / Discussions / C#
   

C#

 
GeneralRe: Getting pointer to DLL loaded by other program Pin
James T. Johnson16-May-03 4:25
James T. Johnson16-May-03 4:25 
GeneralSavedialog with serlization.. Pin
tuan_tomy15-May-03 2:25
tuan_tomy15-May-03 2:25 
GeneralCOM interop and BSTR Pin
dshield15-May-03 1:44
dshield15-May-03 1:44 
GeneralRe: COM interop and BSTR Pin
Ranjan Banerji15-May-03 3:16
Ranjan Banerji15-May-03 3:16 
GeneralRe: COM interop and BSTR Pin
dshield15-May-03 4:37
dshield15-May-03 4:37 
GeneralRe: COM interop and BSTR Pin
Ranjan Banerji15-May-03 6:28
Ranjan Banerji15-May-03 6:28 
GeneralRe: COM interop and BSTR Pin
Richard Deeming15-May-03 8:17
mveRichard Deeming15-May-03 8:17 
GeneralAll better now Pin
dshield15-May-03 9:02
dshield15-May-03 9:02 
The interop part of marshaling the BSTR to a string was working ok. The problem was with the conversion from a Unicode array to a byte array. The correct converstion is:
<br />
byte[] pdfBytes = Encoding.Convert(Encoding.Unicode, Encoding.Default,<br />
                                   Encoding.Unicode.GetBytes(pdfString));<br />

What I had been trying to convert to UTF-8, which was what was causing the problems. Converting to Default solved the problem.

Thanks for all the comments.

Dan



They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.
--Benjamin Franklin, 1759
GeneralRe: All better now Pin
Ranjan Banerji15-May-03 10:20
Ranjan Banerji15-May-03 10:20 
GeneralJava class to C#: inheritance problem Pin
cabo15-May-03 0:51
cabo15-May-03 0:51 
GeneralRe: Java class to C#: inheritance problem Pin
Philip Fitzsimons15-May-03 3:08
Philip Fitzsimons15-May-03 3:08 
GeneralRe: Java class to C#: inheritance problem Pin
cabo15-May-03 5:32
cabo15-May-03 5:32 
GeneralRe: Java class to C#: inheritance problem Pin
Richard Deeming15-May-03 8:23
mveRichard Deeming15-May-03 8:23 
GeneralRe: Java class to C#: inheritance problem Pin
Philip Fitzsimons16-May-03 2:39
Philip Fitzsimons16-May-03 2:39 
GeneralRe: Java class to C#: inheritance problem Pin
Richard Deeming15-May-03 8:21
mveRichard Deeming15-May-03 8:21 
GeneralRe: Java class to C#: inheritance problem Pin
cabo15-May-03 9:32
cabo15-May-03 9:32 
Generalreqaurding rtf boxes Pin
jtmtv1814-May-03 22:57
jtmtv1814-May-03 22:57 
GeneralRe: reqaurding rtf boxes Pin
KingTermite15-May-03 3:35
KingTermite15-May-03 3:35 
GeneralRe: reqaurding rtf boxes Pin
jtmtv1815-May-03 10:11
jtmtv1815-May-03 10:11 
GeneralRe: reqaurding rtf boxes Pin
KingTermite16-May-03 2:41
KingTermite16-May-03 2:41 
GeneralRe: reqaurding rtf boxes Pin
jtmtv1816-May-03 8:19
jtmtv1816-May-03 8:19 
GeneralRe: reqaurding rtf boxes Pin
KingTermite16-May-03 12:59
KingTermite16-May-03 12:59 
GeneralRe: reqaurding rtf boxes Pin
jtmtv1816-May-03 14:00
jtmtv1816-May-03 14:00 
GeneralHiWord/LoWord/etc in C# Pin
J. Dunlap14-May-03 19:33
J. Dunlap14-May-03 19:33 
GeneralRe: HiWord/LoWord/etc in C# Pin
cdehelean15-May-03 4:49
cdehelean15-May-03 4:49 

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.