VC++ 6, having trouble with MS Messenger Header and Lib
-
Hello, I'm having the following problem. I've been developping with the Messenger Typelibrary in both VB and Delphi for quite a while now. As I wanted to switch to C++, I downloaded the headers and lib file that Microsoft gave free for download on their site. All seems to be more or less ok, I see all the classes, but NO EVENTS! None whatsoever. When I try to add a member function it says that the implementation is not found. I need the OnTextReceived event for instance, I can't find it anywhere. Not in the headers, not in the help that came with it either! After a bit of searching on the MS Site I found a similar function DOES exist in the Exchange API, I don't see how those 2 are connected, if they even are... Can anyone help me? Is it not possible in C to pull a trick like VB or Delphi? Just import the msmsgs.exe? Thanks a lot, - Fahr
-
Hello, I'm having the following problem. I've been developping with the Messenger Typelibrary in both VB and Delphi for quite a while now. As I wanted to switch to C++, I downloaded the headers and lib file that Microsoft gave free for download on their site. All seems to be more or less ok, I see all the classes, but NO EVENTS! None whatsoever. When I try to add a member function it says that the implementation is not found. I need the OnTextReceived event for instance, I can't find it anywhere. Not in the headers, not in the help that came with it either! After a bit of searching on the MS Site I found a similar function DOES exist in the Exchange API, I don't see how those 2 are connected, if they even are... Can anyone help me? Is it not possible in C to pull a trick like VB or Delphi? Just import the msmsgs.exe? Thanks a lot, - Fahr
Looking through the messenger sdk headers, there seems to be a lot of events although I can't see one for OnTextReceived. Have you tried using #import on the Messenger Typelibrary and see if that generates the missing events. It is possible that the SDK uses an earlier/later version of the COM interfaces? Michael Fat bottomed girls You make the rockin' world go round -- Queen
-
Looking through the messenger sdk headers, there seems to be a lot of events although I can't see one for OnTextReceived. Have you tried using #import on the Messenger Typelibrary and see if that generates the missing events. It is possible that the SDK uses an earlier/later version of the COM interfaces? Michael Fat bottomed girls You make the rockin' world go round -- Queen
-
The main problem with that is that the actual typelibrary is in the msn executable... I have NO idea how to import it :S Neither do I have any idea how to import type libs in C w/o header files in general :P - Fahr
#import "C:\Program Files\Messenger\msmsgs.exe" will generate you a header file for the typelib. I've checked with my version and it generates an event for OnTextReceived. Michael Fat bottomed girls You make the rockin' world go round -- Queen
-
#import "C:\Program Files\Messenger\msmsgs.exe" will generate you a header file for the typelib. I've checked with my version and it generates an event for OnTextReceived. Michael Fat bottomed girls You make the rockin' world go round -- Queen
-
possibly and extremely stupid newby question: WHERE do I type the #import so it generates a class/header/whatever ?? I never worked with typelibs in C w/o having pre-made headers :S Thanks, - Fahr
#include "stdafx.h"
#import "C:\Program Files\Messenger\msmsgs.exe"int _tmain(int argc, _TCHAR* argv[])
{
Messenger::IMsgrObject2Ptr oMsgrObj = NULL;
Messenger::IMsgrUsersPtr oUsers = NULL;
Messenger::IMsgrUserPtr oUser = NULL;// Create an instance of Instant Messenger. oMsgrObj.CreateInstance("Messenger.MsgrObject"); // Get the list of contacts oUsers = oMsgrObj->GetList(Messenger::MLIST\_CONTACT); return 0;
}
Michael Fat bottomed girls You make the rockin' world go round -- Queen
-
#include "stdafx.h"
#import "C:\Program Files\Messenger\msmsgs.exe"int _tmain(int argc, _TCHAR* argv[])
{
Messenger::IMsgrObject2Ptr oMsgrObj = NULL;
Messenger::IMsgrUsersPtr oUsers = NULL;
Messenger::IMsgrUserPtr oUser = NULL;// Create an instance of Instant Messenger. oMsgrObj.CreateInstance("Messenger.MsgrObject"); // Get the list of contacts oUsers = oMsgrObj->GetList(Messenger::MLIST\_CONTACT); return 0;
}
Michael Fat bottomed girls You make the rockin' world go round -- Queen
-
Thanks an amazing bunch!! :) It works!! :) Will it compile the exe along so I only need a running instance, or will it need the exe to be always in the same dir? - Fahr
It only uses the exe to generate the msmsgs.tlh, msmsgs.tli files. The exe is just acting as the type library. As long as MS Messenger is on the machine that you install on, then your app will just run. Michael Fat bottomed girls You make the rockin' world go round -- Queen
-
#include "stdafx.h"
#import "C:\Program Files\Messenger\msmsgs.exe"int _tmain(int argc, _TCHAR* argv[])
{
Messenger::IMsgrObject2Ptr oMsgrObj = NULL;
Messenger::IMsgrUsersPtr oUsers = NULL;
Messenger::IMsgrUserPtr oUser = NULL;// Create an instance of Instant Messenger. oMsgrObj.CreateInstance("Messenger.MsgrObject"); // Get the list of contacts oUsers = oMsgrObj->GetList(Messenger::MLIST\_CONTACT); return 0;
}
Michael Fat bottomed girls You make the rockin' world go round -- Queen
Also, I stumble upon the following error when I try to define the OnTextReceived function: c:\program files\microsoft visual studio\myprojects\msntest\stdafx.cpp(23) : error C2084: function 'long __thiscall Messenger::DMsgrObjectEvents::OnTextReceived(struct Messenger::IMsgrIMSession *,struct Messenger::IMsgrUser *,class _bstr_t,class _bs tr_t,short *)' already has a body what am I supposed to do with that? I'm guessing it is redifined or something?? I don't get it... Sorry if I sound too much like a noob, this is all just new to me :P And on another note, can I make it like a class in my classview? It would be a lot easier I think... Thanks, - Fahr