Link to home
Start Free TrialLog in
Avatar of Elena Quinn
Elena Quinn

asked on

VS2008 Form Loading Error - module not found?

I hope this is simple.  I am debugging someone elses code.  Prior version have worked in debug mode just fine, but this one is not even loading the main form.  It throws the error "The specified module could not be found. (Exception from HRESULT: 0x8007007E)".  

The command line it is hanging up on is "Application::Run(gcnew Form1());".  Below is the code.

I have compared this with the previous versions that worked and see no differences.  I also replaced the Form1.h and Form1.resx files with older ones to see if maybe one of them was corrupted.

I am new to this so please be gentle.  It wouldn't surprise me if it was something super obvious.  Though I didn't see this topic on my search.

Thanks in advance for your help.


int main(array<System::String ^> ^args)
{
	try
	{
		bool ok = false;
		
		System::Threading::Mutex^ m = gcnew System::Threading::Mutex(true, "REDACTED", ok);
		if (! ok)
		{
			MessageBox::Show("Another instance is already running","ERROR",MessageBoxButtons::OK,MessageBoxIcon::Error);
			return 0;
		}

		// Enabling Windows XP visual effects before any controls are created
		Application::EnableVisualStyles();
		Application::SetCompatibleTextRenderingDefault(false); 

		// Create the main window and run it
		Application::Run(gcnew Form1());
		GC::KeepAlive(m); 
	}
	catch(Exception^ ex)
	{
		MessageBox::Show("Application Exception: "+ex->Message,"ERROR",MessageBoxButtons::OK,MessageBoxIcon::Error);

	}
	return 0;

}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Elena Quinn
Elena Quinn

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Elena Quinn
Elena Quinn

ASKER

Solved it on my own