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. Managed C++/CLI
  4. how to know the dll export function's declare?

how to know the dll export function's declare?

Scheduled Pinned Locked Moved Managed C++/CLI
tutorialquestion
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.
  • H Offline
    H Offline
    HOW WHAT
    wrote on last edited by
    #1

    a dll not had source, how know it parameter's number and is WINAPI or CDECL?

    O 1 Reply Last reply
    0
    • H HOW WHAT

      a dll not had source, how know it parameter's number and is WINAPI or CDECL?

      O Offline
      O Offline
      oshah
      wrote on last edited by
      #2

      Since you posted in the C++/CLI forum, you implicitly admit your DLL was written in .NET. If you were lying and this DLL was not written in .NET then you have just posted in the wrong message board. Repost this question in the message board. Note that in .NET, CLR functions only have one calling convention, and that is __clrcall. The WINAPI or CDECL stuff only applies to native DLLs. If your function has uses WINAPI/CDECL, then your function is not written in .NET (see above). Also note that .NET DLLs do not export their CLR functions as dllexports. Instead, the functions are stored as Metadata, and are discovered using Reflection. The quick way to check the function signature is to add the DLL as a project reference (Project -> References -> Add New Reference -> Browse -> select your DLL -> OK OK). If this doesn't work, then your DLL is not a .NET DLL (see above). Now click on view Object Browser, and go down to the namespace of the DLL. This will show you all the function signatures in that DLL. How do you do this programmatically? The functions to use are given in System::Reflection. Once you have the System::Assembly of the DLL, call the Assembly::GetTypes method to get all the types of the assembly. Then you can call the GetMethods to get the methods in that Type (including private ones). To get the number and type of parameters, check out MethodInfo::GetParameters. That should allow you to discover the signature of the method.

      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