fenix01/cheatengine-library

C# connector has a problem loading the .dll (Connector.cs line ~149)

Closed this issue · 6 comments

Well, to load de the library you are using:

        #if _WIN64
        libInst = LoadLibraryW("ce-lib64.dll");
        #else
        libInst = LoadLibrary("ce-lib32.dll");
        #endif

I do not know why it does not work, but you can avoid using preprocessor with this code:

        if(System.Environment.Is64BitOperatingSystem)
            libInst = LoadLibraryW("ce-lib64.dll");
        else
            libInst = LoadLibrary("ce-lib32.dll");

Which wont give problems to the compiler.

Sorry for my Eng, not native.

Hi alvaromat :)

Thanks for your remark but I have a question. Did you choose the correct configuration before compiling this example ? And which one have you tried (the memory scanner or the auto assemble project) ?

I tried with both configurations (x86 & x64), but no one worked. I did it with the mem scanner.

Ok. could you tell me what is the error ? The problem occurs during the launch of the application ? Or, you're not able to scan any process ?

Ok, i have just checked and the problem only occurs with x64 config, when I press load library a message box is shown "error, can't load the library".

I think that the if condition is set to false:

Yup, I tried and I have the same problem with the 64 bits configuration. It's strange because it was working a few time ago. I did the following change to get it works :

  • Project + Properties
  • In the main window you should have a small box : Preprocessor Definitions
  • add this symbol _WIN64

OK, that solves the problem 👍