CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 1999
    Posts
    158

    Global variables with dialogs

    I am working on an email package and would like to click a button in the addressbook dialog box and have the email address appear in the TO: edit box of the Sendscreen. One way is to declare a global variable to hold the address and transfer it that way, but I am not sure in which dialog the global variable would be decarled and how to transfer the address over. I hope this makes sense.

    Thanks

    Louise



  2. #2
    Join Date
    Sep 1999
    Location
    Santa Clara, California
    Posts
    145

    Re: Global variables with dialogs

    Hi Louise,
    One way to do this might be as follows:

    The addressbook dialog class has a public member called "CString field_to". When you click on the Address Book button (which I assume to be in the same dialog for the new message), the addressbook dialog opens and the user makes a selection (or cancels) and on closing, the adresssbook dialog code sets the value for "field_to" appropriately. (note that additional fields could be configured/set in the same way using additional containment variables). When the addressbook.DoModal() returns, the new_message code immediately checks the value for addressbook.field_to and, if valid, either sets the TO field to the addressbook.field_to value, or appends the addressbook.field_to value to the end of a list. This, I think, would only work if the send_message window owns the addressbook dialog.

    I hope this helps,

    --Kelly



  3. #3
    Join Date
    Jun 1999
    Posts
    158

    Re: Global variables with dialogs

    I have tired to declare a variable of the Sendscreen and try to bring the address from the addressbook into the sendscreen but it is not working. I either get the error that the variable for the sendscreen is an undeclared identifier or if the make it a sendscreen variable it will not but the addresss in the sendscreen. What I need to do is declare it as a dummy global variable, but I am not sure how to do this.

    Louise


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured