Error 193 Loading Dll
Contents |
Studio Languages , .NET Framework > Visual C# Question 0 Sign in to vote I had a program loadlibrary return 193 developed in C# VS2010 and VS2005. The programstill worksjust fine on error loading dll cryrenderd3d9.dll error code 193 all Window OSs from Win 2000->XP->Windows 7. All 32 bit versions. The problem came when this program runs critical error error loading dll xrenderd3d9.dll error code 193 on 64 bit Windows7. The program fails during the call to LoadLibrary(). Used P/Invoke method to use this function. The LoadLibrary fails with any dll and not only the
Failed To Load Java Vm Library Jvm Dll Error 193
one I want. My project settings are "built on x86" and the Target Platformas "Any CPU". Infact I tried a small program(thinking that My original program is buggy), a windows forms application with two buttons. OneButton willuse LoadLibrary() and one for FreeLibrary(). Same issue on 64 bit. The LoadLibrary fails with error code 193. used same P/Invoke method loadlibraryex startup dll failed with error 193 for making use ofthe native kernel32.dll in the System32 folder.Can anyone point me if I need to do anything additonal for the program to work. I am using the C# VS2010 for development and still has to use .Net 2.0. Any suggestion is greatly appreciated. Thanks. Here is my code: using using using using using using using using using using using namespace { { public Form1() public class UnManagedCodeB { InitializeComponent(); } { #region Kernel32 DLL Import Functions arSet = CharSet.Auto, BestFitMapping = false, SetLastError = true)]
public static extern IntPtr LoadLibrary(string lpFilename); [ [ [ [ [ #endregion } { m_DllHandle = { {error_code = M } } { error_code = U } } { } nManagedCodeB.GetLastError(); MessageBox.Show(error_code.ToString(), "Dll Handle Return code"); Application.Exit(); private void button3_Click(object sender, EventArgs e) UnManagedCodeB.FreeLibrary(m_DllHandle); } catch (Exception x) MessageBox.Show(x.Message, "DLL Loading problem(LoadUSBLibrary())!");if (m_DllHandle == IntPtr.Zero) UnManagedCodeB.GetLastError(); essageBox.Show(error_code.ToString(), "Dll load failed(LoadLibrary()"); throw new Applbe down. Please try the request again. Your cache administrator is webmaster. Generated Mon, 10 Oct 2016 16:55:02 GMT by s_ac15 (squid/3.5.20)
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this http://stackoverflow.com/questions/24906300/inexplicable-error-193-with-loadlibrary-of-a-c-dll-using-clr site About Us Learn more about Stack Overflow the company Business Learn more http://stackoverflow.com/questions/6532915/error-could-not-load-dll-error-value-193 about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Inexplicable error error 193 193 with LoadLibrary of a C++ DLL using \clr up vote 1 down vote favorite We have an user interface developped in C++ using Boost 1.54.0 and QT 4.8.6. This interface can call computation module. Each module must implement a (non pure) abstract class and be linked to a given .lib generated during interface compilation. After launching the interface, we indicate the path of failed with error the module dll which is loaded using QLibrary. Everything worked perfectly with native C++ module but recently we started developping new modules using .NET 3.5 (C#). We want the interface can call this module so we decided to create an intermediate c++ project using \clr : this project implements the abstract class and can call managed .NET code thanks to \clr mode. Now we have a big problem : we cannot achieve to load correctly the intermediate C++ problem. We tried with the kernel32 method LoadLibrary and we obtained an error code 193 (ERROR_BAD_EXE_FORMAT). It is very surprising because all the projects are compiled for Win32/x86 and the computer is using a Windows Vista 32 bits. Everything seems normal with dependancy walker : We used dumpbin but everything seemed normal : Microsoft (R) COFF/PE Dumper Version 9.00.30729.01 Copyright (C) Microsoft Corporation. All rights reserved. Dump of file Lien.dll PE signature found File Type: DLL FILE HEADER VALUES 14C machine (x86) 6 number of sections 53CF72B5 time date stamp Wed Jul 23 10:30:45 2014 0 file pointer to symbol table 0 number of symbols E0 size of optional header 2102 charact
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error :Could not load dll.Error value 193 up vote -3 down vote favorite Can anyone tell me the cause of this error? Error:Could not load dll.Error value 193 I am trying to load the dll (I am using VS2005,C++ is the language) into the device(windows mobile) and execute it. When i do this , I get an error as said above. c++ windows mobile share|improve this question asked Jun 30 '11 at 9:47 Guest 1 1 We'll need more to go on than this. –Lightness Races in Orbit Jun 30 '11 at 9:49 what dll would that be? –Default Jun 30 '11 at 9:57 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote Possibly stupid answer, but has the DLL been built for the specific OS version and architecture of the device you're running it on. e.g. Windows Mobile 7, ARM. If it's a desktop DLL, or a DLL for a different architecture (e.g. MIPS versus ARM), it will not work. If its the right architecture but different version it may not work (e.g. Windows Mobile 6 DLL on Windows Mobile 5). share|improve this answer answered Jun 30 '11 at 9:56 Shane MacLaughlin 14.8k762120 There is no mismatch in the version which is built and used. –Guest Jun 30 '11 at 10:02 The error code says there is a mismatch. –Hans Passant Jun 30 '11 at 10:31 There is absolutely no problem while I load other dlls. –Guest Jun 30 '11 at 10:36 If it's a DLL that you have source for, why not compile it as a static lib and link it into your main EXE? If you don't have the source, what tools are you using to check the validity of the DLL for your platform? –Shane MacLaughlin Jun 30 '11 at 12:40 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged c++ windows mobile or ask your own question. asked 5 years ago viewed 735 t