Hi all...I know there are a lot of similar threads but I haven't understood this yet...
This is the code in dllmain.cpp
code:
#include "stdafx.h"
extern "C"__declspec(dllexport) int somma(int a, int b);
BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}
int somma(int a, int b){
    return a + b;
}
the building is ok...but when I load it with plus it says:
"Bad calling convention detected for "somma" in "C:\Program Files\Messenger Plus! Live\Scripts\nomi\dll.dll". The function must be declared with __stdcall and called with the appropriate number of parameter."
How I can declare it with __stdcall ?
sorry this is the js code
code:
function OnEvent_Initialize(MessengerStart)
{
var s=0;
s= Interop.Call(MsgPlus.ScriptFilesPath + "\\dll.dll", "somma", "2","3");
MsgPlus.DisplayToast("sss", s);
Interop.FreeDll(MsgPlus.ScriptFilesPath + "\\dll.dll");
}