Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Creating multiple forms

Creating multiple forms

Scheduled Pinned Locked Moved C / C++ / MFC
helpcsharpvisual-studiosysadminarchitecture
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    navvara the infantryman
    wrote on last edited by
    #1

    I dunno if this is the right palce for this but i'm new to this forum so bear with me. So i finnaly got Visual studio.net 2003 and it's great i cannot believe how stupid i was to be sticking with visual studio instead of this. There's so many new things i can do with it, includinga form based application. But here's the problem: I want to have some sort of a connection between different forms, have one form start another but when i try to run another form and launch it from a form by calling Application::Run(new newForm); i get the following message: "starting a second message que on a thread is illegal". i can start a new form without getting this message, or any other error by calling either Application::Exit or Form::dispose, these both kill the old form's message que instanly and allow me to run a new form. the problem here is that the new form runs and closes imediately. I really need my program to start new forms from another, lets say when a button is pressed so any ideas guys? i have some of my own but i dunno how to implement them: -having the form return a value to the winmain function and let the form creation be handled there, unfortunately i dunno how to have a form return a value and writing a return 1 in the button's code won't help as the button is declared as a void function. besided since the form is a deiiferent application from the winmain the mesage won't know where to go. -making an invisible window and letting that run and receive messages from forms an handle the creation. i think that SendMessage or similar funtions would work but the problem here is that since the form is an external app i dunno how to get the invisible's window handle -starting a new thread whenever a new form is to be created, this might work ut it's too complicated and due to the architecture of my app i ould rather not use it. -calling Form::StartDialog(new newForm); won't do the trick for me although it's recomended by the error message. One other thing, whatever method you (hopefully) propose i would like it to include some sort of external function or callback that handles the form creation as in version 2 of the app i plan to have it receive it's messages through directplay rathr than them being sent by a form running on that putter (have forms creation messages sent by a remote putter and have a sort of clien-server app). A method that just links forms together would also be fine, actually anything would be fine. m$: It is normal for your screen to go blank and for your computer to

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups