Solved

VS2008 Form Loading Error - module not found?

Posted on 2014-11-21
2
160 Views
Last Modified: 2014-11-21
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

0
Comment
Question by:EQUINN
  • 2
2 Comments
 
LVL 1

Accepted Solution

by:
EQUINN earned 0 total points
ID: 40458940
Problem solved. I copied some support files from the debug directory to the release directory and that did the trick. I had always thought it was the other way around.
0
 
LVL 1

Author Closing Comment

by:EQUINN
ID: 40458942
Solved it on my own
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If your app took Google’s lash recently, here are the 5 most likely reasons.
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
This video demonstrates how to use each tool, their shortcuts, where and when to use them, and how to use the keyboard to improve workflow.
The viewer will learn how to successfully download and install the SARDU utility on Windows 8, without downloading adware.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now