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

Managed C++/CLI

 
GeneralRe: Managed DLL with unmanaged MFC application Pin
rahtrow11-Jul-03 8:31
rahtrow11-Jul-03 8:31 
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 
OK I'm about to throw MC out the window.

Here is my code
<br />
void CAES::EncryptStr(String* EncString, StringBuilder* Buff)<br />
	{<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 />
<br />
		int Ret;<br />
<br />
		Ret = EncryptString(pStr,pBuf);<br />
		<br />
		Buff->Remove(0,Buff->Length); // this clears the StringBuilder<br />
		Buff->Append(new String(pBuf)); // adds the result to the StringBuilder<br />
<br />
	}<br />

This worked fine a few mins ago. NOTHING HAS CHANGED IN THE WHOLE PROJECT!!! Now I get an unhandled exception in mscorlib. It is a stack overflow exception. It happens on the Buff->Remove line. If I take it out it happens on the Buff->Append line.

The only think I did was make some functions in the non managed class I have private with the private: keywork in my header. After this it broke. I removed the private keyword and it's still broke.

Any ideas?


Further info: It happens when I call any framework thing after comming back from the dll also. I tried to show a messagebox and it failed also. This was after the call to EncryptString. I removed the Buff-> stuff so the method would return. It doesn, but I get the exception after it gets back now.
GeneralRe: Managed strings and buffers to nonmanaged Pin
Nathan Blomquist11-Jul-03 7:20
Nathan Blomquist11-Jul-03 7:20 
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 

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.