your trying this in C# right? when i wrote my key checker it had some errors but it always got the result with the 32bit PidGenX.dll and it worked for both windows 7 and vista keys and on 32bit and 64bit machines the different between the two was i used VB i tried to convert my key checker to C# but it never worked right
Well it works fine with fixed dll path, this error only occurs when using dynamic dll path using the method 'MasterDisaster' described
i understood how to do it when he talked about it but i still dont understand why my 32bit pidgenx.dll works on my 64bit machine when written in vb.net but never worked when i tried converting it to C#
I guess this is caused by the fact the program build with vb.net is build to be able to run on 'Any CPU' (which basically means X32) right?
@MasterDisaster It works fine when using replaced code snippet Code: [DllImport("pidgenx_VAMT.dll", EntryPoint = "PidGenX", CharSet = CharSet.Auto)] static extern int PidGenX(string ProductKey, string PkeyPath, string MSPID, int UnknownUsage, IntPtr ProductID, IntPtr DigitalProductID, IntPtr DigitalProductID4); // public string CheckProductKey(string ProductKey) public string CheckProductKey(string ProductKey) { //pidgenxFile is the folder path that has the dll string dllPath = pidgenxFile + "\\pidgenx_VAMT.dll"; IntPtr dllHandle = LoadLibrary(dllPath); So it seems like it tries to load system default pidgenx.dll in the original example, right?
@FreeStyler I reassigned the current directory before making the second call and the script works fine. Edit: now its not working i am going out of my head.. I'll try this later. After the Ist message box is displayed wait for a few seconds (maybe 5) before pressing OK the 2nd one will appear..
Code: bool clear = FreeLibrary(dllHandle); /* bool clear = true; while(clear) //Must be run thrice in order to dereference the pointer clear = FreeLibrary(dllHandle); */ return result; This seems to fix it, can one of you guys confirm?
cscript.exe //NOLOGO is how i did it and everything worked fine. i didnt want to push ok everytime i ran the script and it loaded the correct .dll everytime
Code: bool clear = FreeLibrary(dllHandle); /* bool clear = true; while(clear) //Must be run thrice in order to dereference the pointer clear = FreeLibrary(dllHandle); */ return result; I needed that snippet to delete the temp folder that i extracted the resources.
damn you not gonna believe this, seems like webserver can't access the dll with dynamic path (tried with same method as the vbscript) Always get error: pidgenx.dll file is not found back to square one
You need to pass the physical path of the dll instead of the virtual path. This can be acheived using Server.MapPath(). Code: Eg. you have /App_Data/win7/ string path = Server.MapPath("/App_Data/win7"); //path = "C:\\inetpub\\wwwroot\\pidcheck\\App_Data\\win7" obj.ConfigPath(path);
Yeah got it working afterall, although for some strange reason i have to re-install the dll & restart IIS for the path changes to take place