• Advertisement
Sign in to follow this  

Windows Forms C++ Syntax help

This topic is 3653 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to add my own idle function but this line is not valid. void App_Idle(System::Object sender, System::EventArgs e) Application::Idle += System::EventHandler(App_Idle); Error : cannot convert from 'void (__clrcall *)(System::Object,System::EventArgs)' to 'System::EventHandler' What am I missing ? heres the full code below,
#include "stdafx.h"
#include "Form1.h"

using namespace System;
using namespace BlackJackForm;

int i = 0; //is this legal code ?

void App_Idle(System::Object sender, System::EventArgs e) 
{
	i++;
}

[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
	// Enabling Windows XP visual effects before any controls are created
	Application::EnableVisualStyles();
	Application::SetCompatibleTextRenderingDefault(false); 
	Application::Idle += gcnew System::EventHandler(App_Idle); 
	i = 3;
	// Create the main window and run it
	Form1 ^MainForm;
	MainForm = gcnew Form1();
	Application::Run(MainForm);

	return 0;
}



[Edited by - fishleg003 on February 18, 2008 7:11:54 AM]

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement