Bonjour,
Je cherche à convertir le code d'une dll dont j'ai le source qui est écrit en c++ vers une version en c# car je maîtrise mieux ce langage.
Je cherche donc une âme charitable capable de m'expliquer certaines subtilité de ce code .
je vais que certaines bout de code qui résume le code principale car tout fonctionne pareil après.
Le code est écrit avec visual studio 2005
dans le .cpp
Déclaration de constante liées à la dll// plugin information
unsigned g_uPluginID = 0;
char g_szPluginName[] = "ExampleInternalsPlugin - 2005.11.30";
unsigned g_uPluginVersion = 001;
unsigned g_uPluginObjectCount = 1;
InternalsPluginInfo g_PluginInfo;
Déclaration des routines de ce .cpp// interface to plugin information
extern "C" __declspec(dllexport)
const char* __cdecl GetPluginName() { return g_szPluginName; }
extern "C" __declspec(dllexport)
unsigned __cdecl GetPluginVersion() { return g_uPluginVersion; }
extern "C" __declspec(dllexport)
unsigned __cdecl GetPluginObjectCount() { return g_uPluginObjectCount; }
????// get the plugin-info object used to create the plugin.
extern "C" __declspec(dllexport)
PluginObjectInfo* __cdecl GetPluginObjectInfo( const unsigned uIndex )
{
switch(uIndex)
{
case 0:
return &g_PluginInfo;
default:
return 0;
}
}
????????????InternalsPluginInfo::InternalsPluginInfo()
{
// put together a name for this plugin
sprintf( m_szFullName, "%s - %s", g_szPluginName, InternalsPluginInfo::GetName() );
}
const char* InternalsPluginInfo::GetName() const { return ExampleInternalsPlugin::GetName(); }
const char* InternalsPluginInfo::GetFullName() const { return m_szFullName; }
const char* InternalsPluginInfo::GetDesc() const { return "Example Internals Plugin"; }
const unsigned InternalsPluginInfo::GetType() const { return ExampleInternalsPlugin::GetType(); }
const char* InternalsPluginInfo::GetSubType() const { return ExampleInternalsPlugin::GetSubType(); }
const unsigned InternalsPluginInfo::GetVersion() const { return ExampleInternalsPlugin::GetVersion(); }
void* InternalsPluginInfo::Create() const { return new ExampleInternalsPlugin(); }
???PluginObjectInfo *ExampleInternalsPlugin::GetInfo()
{
return &g_PluginInfo;
}
Fonction qui est appellée avec comme paramètre un nom de fichier est une string à rajouter dans celui-civoid ExampleInternalsPlugin::WriteToAllExampleOutputFiles( const char * const openStr, const char * const msg )
{
...
}
Fonction qui est appellée quand le programme commmence
void ExampleInternalsPlugin::Startup()
{
...
}
En fait je ne comprends pas sont déclarées les fonctions dans le programme .
le nom de ma solution : InternalsPlugin
le nom du projet : InternalsPlugin
merci pour votre aide..
www.survey-copter.com