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

Managed C++/CLI

 
QuestionWarnings in c++/cli that make me a lot of headache Pin
hansipet29-Aug-07 23:07
hansipet29-Aug-07 23:07 
AnswerRe: Warnings in c++/cli that make me a lot of headache Pin
George L. Jackson30-Aug-07 1:53
George L. Jackson30-Aug-07 1:53 
GeneralRe: Warnings in c++/cli that make me a lot of headache Pin
hansipet30-Aug-07 2:19
hansipet30-Aug-07 2:19 
GeneralRe: Warnings in c++/cli that make me a lot of headache Pin
George L. Jackson30-Aug-07 2:53
George L. Jackson30-Aug-07 2:53 
GeneralRe: Warnings in c++/cli that make me a lot of headache Pin
hansipet30-Aug-07 20:19
hansipet30-Aug-07 20:19 
QuestionRe: Warnings in c++/cli that make me a lot of headache Pin
George L. Jackson31-Aug-07 0:07
George L. Jackson31-Aug-07 0:07 
AnswerRe: Warnings in c++/cli that make me a lot of headache Pin
hansipet31-Aug-07 1:57
hansipet31-Aug-07 1:57 
GeneralRe: Warnings in c++/cli that make me a lot of headache Pin
George L. Jackson31-Aug-07 9:25
George L. Jackson31-Aug-07 9:25 
The only way I could get native static objects to work in managed code was to place them inside of static functions or static methods. For example:
#pragma managed(push, off)
using std::wstring;
 
class Foo
{
public:
 
	static const wchar_t* State(const wchar_t* value = 0)
	{
		static std::wstring state= L"";
 
		if (value != 0)
			state = value;
 
		return state.c_str();
	}
 
};
#pragma managed(pop)
 
using namespace System;
 
int main(array<System::String ^> ^args)
{
	String^ str1 = gcnew String(Foo::State());
 	
	Foo::State(L"Hello!");
 
	String^ str2 = gcnew String(Foo::State());
 
	Console::WriteLine(str1);
	Console::WriteLine(str2);
 	
    return 0;
}




"We make a living by what we get, we make a life by what we give." --Winston Churchill

GeneralRe: Warnings in c++/cli that make me a lot of headache Pin
hansipet1-Sep-07 8:55
hansipet1-Sep-07 8:55 
GeneralRe: Warnings in c++/cli that make me a lot of headache Pin
George L. Jackson30-Aug-07 3:51
George L. Jackson30-Aug-07 3:51 
Questionmixed types are not supported? Pin
Rui A Sousa29-Aug-07 6:45
Rui A Sousa29-Aug-07 6:45 
AnswerRe: mixed types are not supported? Pin
led mike29-Aug-07 7:06
led mike29-Aug-07 7:06 
AnswerRe: mixed types are not supported? Pin
Mark Salsbery29-Aug-07 8:07
Mark Salsbery29-Aug-07 8:07 
QuestionMaking Dialog Boxes Modal Pin
gunner_uk200029-Aug-07 5:58
gunner_uk200029-Aug-07 5:58 
AnswerRe: Making Dialog Boxes Modal Pin
Mark Salsbery29-Aug-07 8:16
Mark Salsbery29-Aug-07 8:16 
QuestionCan not convert from short __gc* to short* Pin
Thanks for all the fish28-Aug-07 23:41
Thanks for all the fish28-Aug-07 23:41 
AnswerRe: Can not convert from short __gc* to short* Pin
led mike29-Aug-07 5:16
led mike29-Aug-07 5:16 
GeneralRe: Can not convert from short __gc* to short* Pin
Mark Salsbery29-Aug-07 8:17
Mark Salsbery29-Aug-07 8:17 
GeneralRe: Can not convert from short __gc* to short* Pin
George L. Jackson29-Aug-07 12:05
George L. Jackson29-Aug-07 12:05 
GeneralRe: Can not convert from short __gc* to short* Pin
Mark Salsbery29-Aug-07 12:45
Mark Salsbery29-Aug-07 12:45 
GeneralRe: Can not convert from short __gc* to short* Pin
George L. Jackson29-Aug-07 13:00
George L. Jackson29-Aug-07 13:00 
QuestionCalling into .NET Class Lib from a C++ app Pin
concoran28-Aug-07 21:04
concoran28-Aug-07 21:04 
AnswerRe: Calling into .NET Class Lib from a C++ app Pin
led mike29-Aug-07 5:13
led mike29-Aug-07 5:13 
GeneralRe: Calling into .NET Class Lib from a C++ app Pin
concoran30-Aug-07 14:05
concoran30-Aug-07 14:05 
GeneralRe: Calling into .NET Class Lib from a C++ app Pin
led mike31-Aug-07 4:20
led mike31-Aug-07 4: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.