hi, im getting this error:
Unhandled exception at 0x00c11005 in bnetconnection.exe: 0xC0000005: Access violation reading locaiton 0x00c11005
in this particular instance, what i got from the debugger is that 0x00c11005 is my _ProcessCommands function
dll:
#include <iostream>
using namespace std;
extern "C" _declspec(dllexport) void ProcessCommands( const char*, const char*, const char*, const char* );
__declspec(dllexport) void ProcessCommands( const char* client, const char* location, const char* username, const char* message )
{
cout << "DLEAGUE: " << client << " " << location << " " << username << " " << message << endl;
}
main files:
#ifndef PLUGINS_H
#define PLUGINS_H
#include "main.h"
#include "config.h"
typedef void ( *ProcessCommands ) ( const char*, const char*, const char*, const char* );
class CPlugins
{
private:
public:
CPlugins( );
CPlugins( CFileConfig *CFG, string strPrefix );
vector<string> m_Plugins;
ProcessCommands _ProcessCommands; // sent to plugins when a chat message is received on any client
};
#endif // PLUGINS_H
else
{
for( size_t j = 0; j < botPlugins[i].m_Plugins.size( ); j++ )
{
HINSTANCE hInstLibrary = LoadLibrary( botPlugins[i].m_Plugins[j].c_str( ) );
if( hInstLibrary )
{
cout << "[IRC: " << ircConfig[i].m_Nickname << "] " << botPlugins[i].m_Plugins[j] << " successfully loaded" << endl;
botPlugins[i]._ProcessCommands = ( ProcessCommands ) GetProcAddress( hInstLibrary, "ProcessCommands" );
FreeLibrary( hInstLibrary );
}
else
{
cout << "[IRC: " << ircConfig[i].m_Nickname << "] " << botPlugins[i].m_Plugins[j] << " failed to load: " << GetLastError( ) << endl;
}
}
}
cout << "[IRC: " << m_IRCConfig->m_Nickname << "] <" << packetInfo->m_Username << "> " << packetInfo->m_Message << endl;
if( botPlugins->_ProcessCommands )
{
const char * channel = m_IRCConfig->m_Channel.c_str( );
const char * Username = packetInfo->m_Username.c_str( );
const char * Message = packetInfo->m_Message.c_str( );
botPlugins->_ProcessCommands( "IRC", "fff", "uuuu", "ddd" );
}
it loads the dll fine and finds the function but when it calls the function i just get that error, ive tried using the variables shown in the last snip and some constant values but it's the same error