| View previous topic :: View next topic |
| Author |
Message |
yoyonerd Grandmaster Cheater
Reputation: 0
Joined: 26 Apr 2008 Posts: 699 Location: -->formerly yoyonerd<--
|
Posted: Sun Oct 26, 2008 1:09 am Post subject: [C#] Using PMX.dll? |
|
|
I see Spawn's thread about using PMX.dll
I'm fairly new to C#, let alone programming.
I'll admit I am, but I have been learning quite quickly and grasp most of the fundamentals.
So my questions is.
How do I use it?
I've tried adding it as a reference, and it doesn't work.
I saw there was a maplestory bot made in vb, and it worked so
Yeah, I'm not so great, flame if you must.
To those who help, THANK YOU!!!!
_________________
|
|
| Back to top |
|
 |
Wintermoot Expert Cheater
Reputation: 0
Joined: 08 Nov 2007 Posts: 198
|
Posted: Sun Oct 26, 2008 1:11 am Post subject: |
|
|
| Can you tell us the error you are getting? Or what is not working?
|
|
| Back to top |
|
 |
sloppy Expert Cheater
Reputation: 0
Joined: 17 Aug 2008 Posts: 123
|
Posted: Sun Oct 26, 2008 2:55 am Post subject: |
|
|
Using unmanaged code in c# requires interop. Don't add the dll as a reference, copy PMX.dll into your project release/debug folder, | Code: | using System.Runtime.InteropServices;
namespace hello
{
class example
{
// import signature
[DllImport("PMX.dll")]
private static extern bool PostMessageX(IntPtr hWnd, uint Msg, uint wParam, uint lParam);
}
} |
For details on calling Win32 APIs from c#, I recommend you check out http://www.pinvoke.net/ and MSDN.
|
|
| Back to top |
|
 |
Spawnfestis GO Moderator
Reputation: 0
Joined: 02 Nov 2007 Posts: 1746 Location: Pakistan
|
Posted: Sun Oct 26, 2008 4:55 am Post subject: |
|
|
The problem you are experiencing is most likely -
You can't add the DLL as a reference
- Solution: Put the DLL in the release/debug folder of your program as it will use it as a reference if it is called within the application
You have added it but you can't call it
- Solution: Using the DLL Import will demand that you use
| Code: | | using System.Runtime.InteropServices; | and that you use this code to import the DLL function PostMessageX
| Code: | [DllImport("PMX.dll")]
private static extern bool PostMessageX(IntPtr hWnd, uint Msg, uint wParam, uint lParam); |
I guess this will clarify what you wondered. :- )
_________________
CLICK TO HAX MAPLESTORAY ^ !!!! |
|
| Back to top |
|
 |
yoyonerd Grandmaster Cheater
Reputation: 0
Joined: 26 Apr 2008 Posts: 699 Location: -->formerly yoyonerd<--
|
Posted: Sun Oct 26, 2008 9:59 am Post subject: |
|
|
thanks guys, you pretty much nailed all my questions!
_________________
|
|
| Back to top |
|
 |
|