mmm I don't understand... where is my error?!
I simplified my code, for test the call, in:
//httpNSI.h
#ifdef HTTPNSI_EXPORTS
#define HTTPNSI_API __declspec(dllexport)
#else
#define HTTPNSI_API __declspec(dllimport)
#endif
namespace HttpOp
{
class Operation
{
public:
static HTTPNSI_API void Test( void );
};
}
/* EoF */
// httpNSI.cpp : Defines the exported functions for the DLL application.
//
#include "stdafx.h"
#include "httpNSI.h"
#include <stdexcept>
#include <stdio.h>
using namespace std;
namespace HttpOp
{
void Operation::Test()
{
FILE *log;
log = fopen ( "C:\\Temp\\CURL.log", "a+" );
if ( !log )
{
MessageBox ( NULL, (LPCWSTR)L"NO file opened!\n", (LPCWSTR)L"ALERT!!!", MB_OK );
goto abort;
}
else
MessageBox( NULL, (LPCWSTR)L"Continue...!\n", (LPCWSTR)L"LOG INITIALIZATION", MB_OK );
fprintf ( log, "%d:%s - INIZIO LIBRERIA\n", __LINE__, __FUNCTION__ );
abort:
if (log)
fclose ( log );
return;
}
}
/* EoF */
and in my nsis installer I use to call Test():
CLR::Call /NOUNLOAD "httpNSI.dll" "HttpOp.Operation" "Test"
In dllmain.cpp I did understand what I have to add and so, it's already wrote like the wizard do.
Now the error is from CLR plugin:
Error calling .NET DLL method
Impossibile caricare il file o l'assembly '29184 bytes loaded from NSIS CLR Loader,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' o una delle relative
dipendenze. Tentativo di caricare un programma con un formato non corretto.
Sorry... part of error message is in italian.. 😢