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. .NET (Core and Framework)
  4. Having trouble with pInvoke, weird behavior.

Having trouble with pInvoke, weird behavior.

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpc++winformsquestion
2 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.
  • D Offline
    D Offline
    dxben
    wrote on last edited by
    #1

    I am trying to pInvoke into a very simple C++ dll I have created, from my C# winforms app. I start by creating a C++ dll using the VC8 wizard, and checking off "export symbols" as I want to call a basic function from C#. By default the wizard creates a sample function and exports it. However when I run my C# app, it says it can't find an entry point for the function name I have defined in my DLLImport attribute. I have made sure that the dll is in the same directory as my C# executable. Incidentally, I can pInvoke fine into other system dlls, so what am I doing wrong?

    D 1 Reply Last reply
    0
    • D dxben

      I am trying to pInvoke into a very simple C++ dll I have created, from my C# winforms app. I start by creating a C++ dll using the VC8 wizard, and checking off "export symbols" as I want to call a basic function from C#. By default the wizard creates a sample function and exports it. However when I run my C# app, it says it can't find an entry point for the function name I have defined in my DLLImport attribute. I have made sure that the dll is in the same directory as my C# executable. Incidentally, I can pInvoke fine into other system dlls, so what am I doing wrong?

      D Offline
      D Offline
      dnewmon
      wrote on last edited by
      #2

      Paste some C/C++ source code about the function and the C# [DllImport] method. The problem is probably the fact that the exported function is decorated. If you know nothing about C/C++, your in for some confusion. David

      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