Solved

VS2008 Form Loading Error - module not found?

Posted on 2014-11-21
2
158 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
Comment Utility
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
Comment Utility
Solved it on my own
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Suggested Solutions

Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
The viewer will learn how to successfully download and install the SARDU utility on Windows 8, without downloading adware.
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…

772 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

14 Experts available now in Live!

Get 1:1 Help Now