What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » My Own C++ dll

My Own C++ dll
Author: Message:
TheSte
Junior Member
**

Who's he? xD

Posts: 18
30 / Male / Flag
Joined: Nov 2008
O.P. My Own C++ dll
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");
}
05-04-2009 05:49 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
My Own C++ dll - by TheSte on 05-04-2009 at 05:49 PM
RE: My Own C++ dll - by mezzanine on 05-04-2009 at 06:04 PM
RE: My Own C++ dll - by TheSte on 05-04-2009 at 06:31 PM
RE: My Own C++ dll - by TheSteve on 05-07-2009 at 01:11 AM
RE: My Own C++ dll - by TheSte on 05-10-2009 at 02:07 PM
RE: My Own C++ dll - by segosa on 05-10-2009 at 08:05 PM
RE: My Own C++ dll - by TheSteve on 05-11-2009 at 05:16 AM
RE: My Own C++ dll - by TheSte on 05-11-2009 at 12:19 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On