ATL component written in VC.NET 2002 won't register on non .NET machine 
Author Message
 ATL component written in VC.NET 2002 won't register on non .NET machine

I have recently upgraded to Visual C++.NET and have written a small ATL
based component which I want to use on both .NET and non .NET enabled
machines. When running regsvr32.exe on a .NET enabled machine, the component
registers perfectly, but when I try and register on a non .NET machine,
regsvr32 throws the following error:

LoadLibrary("file.dll") failed - the specified module could not be found

What could be the cause of this? Am I missing something here? Or do I have
to go back to VC6 to write ATL components?

----------------------------
Peter Mares



Sun, 01 May 2005 07:36:59 GMT  
 ATL component written in VC.NET 2002 won't register on non .NET machine
Hi Peter,
It can be explained like this:
I believe that your compiled DLL is just a MSIL DLL (Microsoft Intermediate
Language - IL for short), althought it looks like the plain old DLL. You can
dump it to see how thing's going-:).
When we load a .Net executable, the system loader notes that it is managed
code and loads it into the CLR engine. The engine will note that the file
contains IL, so it will invoke the just-in-time compiler, JITer. The JITer
is a system tool that converts IL into native code for whichever processor
and OS it runs on. The JITer produces native code, which the CLR engine will
begin to execute.

So the solution is that you may have to use VC++6.0 or specify that JIT
compilation to be performced once, and then produce the native code as it is
for non-.Net application. Sorry that I'm new to .Net also, so I don't know
exactly how to do it, but someone told me that you can do it with the tool
Ngen.exe, the native image generator.
Hope this help,
Tuan Le



Sun, 01 May 2005 23:26:29 GMT  
 ATL component written in VC.NET 2002 won't register on non .NET machine
HI Rocky, I see where you're coming from but ATL isn't part of the "Managed
Extensions" as far as I understand. the DLL is definately compiled as native
code :)


Quote:
> Hi Peter,
> It can be explained like this:
> I believe that your compiled DLL is just a MSIL DLL (Microsoft
Intermediate
> Language - IL for short), althought it looks like the plain old DLL. You
can
> dump it to see how thing's going-:).
> When we load a .Net executable, the system loader notes that it is managed
> code and loads it into the CLR engine. The engine will note that the file
> contains IL, so it will invoke the just-in-time compiler, JITer. The JITer
> is a system tool that converts IL into native code for whichever processor
> and OS it runs on. The JITer produces native code, which the CLR engine
will
> begin to execute.

> So the solution is that you may have to use VC++6.0 or specify that JIT
> compilation to be performced once, and then produce the native code as it
is
> for non-.Net application. Sorry that I'm new to .Net also, so I don't know
> exactly how to do it, but someone told me that you can do it with the tool
> Ngen.exe, the native image generator.
> Hope this help,
> Tuan Le



Sun, 01 May 2005 10:06:07 GMT  
 ATL component written in VC.NET 2002 won't register on non .NET machine
Hi Peter,
The error happens as your new ATL dll use the newer ATL DLLs that comes with
VC++7.0. You can set the project property [Use of ATL] "Not using ATL" or
"Static Link to ATL" to fix that error.
Hope this help -:)
TL


Mon, 02 May 2005 18:47:57 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. ATL component written in VC.NET 2002 won't register on non .NET machine

2. Problem converting VC6 ATL component to a .NET 2003 VC ATL component

3. Can't Install VC++.NET 2002

4. Interop problem with VC.NET ATL Component..

5. Make Windows Form Application with VC++.NET 2002 using a visual form

6. VC++.NET (2002):Fatal Error C1189-Please use the /MD switch for _AFXDLL builds

7. Managed VC++.NET (2002): Run the .exe file in the Debug or Release Folder

8. How to run an Excel 2002 macro from VC++.Net

9. MyDll-Executable for Debugging Session in VC++.NET (2002)

10. Bug in VC++.net 2002: nested structs

11. Compile error on generated ActiveX MFC wrapper class ( VC++7, VS.NET 2002 )

12. resx-files in vc++.net 2002

 

 
Powered by phpBB® Forum Software