Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C#] Using PMX.dll?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
yoyonerd
Grandmaster Cheater
Reputation: 0

Joined: 26 Apr 2008
Posts: 699
Location: -->formerly yoyonerd<--

PostPosted: Sun Oct 26, 2008 1:09 am    Post subject: [C#] Using PMX.dll? Reply with quote

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
View user's profile Send private message AIM Address
Wintermoot
Expert Cheater
Reputation: 0

Joined: 08 Nov 2007
Posts: 198

PostPosted: Sun Oct 26, 2008 1:11 am    Post subject: Reply with quote

Can you tell us the error you are getting? Or what is not working?
Back to top
View user's profile Send private message
sloppy
Expert Cheater
Reputation: 0

Joined: 17 Aug 2008
Posts: 123

PostPosted: Sun Oct 26, 2008 2:55 am    Post subject: Reply with quote

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
View user's profile Send private message
Spawnfestis
GO Moderator
Reputation: 0

Joined: 02 Nov 2007
Posts: 1746
Location: Pakistan

PostPosted: Sun Oct 26, 2008 4:55 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
yoyonerd
Grandmaster Cheater
Reputation: 0

Joined: 26 Apr 2008
Posts: 699
Location: -->formerly yoyonerd<--

PostPosted: Sun Oct 26, 2008 9:59 am    Post subject: Reply with quote

thanks guys, you pretty much nailed all my questions!
_________________
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites