Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. win32 dll is not working for c# application.

win32 dll is not working for c# application.

Scheduled Pinned Locked Moved C#
helpcsharp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Le rner
    wrote on last edited by
    #1

    Hi all, this error comes when i am using win32 dll in c# application. An unhandled exception of type 'System.BadImageFormatException' occurred in Test.exe Additional information: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) please help me for this. thanks in advance.

    T 1 Reply Last reply
    0
    • L Le rner

      Hi all, this error comes when i am using win32 dll in c# application. An unhandled exception of type 'System.BadImageFormatException' occurred in Test.exe Additional information: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) please help me for this. thanks in advance.

      T Offline
      T Offline
      Thomas Krojer
      wrote on last edited by
      #2

      32/64 bit mismatch! you have to set the target cpu to x86, then it will work.

      I cannot remember: What did I before google?

      L 1 Reply Last reply
      0
      • T Thomas Krojer

        32/64 bit mismatch! you have to set the target cpu to x86, then it will work.

        I cannot remember: What did I before google?

        L Offline
        L Offline
        Le rner
        wrote on last edited by
        #3

        but both are build on same machine and platform.

        T 1 Reply Last reply
        0
        • L Le rner

          but both are build on same machine and platform.

          T Offline
          T Offline
          Thomas Krojer
          wrote on last edited by
          #4

          if you are running a .net application, build for target "any cpu", the program will start as a 64 bit application - if the machine is running a 64 bit windows. and if your win32.dll (doesn´t sound like an .net dll) is build for 32 bit (why do i think it is? maybe the 32 in win32.dll?, then it is not possible. you have to build the .net app explicitly for x86 target. dot.

          I cannot remember: What did I before google?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups