Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4563096
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T18:18:33+00:00 2026-05-21T18:18:33+00:00

Trying to access an old c++ dll from c# using Dll Import. Been searching

  • 0

Trying to access an old c++ dll from c# using Dll Import.
Been searching around the net for aprox 4 days now without success.

I’m trying to use the c++ dll from an asp.net mvc 3 website .net 4.

I’ve changed platform target to x86.
I’ve set “Enable 32 bit application” to true on the application pool in iis.

Using Windows Server 2008 R2 with iis 7.5

Is there some way to debug this or get more info about what might be wrong?

The link ASP.NET P/Invoke "An attempt was made to load a program with an incorrect format" states that:

“To use the 32 bit dll, your web application has to run in 32 bit mode, which is done by switching IIS to run in 32 bit mode” and gives a link about how you can change this, however this seems only to concern IIS 6 and asp.net 2

Thanks in advance!
Best Regards

Edit 1:
Would an erroneous declaration of the c++ method calls in c# result in this error? Reading the error one could guess that calling a function with 3 params that should receive 4 would result in this error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T18:18:34+00:00Added an answer on May 21, 2026 at 6:18 pm

    Well to answer your last question:

    Would an erroneous declaration of the C++ method calls in c# result in this error?

    No, I don’t believe that it would – erroneous declaration of the C++ method could result in a number of things happening ranging from the function executing correctly to an interop exception being thrown, however I don’t believe that this exception would be thrown – this is specific to a problem loading the dll.

    You should check to make sure that the process attempting to load this dll is actually a 32-bit process by somehow obtaining the process ID (e.g. by catching and logging the exception), and then checking in task manager. If the process is actually a 64-bit process then you may have incorrectly configured something.

    You should also check to ensure that the dll you are attempting to load (and all its dependencies) are in fact 32-bit – I believe that you will experience a similar issue if you attempt to load a 64-bit dll into a 32-bit process. You should be able to use Dependency walker (an all-round very useful tool) to check this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to access a .NET Assembly that I have created in
How delphi7 access C# .net managed dll ? i'm trying to access some DLL
I'm trying to update an old Access database using SQL scripts, but I can't
I'm trying to access ManagementObjects in ManagementObjectCollection without using a foreach statement, maybe I'm
Im trying to access a web service from a remote computer. I managed to
I am trying to access Outlook 2007 from C#. I have installed the PIA
I am trying to access a view inside a splitter from my mainframe. At
I'm trying to access elements using jquery $('#elementID') method. If any element contain .
I'm trying to access the Facebook API Admin.getMetrics method via jQuery. I'm correctly composing
I'm trying to access the Reporting Services via Web Services in my Visual Studio

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.