MOH Central

Medal of Honor Series Forum => MOHAA Series: General => Topic started by: Jed on October 26, 2006, 01:27:15 PM

Title: how to attach a new library with moh
Post by: Jed on October 26, 2006, 01:27:15 PM
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.
Title: how to attach a new library with moh
Post by: Elgan {sfx} on October 26, 2006, 03:37:30 PM
huh

   

   what sort of weapon vars? and there is a game wrapper, www.mohdev.mods-r-us.net
Title: how to attach a new library with moh
Post by: Jed on October 26, 2006, 04:02:29 PM
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?
Title: how to attach a new library with moh
Post by: Elgan {sfx} on October 26, 2006, 04:03:54 PM
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
Title: how to attach a new library with moh
Post by: Jed on October 26, 2006, 04:08:44 PM
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...
Title: how to attach a new library with moh
Post by: Elgan {sfx} on October 26, 2006, 04:17:08 PM
thats the client dll btw
Title: how to attach a new library with moh
Post by: Jed on October 26, 2006, 04:19:04 PM
I found the error: it was the absence of one main function.:D Thanks m8.
Title: how to attach a new library with moh
Post by: Elgan {sfx} on October 26, 2006, 09:14:19 PM
i think ur compiling it as an exe? did ya get it sorted?

   

   its a dll
Title: how to attach a new library with moh
Post by: Jed on October 26, 2006, 10:18:56 PM
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?