Re: Identifying parameter(s) on Functions in unmanaged DLLs
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Fri, 6 Apr 2007 11:31:59 +0200
<harifajri@xxxxxxxxx> wrote in message news:1175745057.451796.29290@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Apr 4, 11:05 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
HF,
Are you trying to do this at run time in a program, or are you trying to
figure out what the parameters of a function are so that you can create a
P/Invoke declaration in your program? If the answer is the former, then I
really don't have an answer on how that can be done.
If the answer is the latter, then you should have examples, or better
yet, a header file which you can get the function signature from and then
figure out what the appropriate declaration in .NET should be. If it is a
Windows API function, you can look in the documentation for the signature,
the header files which come with the SDK, or you can go tohttp://www.pinvoke.netwhich has a large number of the Windows API
signatures that you can copy and paste into .NET code. Even better, it has
a plugin which will make the process even easier.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- m...@xxxxxxxxxxxxxxxxxxxxxxxxxxx
<harifa...@xxxxxxxxx> wrote in message
news:1175672817.235237.7510@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi All,
> We know that if we want to list down all methods/functions on an
> unmanaged DLL,
> we can use command-line tools 'dumpbin' or 'link '
> For example, if we want to know method from user32.dll:
> dumpbin /exports user32.dll
> OR
> link /dump /exports user32.dll
> by running that comand, i could create a method (Entry Point) like
> this:
> using System.Runtime.InteropServices;
> ...
> [DllImport("user32.dll", EntryPoint="MessageBoxA")]
> public static extern int MsgBox( PARMETER??? );
> How to identify parameter on a specific function on a DLLs?
> Rgds
> HF- Hide quoted text -
- Show quoted text -
Thanks for the reply Nicholas Paldino,
I am not trying it at run time. I just try to create declaration to
invoke method on some unmanaged DLL (i.e.: yahoo messanger), which has
no SDK.
Is it possible to guess of what parameter on a functions on dll?
No you can't, more you shouldn't even use this function at all. If it's not documented it means it's not a public interface, the author can remove the function or change it's signature for every new release of the DLL.
Willy.
.
- References:
- Identifying parameter(s) on Functions in unmanaged DLLs
- From: harifajri@xxxxxxxxx
- Re: Identifying parameter(s) on Functions in unmanaged DLLs
- From: Nicholas Paldino [.NET/C# MVP]
- Re: Identifying parameter(s) on Functions in unmanaged DLLs
- From: harifajri@xxxxxxxxx
- Identifying parameter(s) on Functions in unmanaged DLLs
- Prev by Date: Re: Inter-process communication
- Next by Date: Re: Abstract Classes
- Previous by thread: Re: Identifying parameter(s) on Functions in unmanaged DLLs
- Next by thread: Launch C# forms from MS Access
- Index(es):
Relevant Pages
|