Jump to content

Forms Application


lt_navvara

Recommended Posts

I won't be posting this at once since my putter keeps restarting, i'll be editing it very often instead.

 

So i finnaly got the program and it's grat 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.

Edited by lt_navvara

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...