Click here to Skip to main content
16,005,080 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: problem with converting CString to int Pin
tydok18-Oct-06 4:02
tydok18-Oct-06 4:02 
QuestionFrom CString to String^ Pin
Epi11-Oct-06 0:41
Epi11-Oct-06 0:41 
AnswerRe: From CString to String^ Pin
Nish Nishant11-Oct-06 4:08
sitebuilderNish Nishant11-Oct-06 4:08 
Questiontreeview with windows forms Pin
Epi10-Oct-06 2:12
Epi10-Oct-06 2:12 
AnswerRe: treeview with windows forms Pin
jhwurmbach10-Oct-06 2:35
jhwurmbach10-Oct-06 2:35 
GeneralRe: treeview with windows forms Pin
Epi10-Oct-06 3:27
Epi10-Oct-06 3:27 
QuestionInvoke a method on a windows form object Pin
bankai1239-Oct-06 21:08
bankai1239-Oct-06 21:08 
QuestionAvoiding "using namespace" Pin
zaccheus9-Oct-06 13:31
zaccheus9-Oct-06 13:31 
Namespaces are great - but there are rather many of them in .net, even just in the framework.

So I've been wondering how to deal with them in a safe yet readable way. I don't want to write System::Windows::Forms::DialogResult::OK everytime a use a dialogue box. Neither do I want to simply make every class inside System::Windows::Forms part of the global namespace via a using directive. This question is replicated for the other nested .net namespaces which need to be used.

So the solution I'm considering is this:

<br />
<br />
// stdafx.h<br />
<br />
namespace Rclsoftware    // All my code lives in this namespace.<br />
{<br />
namespace Forms = System::Windows::Forms;<br />
}<br />
<br />
// some source file<br />
<br />
if(Forms::DialogResult::OK == dlg.ShowDialog(this))<br />
{<br />
// ...<br />
}<br />


I'd be interested to hear what people think of this approach, and if there are any potential problems I may have overlooked.

www.rclsoftware.org.uk
AnswerRe: Avoiding "using namespace" Pin
Michael Dunn9-Oct-06 15:13
sitebuilderMichael Dunn9-Oct-06 15:13 
GeneralRe: Avoiding "using namespace" Pin
George L. Jackson9-Oct-06 23:36
George L. Jackson9-Oct-06 23:36 
GeneralRe: Avoiding "using namespace" Pin
zaccheus10-Oct-06 7:59
zaccheus10-Oct-06 7:59 
GeneralRe: Avoiding "using namespace" Pin
Nish Nishant10-Oct-06 9:53
sitebuilderNish Nishant10-Oct-06 9:53 
GeneralRe: Avoiding "using namespace" Pin
zaccheus10-Oct-06 13:10
zaccheus10-Oct-06 13:10 
AnswerRe: Avoiding "using namespace" Pin
George L. Jackson9-Oct-06 23:49
George L. Jackson9-Oct-06 23:49 
GeneralRe: Avoiding &quot;using namespace&quot; Pin
zaccheus10-Oct-06 8:08
zaccheus10-Oct-06 8:08 
Questionnewbie question Pin
ddpn428-Oct-06 17:28
ddpn428-Oct-06 17:28 
AnswerRe: newbie question Pin
bankai1238-Oct-06 18:08
bankai1238-Oct-06 18:08 
GeneralRe: newbie question Pin
ddpn429-Oct-06 4:25
ddpn429-Oct-06 4:25 
QuestionTranslate from C# some code. Pin
Tomas7-Oct-06 7:48
Tomas7-Oct-06 7:48 
AnswerRe: Translate from C# some code. Pin
Dave Doknjas7-Oct-06 13:56
Dave Doknjas7-Oct-06 13:56 
QuestionPopup blockers Pin
ArvindMaadam7-Oct-06 1:53
ArvindMaadam7-Oct-06 1:53 
AnswerRe: Popup blockers Pin
hexorandor9-Oct-06 0:31
hexorandor9-Oct-06 0:31 
GeneralRe: Popup blockers Pin
ArvindMaadam9-Oct-06 2:05
ArvindMaadam9-Oct-06 2:05 
QuestionURGENT HELP Pin
bakararshad6-Oct-06 7:52
bakararshad6-Oct-06 7:52 
AnswerRe: URGENT HELP Pin
led mike6-Oct-06 8:46
led mike6-Oct-06 8:46 

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.