-
September 14th, 2005, 03:38 AM
#1
Help on c++ Window Form and Handle
Guys,
i can just create a new item "Form (.net)" and then how can i show the form in my "Main()" execution? subsequently getting the form handle value...
Okay, i got the method working however i bump into another problem here. how can i get through the following?
why is
stop my "Main()" from proceeding ?? by right it is just suppose to launch the form and then still proceed to execute the rest of the code right??
i dont get it please advise?.....
my purpose here is to get the form launch out and proceed with the rest of the remaining code..
Please advise.
Thank You;
Last edited by codegurugeek; September 14th, 2005 at 04:34 AM.
-
September 14th, 2005, 06:38 AM
#2
Re: Help on c++ Window Form and Handle
MSDN documentation is not 100% clear about Run method. This methid is synchronous and returns only when form is closed and disposed:
"The Dispose method of the Form class will be called prior to the return of this method."
After call to Application::Run method you can only add clean-up code to the Main function, which is executed before application exits. If you want to execute some code when form is active, move it to one of form message handlers, for example, Form_Load.
-
September 15th, 2005, 10:31 PM
#3
Re: Help on c++ Window Form and Handle
oh. ya.. that is the point.. instead of calling the application to run... just call out the form to load and then show up would be a definite good idea.. thank you alex f.. let me try it out now.
-
September 16th, 2005, 12:11 AM
#4
Re: Help on c++ Window Form and Handle
Actually, this is not what I suggest. Don't remove Application::Run call. Move the code which you have now after Application::Run from main function to one of form event handlers.
-
September 16th, 2005, 12:44 AM
#5
Re: Help on c++ Window Form and Handle
i dont quite understand your context here. Please elaborate a little further?
Which form event handler do you mean ?
-
September 16th, 2005, 04:56 AM
#6
Re: Help on c++ Window Form and Handle
Please show your existing code and describe what do you want to do.
-
September 16th, 2005, 11:21 AM
#7
Re: Help on c++ Window Form and Handle
Okay, here is the situation...
In the Main() , i have this following method issued to preview the video onto a form.
Declare a form by code and then subsequently getting the form handle in hwnd format.
...
...
...
SetVideoClippingWindow(mywindhandle);
Actually, what i was trying to do is to put the video preview onto a form by passing the form handle into the above "SetVideoClippingWindow function..
-
September 16th, 2005, 12:24 PM
#8
Re: Help on c++ Window Form and Handle
Add Load event handler to the form and move this code to it:
Code:
private: System::Void Form1_Load(System::Object * sender, System::EventArgs * e)
{
SetVideoClippingWindow(get_Handle());
}
To add Load handler you can double-click form in the designer.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|