.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

C# Dllimport and 64-bits HRESULT 0X8007000B

Posted By:      Posted Date: October 20, 2010    Points: 0   Category :.NET Framework
Hi everyone,

I have developped a small C sharp application on Visual Studio Express that has to use an external DLL. This DLL is provided by a third party.

I use Dllimport for doing that. Everything goes fine and my application runs fine on XP 32 and Vista 32.

Then I sent the application to someone who has Vista 64. At the exact step where the application tries to invoke a function from this DLL for the first time, he gets the error:

View Complete Post

More Related Resource Links

"Exception from HRESULT: 0x800AC472"


Am Exporting Data in to Excel File,meanwhile if i open any other Excel file than the excel File on which am exporting data gets opened up Automatically having name Book1.How should i stop these excel file not to get open.In the Error log i get an error message showing " Exception from HRESULT: 0x800AC472" . Need help on these.Thanks in Advance.

Foundations: Bitmaps and Pixel Bits


Charles Petzold takes an inside look at the flexible bitmap pixel formats offered by the retained-mode graphics features of Windows Presentation Foundation.

Charles Petzold

MSDN Magazine June 2008

BITS: Write Auto-Updating Apps with .NET and the Background Intelligent Transfer Service API


Both the .NET Framework and Windows have some very interesting APIs for creating applications that are capable of updating themselves automatically over a network. There are many advantages to writing your application to update itself like Windows Update does, including convenience for your users, from easier maintenance to network administration. Automatic updates require attention to factors such as discovery, security, and file replacement. In this article, the author covers the BITS API as well as a number of features of the .NET Framework that take care of these facets of auto-updating using the same facilities that the Windows Update uses.

Jason Clark

MSDN Magazine February 2003

DllImport of 32-Bit dlls

Hi guys, I am a real newbie on 64-Bit progr. so my question might sound a little stupid. I have a VB.NET project which refered to a 32-Bit dll via COM-Interop. I migrated the project and the COM invocation does not work anymore. I tried several compiler settings (anyCPU, x86) but nothing helped. Then I found in my old C# book a method called DllImport (System.Runtime.InteropServices) I declared the dll as follows: <DllImport("fcvb.dll", CharSet:=CharSet.Auto)> _ Function dllBIN2_iv(ByVal price_u As Double, ByVal ex As Double, ByVal d_exp As Double, ByVal d_v As Double, ByVal price As Double, ByVal rate_ann As Double, ByVal acc_rate As Integer, ByVal cost_hldg As Double, ByVal acc_cost_hldg As Integer, ByVal option_type As Integer, ByVal iter As Integer, ByRef return_vlty_imp As Double) As Integer End Function When calling the Dll I got f... in the middle of the process saying: errMsg = "System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)   at Wcr_.NET_2005.Module1.dllBIN2_iv(Double price_u, Double ex, Double d_exp, Double d_v, Double price, Double rate_ann,... I am running an AMD64-Bit Opteron with 2GIG of Mem on Windows Server 2003 (64-Bit) Standard. Visual Studio 2005 Team Edition for SW Developers and .NET Framework 2.0   Any comments welcome I am open for both a COM wrapper .NET dll or n

error HRESULT E_FAIL has been returned from a call to a COM component

hello every one i see this error some times when i designed the page and close the program and came back.but this error do not stop debugging the page and hide all controls is my page and i cant use smart tag and see the controls.what should i do?

"Exception from HRESULT 0x800A5077"

Hi, I am using  VS2005 and Crystal Report 8.5. Yesterday I was working with report. It was working nice. Showing the report as per recordselectionformula. After some time it was not working. When I tried to show the report it is showing "Exception from HRESULT 0x800A5077 " What could be the reason and how can i fix it. Please help me.

dllimport("mapi32.dll") changes the path context of application (i.e. relative paths start pointing

I have a WPF desktop application. We use mapi32.dll to show a new outlook mail window to allow user to send an email. After user sends email / just closes the new mail window without sending email, relative path starts pointing to C:\Program Files\Microsoft Office\Office12. I have office 2007 installed.  How can I restore this relative path ?   Thanks & Regards, Nadeem Ullah

CAPICOM on Windows 2008 R2 64 bits

Hi there, I have classic asp and ASP.NET application. Both applications are using CAPICOM. I am in a process of upgrading the servers to win 2008 R2 and IIS 7.5. However I am having problems with CAPICOM. I have installed it but cannot manage to use it. The asp applications gives an error: Server object error 'ASP 0177 : 800401f3' Server.CreateObject Failed Also, when trying to run regsvr32.exe CAPICOM.DLL I am getting: The module "CAPICOM.DLL" may not compatible with the version of Windows that you're running. Check if the module is compatible with an x86 (32-bit) or x64 (64-bit) version of regsvr32.exe. Does anyone have any idea of how to work with CAPICOM on 64 machine? Or maybe change the site setting on IIS to run as 32 bit application? Many thanks NZ    

Path too long (Exception from HRESULT: 0x80010135)

Hi I have recieve this error any idea how to solve it Path too long (Exception from HRESULT: 0x80010135) ThanksMomo

Exception from HRESULT: 0x81070215

When I try to access the Site Collection Features link in the Settings page of one of my SharePoint site collections I get the following error: Exception from HRESULT: 0x81070215 at Microsoft.SharePoint.Library.SPRequestInternalClass.LocalizeXml(String bstrXmlPath, String bstrFeatureDefinitionId, String bstrFeatureRoot, UInt32 lcid, String bstrDefaultResourceToken) at Microsoft.SharePoint.Library.SPRequest.LocalizeXml(String bstrXmlPath, String bstrFeatureDefinitionId, String bstrFeatureRoot, UInt32 lcid, String bstrDefaultResourceToken) I have no access to the Site Collection Features because of this except through the STSADM.  Is there a fix or workaround? 

Getting Error " Error occurred in deployment step 'Add Solution': Exception from HRESULT: 0x810702

i'm getting the following error when deploying my sharepoint project i've created 3 site templates by adding according to this article http://www.sharepointbits.com/blog/sharepoint-2010-custom-site-templates.html but when i deployed my project i got the following Error occurred in deployment step 'Add Solution': Exception from HRESULT: 0x8107026E

SSRS 2008: Failed to unload app domain DefaultDomain. Exception from HRESULT: 0x80131015

I have a SQL Server Reporting Services 2008 giving this error in Event Viewer.Failed to unload app domain DefaultDomain. The following exception occurred: Error while unloading appdomain. (Exception from HRESULT: 0x80131015).

KB979445 32-bits version not available for download anymore

Hi, I tried to download the patch KB9797445 32-bits version this morning but it isn't available anymore (the 64-bit version is still available). Has anyone an idea why this is. thanks.R. van Maurik

The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Hi, When I deploy the asp.net application on 64 bit OS mechine I am getting the following error. The same application is running properly in 32 bit mechine. Error : The specified module could not be found. (Exception from HRESULT: 0x8007007E) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E) Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  Stack Trace: [FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)]   System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0   System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +211   System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stack

DataProviderSAP in server windows 2008 64 bits

I tried install DataProviderSAP in server windows 2008 64 bits but happened one error. The error happened because the program can not write in file Erro: Verify that you have access to that directory c:\\windows\winsx

MSDN sample Dllimport unable to load DLL



I tried out the sample described in MSDN "extern (C# reference)" (Example 2 and 3, the one which created an unmanaged dll called Cmdll.dll, then used it in cm.cs)

It doesn't work. I'm guessing path problem. Following is the error message.

Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'Cmdll': Th
e specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at MainClass.SampleMethod(Int32 x)
   at MainClass.Main()

The generated dll is in the same folder as the cm.exe. I copied the dll to the System32 folder. None works.

Any help appreciated.


Error HRESULT E_Fail



I created a simple page calling the DateTime.Now.ToString on a page ran the page it came up eventually but then when I went back to my .net page there is an error:

Error Creating Control - Label1

Error HRESULT E_FAIL has been returned from a call to a COM component.

If I try to run the page again I get there is no problem but the error on the default.aspx page in design view still exists.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend