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

Managed C++/CLI

 
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 "using namespace" 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 
Hello,

I am trying to translate a component from C# to C++/CLI.

This component is in this link http://www.codeproject.com/csharp/persistwindowstate.asp[^]

I want to translate this code:

private Form mParentForm;<br />
<br />
[Browsable(false)]<br />
public Form Form<br />
{<br />
  get<br />
  {<br />
    if (this.mParentForm == null)<br />
    {<br />
      if (this.Site.DesignMode)<br />
      {<br />
        IDesignerHost dh = (IDesignerHost)this.GetService(typeof(IDesignerHost));<br />
        if (dh != null)<br />
        {<br />
          Object obj = dh.RootComponent;<br />
          if (obj != null)<br />
          {<br />
            this.mParentForm = (Form)obj;<br />
          }<br />
        }<br />
      }<br />
    }<br />
    return this.mParentForm;<br />
  }<br />
<br />
  set<br />
  {<br />
    if (this.mParentForm != null)<br />
      return;<br />
    if (value != null)<br />
    {<br />
      this.mParentForm = value;<br />
<br />
      // subscribe to parent form's events<br />
      mParentForm.Closing += new System.ComponentModel.CancelEventHandler(OnClosing);<br />
      mParentForm.Resize += new System.EventHandler(OnResize);<br />
      mParentForm.Move += new System.EventHandler(OnMove);<br />
      mParentForm.Load += new System.EventHandler(OnLoad);<br />
<br />
      // get initial width and height in case form is never resized<br />
      mWindowInfo.Width = mParentForm.Width;<br />
      mWindowInfo.Height = mParentForm.Height;<br />
      this.mRegistryPath = "Software\\" + this.mParentForm.CompanyName + "\\" + System.Reflection.Assembly.GetEntryAssembly().GetName().Name;<br />
      this.mXMLFilePath = System.IO.Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly().Location).ToString() + "\\WindowStateInfo.xml";<br />
      this.mWindowStateInfo_DR = mWindowState_DS.WindowStateInfo.NewRow();<br />
    }<br />
  }<br />
}



Can anybody help me?.

Thanks in anticipation.



Tomas.
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 
GeneralRe: URGENT HELP Pin
George L. Jackson6-Oct-06 11:09
George L. Jackson6-Oct-06 11:09 
AnswerRe: URGENT HELP Pin
hexorandor6-Oct-06 11:16
hexorandor6-Oct-06 11:16 
AnswerRe: URGENT HELP Pin
George L. Jackson6-Oct-06 11:20
George L. Jackson6-Oct-06 11:20 
AnswerRe: URGENT HELP Pin
Christian Graus8-Oct-06 9:04
protectorChristian Graus8-Oct-06 9:04 
QuestionPaste does not work [modified] Pin
Dinka6-Oct-06 6:58
Dinka6-Oct-06 6:58 
QuestionGUIDs Pin
Julian Goldsmith5-Oct-06 8:03
Julian Goldsmith5-Oct-06 8:03 
QuestionRewrite this function pointer Pin
bankai1234-Oct-06 20:57
bankai1234-Oct-06 20:57 
AnswerRe: Rewrite this function pointer Pin
User 5838524-Oct-06 21:26
User 5838524-Oct-06 21:26 
QuestionCOM object that has been separated from the underlying RCW can not be used Pin
lafleon4-Oct-06 14:13
lafleon4-Oct-06 14:13 
QuestionOrganization of .cpp and header files. [modified] Pin
bankai1233-Oct-06 13:51
bankai1233-Oct-06 13:51 
AnswerRe: Organization of .cpp and header files. Pin
User 5838523-Oct-06 20:20
User 5838523-Oct-06 20: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.