Ok, well so far i have written the code but i an having an issue loading the 'DLL' for what reason ever it wont load.
To load the dll
if ((UdpDll = LoadLibrary((LPCWSTR)"FreedomFighters - UDP_Network_dll"))!=NULL) { //Load Functions.... }
i checked the file name and tried it with '.dll' and with out '.dll', either way it wont load. it just returns '0' or 'NULL'.

i have no clue what the problem is. 'UdpDll' is defined as a 'HMODULE', i even tried it with 'HINSTANCE'
im using a class to load it. this is the class to load the DLL
'FF_UdpDll.h"
#pragma once
class CUdpDll
{
char SubFolder[MAX_PATH];
HMODULE UdpDll;
bool DllIsLoaded;
//Dll Calls
//dll end calls
public: //Functions
CUdpDll(char* Dir,char* FileName);
~CUdpDll();
bool IsDllLoaded();
//Sockers
int UdpConnect(int Port,int Mode);
int Close_Socket(int sockid);
//Message Send/Rec
int Message_Send(int sockid, char*ip, int port, int buffid);
int Message_Recieve(int sockid, int len, int buffid);
// Socket Tools
char* GetHostIp(char*host);
char* GetMyHost();
char* GetMyIp();
char* GetMacAddress();
int Buffer_Create();
int Buffer_Free(int BufferId);
// Write to buffer
double Buffer_WriteByte(unsigned char val, int buffid);
double Buffer_WriteShort(double val, int buffid);
double Buffer_WriteUshort(double val, int buffid);
double Buffer_WriteInt(double val, int buffid);
double Buffer_WriteUnInt(double val, int buffid);
double Buffer_WriteFloat(double val, int buffid);
double Buffer_WriteDouble(double val, int buffid);
double Buffer_WriteChars(char*str, int buffid);
double Buffer_WriteString(char*str, int buffid);
//////////////////////////////////////
// Read From the buffer
double Buffer_ReadByte(int buffid);
double Buffer_ReadShort(int buffid);
double Buffer_ReaduShort(int buffid);
double Buffer_ReadInt(int buffid);
double Buffer_ReaduInt(int buffid);
double Buffer_ReadFloat(int buffid);
double Buffer_ReadDouble(int buffid);
char* Buffer_ReadChars(double len, int buffid);
char* Buffer_ReadString(int buffid);
//Buffer Tools
double Buffer_Size(double buffid);
double Buffer_SetPos(int SetPos,int BufferId);
void Buffer_Clear(int BufferId);
int Buffer_Size(int BufferId);
};
FF_UdpDll.cpp
#include "stdafx.h"
////////////////////////////////////
// Functions Define
int (*dll_UdpConnect)(int,int);
int (*dll_UdpCloseSock)(int);
int (*dll_Message_Send)(int,char*,int,int);
int (*dll_Message_Recieve)(int,int,int);
char* (*dll_GetHostIp)(char*);
char* (*dll_GetMyHost)();
char* (*dll_GetMyIp)();
char* (*dll_GetMacAddress)();
int (*dll_Buffer_Create)();
int (*dll_Buffer_Free)(int);
double (*dll_Buffer_WriteByte)(unsigned char, int );
double (*dll_Buffer_WriteShort)(double, int );
double (*dll_Buffer_WriteUshort)(double, int);
double (*dll_Buffer_WriteInt)(double, int );
double (*dll_Buffer_WriteUnInt)(double, int );
double (*dll_Buffer_WriteFloat)(double, int );
double (*dll_Buffer_WriteDouble)(double, int );
double (*dll_Buffer_WriteChars)(char*, int);
double (*dll_Buffer_WriteString)(char*, int);
double (*dll_Buffer_ReadByte)(int);
double (*dll_Buffer_ReadShort)(int);
double (*dll_Buffer_ReaduShort)(int);
double (*dll_Buffer_ReadInt)(int);
double (*dll_Buffer_ReaduInt)(int);
double (*dll_Buffer_ReadFloat)(int);
double (*dll_Buffer_ReadDouble)(int);
char* (*dll_Buffer_ReadChars)(double, int);
char* (*dll_Buffer_ReadString)(int);
double (*dll_Buffer_Size)(double);
double (*dll_Buffer_SetPos)(int,int);
void (*dll_Buffer_Clear)(int);
////////////////////////////////////
// Functions
void CUdpDll::DllLoad(char* Dir,char* FileName)
{
bool Loaded = false;
char Buffer[64];
if (FileName=="" || "0")
{FileName="FreedomFighters - UDP_Network_dll";}
//load dlls
sprintf_s(Buffer,"%s%s",Dir,FileName);
//check if it works
UdpDll = LoadLibrary((LPCWSTR) SubFolder );
if (UdpDll!=NULL)
{Loaded=true;}
else if ((UdpDll = LoadLibrary((LPCWSTR) FileName ))!=NULL)
{Loaded=true;}
else if ((UdpDll = LoadLibrary((LPCWSTR)"FreedomFighters - UDP_Network_dll"))!=NULL)
{Loaded=true;}
//load dll if worked
if (Loaded)
{
DllIsLoaded = true;
//set the dll calls
dll_UdpConnect = (int(*)(int,int))GetProcAddress(UdpDll,"FF_UdpConnect");
dll_UdpCloseSock = (int(*)(int))GetProcAddress(UdpDll,"FF_Close_Socket");
//Messages
dll_Message_Send = (int(*)(int,char*,int,int))GetProcAddress(UdpDll,"FF_Message_Send");
dll_Message_Recieve = (int(*)(int,int,int))GetProcAddress(UdpDll,"FF_Message_Recieve");
//Get Info Tools
dll_GetHostIp = (char*(*)(char*))GetProcAddress(UdpDll,"FF_GetHostIp");
dll_GetMyHost = (char*(*)())GetProcAddress(UdpDll,"FF_GetMyHost");
dll_GetMyIp = (char*(*)())GetProcAddress(UdpDll,"FF_GetMyIp");
dll_GetMacAddress = (char*(*)())GetProcAddress(UdpDll,"FF_GetMacAddress");
//Buffer
dll_Buffer_Create = (int(*)())GetProcAddress(UdpDll,"FF__Buffer_Create");
dll_Buffer_Free = (int(*)(int))GetProcAddress(UdpDll,"FF_Buffer_Free");
// Buffer Write
dll_Buffer_WriteByte = (double(*)(unsigned char, int ))GetProcAddress(UdpDll,"FF_Buffer_WriteByte");
dll_Buffer_WriteShort = (double(*)(double, int ))GetProcAddress(UdpDll,"FF_Buffer_WriteShort");
dll_Buffer_WriteUshort = (double(*)(double, int))GetProcAddress(UdpDll,"FF_Buffer_WriteUshort");
dll_Buffer_WriteInt = (double(*)(double, int ))GetProcAddress(UdpDll,"FF_Buffer_WriteInt");
dll_Buffer_WriteUnInt = (double(*)(double, int ))GetProcAddress(UdpDll,"FF_Buffer_WriteUnInt");
dll_Buffer_WriteFloat = (double(*)(double, int ))GetProcAddress(UdpDll,"FF_Buffer_WriteFloat");
dll_Buffer_WriteDouble = (double(*)(double, int ))GetProcAddress(UdpDll,"FF_Buffer_WriteDouble");
dll_Buffer_WriteChars = (double(*)(char*, int))GetProcAddress(UdpDll,"FF_Buffer_WriteChars");
dll_Buffer_WriteString = (double(*)(char*, int))GetProcAddress(UdpDll,"FF_Buffer_WriteString");
// Buffer Read
dll_Buffer_ReadByte = (double(*)(int))GetProcAddress(UdpDll,"FF_Buffer_ReadByte");
dll_Buffer_ReadShort = (double(*)(int))GetProcAddress(UdpDll,"FF_Buffer_ReadShort");
dll_Buffer_ReaduShort = (double(*)(int))GetProcAddress(UdpDll,"FF_Buffer_ReaduShort");
dll_Buffer_ReadInt = (double(*)(int))GetProcAddress(UdpDll,"FF_Buffer_ReadInt");
dll_Buffer_ReaduInt = (double(*)(int))GetProcAddress(UdpDll,"FF_Buffer_ReaduInt");
dll_Buffer_ReadFloat = (double(*)(int))GetProcAddress(UdpDll,"FF_Buffer_ReadFloat");
dll_Buffer_ReadDouble = (double(*)(int))GetProcAddress(UdpDll,"FF_Buffer_ReadDouble");
dll_Buffer_ReadChars = (char*(*)(double, int))GetProcAddress(UdpDll,"FF_Buffer_ReadChars");
dll_Buffer_ReadString = (char*(*)(int))GetProcAddress(UdpDll,"FF_Buffer_ReadString");;
// Buffer Tools
dll_Buffer_Size = (double(*)(double))GetProcAddress(UdpDll,"FF_Buffer_Size");;
dll_Buffer_SetPos = (double(*)(int,int))GetProcAddress(UdpDll,"FF_Buffer_SetPos");;
dll_Buffer_Clear = (void(*)(int))GetProcAddress(UdpDll,"FF_Buffer_Clear");;
//End of loading Commands
}
else
{
DllIsLoaded = false;
}
}
void CUdpDll::DllUnLoad()
{
if (DllIsLoaded)
{
FreeLibrary(UdpDll);
}
}
bool CUdpDll::IsDllLoaded()
{
return DllIsLoaded;
}
//Sockers
int CUdpDll::UdpConnect(int Port,int Mode)
{
return dll_UdpConnect(Port,Mode);
}
int CUdpDll::Close_Socket(int sockid)
{
return dll_UdpCloseSock(sockid);
}
//Message Send/Rec
int CUdpDll::Message_Send(int sockid, char*ip, int port, int buffid)
{
return dll_Message_Send(sockid,ip,port,buffid);
}
int CUdpDll::Message_Recieve(int sockid, int len, int buffid)
{
return dll_Message_Recieve(sockid,len,buffid);
}
// Socket Tools
char* CUdpDll::GetHostIp(char*host)
{
return dll_GetHostIp(host);
}
char* CUdpDll::GetMyHost()
{
return dll_GetMyHost();
}
char* CUdpDll::GetMyIp()
{
return dll_GetMyIp();
}
char* CUdpDll::GetMacAddress()
{
return dll_GetMacAddress();
}
int CUdpDll::Buffer_Create()
{
return dll_Buffer_Create();
}
int CUdpDll::Buffer_Free(int BufferId)
{
return dll_Buffer_Free(BufferId);
}
// Write to buffer
double CUdpDll::Buffer_WriteByte(unsigned char val, int buffid)
{
return dll_Buffer_WriteByte(val,buffid);
}
double CUdpDll::Buffer_WriteShort(double val, int buffid)
{
return dll_Buffer_WriteShort(val,buffid);
}
double CUdpDll::Buffer_WriteUshort(double val, int buffid)
{
return dll_Buffer_WriteUshort(val,buffid);
}
double CUdpDll::Buffer_WriteInt(double val, int buffid)
{
return dll_Buffer_WriteInt(val,buffid);
}
double CUdpDll::Buffer_WriteUnInt(double val, int buffid)
{
return dll_Buffer_WriteUnInt(val,buffid);
}
double CUdpDll::Buffer_WriteFloat(double val, int buffid)
{
return dll_Buffer_WriteFloat(val,buffid);
}
double CUdpDll::Buffer_WriteDouble(double val, int buffid)
{
return dll_Buffer_WriteDouble(val,buffid);
}
double CUdpDll::Buffer_WriteChars(char*str, int buffid)
{
return dll_Buffer_WriteChars(str,buffid);
}
double CUdpDll::Buffer_WriteString(char*str, int buffid)
{
return dll_Buffer_WriteString(str,buffid);
}
//////////////////////////////////////
// Read From the buffer
double CUdpDll::Buffer_ReadByte(int buffid)
{
return dll_Buffer_ReadByte(buffid);
}
double CUdpDll::Buffer_ReadShort(int buffid)
{
return dll_Buffer_ReadShort(buffid);
}
double CUdpDll::Buffer_ReaduShort(int buffid)
{
return dll_Buffer_ReaduShort(buffid);
}
double CUdpDll::Buffer_ReadInt(int buffid)
{
return dll_Buffer_ReadInt(buffid);
}
double CUdpDll::Buffer_ReaduInt(int buffid)
{
return dll_Buffer_ReaduInt(buffid);
}
double CUdpDll::Buffer_ReadFloat(int buffid)
{
return dll_Buffer_ReadFloat(buffid);
}
double CUdpDll::Buffer_ReadDouble(int buffid)
{
return dll_Buffer_ReadDouble(buffid);
}
char* CUdpDll::Buffer_ReadChars(double len, int buffid)
{
return dll_Buffer_ReadChars(len,buffid);
}
char* CUdpDll::Buffer_ReadString(int buffid)
{
return dll_Buffer_ReadString(buffid);
}
//Buffer Tools
double CUdpDll::Buffer_Size(double buffid)
{
return dll_Buffer_Size(buffid);
}
double Buffer_SetPos(int SetPos,int BufferId)
{
return dll_Buffer_SetPos(SetPos,BufferId);
}
void CUdpDll::Buffer_Clear(int BufferId)
{
dll_Buffer_Clear(BufferId);
}
Problem Solution That Never Fails: "Build A Bridge And Get Over It"