Click here to Skip to main content
15,916,846 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralManaged strings and buffers to nonmanaged Pin
jspano10-Jul-03 7:58
jspano10-Jul-03 7:58 
GeneralRe: Managed strings and buffers to nonmanaged Pin
Nathan Blomquist10-Jul-03 8:32
Nathan Blomquist10-Jul-03 8:32 
GeneralRe: Managed strings and buffers to nonmanaged Pin
jspano11-Jul-03 3:23
jspano11-Jul-03 3:23 
GeneralRe: Managed strings and buffers to nonmanaged Pin
Nathan Blomquist11-Jul-03 4:25
Nathan Blomquist11-Jul-03 4:25 
GeneralRe: Managed strings and buffers to nonmanaged Pin
jspano11-Jul-03 5:14
jspano11-Jul-03 5:14 
GeneralRe: Managed strings and buffers to nonmanaged Pin
Nathan Blomquist11-Jul-03 5:28
Nathan Blomquist11-Jul-03 5:28 
GeneralRe: Managed strings and buffers to nonmanaged Pin
jspano11-Jul-03 6:48
jspano11-Jul-03 6:48 
GeneralRe: Managed strings and buffers to nonmanaged Pin
Nathan Blomquist11-Jul-03 7:20
Nathan Blomquist11-Jul-03 7:20 
Shouldn't you have to pass a type to the static_cast method (operator)?

Like:

<br />
wchar_t __nogc* pStr = static_cast<wchar_t*>(Marshal::StringToHGlobalUni(EncString).ToPointer()); <br />
String* pStringTemp = "";<br />
wchar_t __nogc* pBuf = static_cast<wchar_t*>(Marshal::StringToHGlobalUni(pStringTemp).ToPointer());<br />


I have no idea if that is a problem that you are having... Also you said you changed header file stuff... Did you make sure to do a clean and rebuild?

[Edit] You don't really need to do the String* pStringTemp at all... all you are doing is allocating an empty string... So you only need to declare pBuf and pass it in by reference like you are doing... Also, did you make sure to new the pBuf inside of your EncrString function? else you will be writing to a zero length char buffer...[/Edit]

-Nathan

P.S. about the static cast stuff... you can probably ignore me, I found that you need to use the little code project buttons to make them show up... Blush | :O

---------------------------
Hmmm... what's a signature?
GeneralRe: Managed strings and buffers to nonmanaged Pin
jspano11-Jul-03 7:23
jspano11-Jul-03 7:23 
GeneralRe: Managed strings and buffers to nonmanaged Pin
jspano11-Jul-03 7:51
jspano11-Jul-03 7:51 
GeneralRe: Managed strings and buffers to nonmanaged Pin
Nathan Blomquist11-Jul-03 11:02
Nathan Blomquist11-Jul-03 11:02 
GeneralRe: Managed strings and buffers to nonmanaged Pin
jspano15-Jul-03 8:56
jspano15-Jul-03 8:56 
Generalstorage of images into oracle database using vc++.net Pin
Shaffiq7-Jul-03 7:49
Shaffiq7-Jul-03 7:49 
GeneralSetup for networks using Vstudio .NET 2003 Pin
BoudewijnEctor3-Jul-03 23:34
BoudewijnEctor3-Jul-03 23:34 
GeneralRe: Setup for networks using Vstudio .NET 2003 Pin
Heath Stewart11-Jul-03 5:59
protectorHeath Stewart11-Jul-03 5:59 
GeneralLinking Errors (operator new redifined) mixing MFC and .NET Pin
DarrylB29-Jun-03 23:56
DarrylB29-Jun-03 23:56 
GeneralMore on mixing managed code and API code Pin
Jeremy Osner27-Jun-03 4:13
Jeremy Osner27-Jun-03 4:13 
GeneralRe: More on mixing managed code and API code Pin
Jeremy Osner27-Jun-03 8:42
Jeremy Osner27-Jun-03 8:42 
GeneralCreating Inherited forms Pin
sivaramakrishna26-Jun-03 19:44
sivaramakrishna26-Jun-03 19:44 
GeneralRe: Creating Inherited forms Pin
Nick Hodapp9-Jul-03 7:04
sitebuilderNick Hodapp9-Jul-03 7:04 
QuestionHow to mix managed code and API code? Pin
Jeremy Osner26-Jun-03 7:41
Jeremy Osner26-Jun-03 7:41 
AnswerRe: Figured it out! Pin
Jeremy Osner26-Jun-03 7:49
Jeremy Osner26-Jun-03 7:49 
GeneralRe: Figured it out! Pin
Nathan Blomquist27-Jun-03 1:54
Nathan Blomquist27-Jun-03 1:54 
GeneralRe: Figured it out! Pin
Jeremy Osner27-Jun-03 2:20
Jeremy Osner27-Jun-03 2:20 
Generalconverting an idl file to .h Pin
si_6926-Jun-03 0:37
si_6926-Jun-03 0:37 

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.