Hi all, i would like to learn how to attach a custom dll library to moh.exe. Here is a part of my custom source code with the 'handweapons' (or weapons?) function:
c++ source code:
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
BOOL APIENTRY DllMain (HINSTANCE hInst
DWORD handweapons /*or "weapons?*/
LPVOID reserved
{
switch (handweapons)/*or "weapons?*/
{
case DLL_PROCESS_ATTACH:
mohaa.exe;
break;
case DLL_PROCESS_DETACH:
mohaa.exe;
break;
case DLL_THREAD_ATTACH:
cgamex86.dll;
break;
case DLL_THREAD_DETACH:
cgamex86.dll;
break;
}
return TRUE;
}
Anyone can help me? My project is input new weapons vars. Maybe its more easy of edit the cgamex86.dll library with asm procedure but i dont know this process.
huh
what sort of weapon vars? and there is a game wrapper, www.mohdev.mods-r-us.net
Yeah Elg, good link, i dont known it. I downloaded and modified source files of Wombat but i have critical errors while compilation process. How to contact the author for obtain help?
wwell post on the forum:)
what errors?
what are u trying to do, explaina nd maybe i can helpm, maybe an easier way.
Also what u compile with etc
Im using gnu compiler and i just trying to assembling the original Wombat's cgamex86.cpp file for testing. There is the log of the error:
error:
g++.exe "D:GamesMoHmaincgamex86.cpp" -o "D:GamesMoHmaincgamex86.exe" -pg -g3 -I"D:ProgramsDev-Cpplibgccmingw32.4.2include" -I"D:ProgramsDev-Cppincludec++.4.2backward" -I"D:ProgramsDev-Cppincludec++.4.2mingw32" -I"D:ProgramsDev-Cppincludec++.4.2" -I"D:ProgramsDev-Cppinclude" -L"D:ProgramsDev-Cpplib" -lgmon -pg -g3
D:ProgramsDev-Cpplib/libmingw32.a(main.o)(.text+0x106):main.c: undefined reference to `WinMain@16'
collect2: ld returned 1 exit status
Maybe its the compiler which has wrong parameters...
thats the client dll btw
I found the error: it was the absence of one main function.:D Thanks m8.
i think ur compiling it as an exe? did ya get it sorted?
its a dll
Yeah this is the problem: without a "main" function, the compiler return an error an with a "main" function, it compiles an executable file... :O_o I tested with a "dllmain" function but it returns an error and devcpp can attribute a parent program for the source file... What is the main function to say at gnu compiler that source code must be a library and not an application?