Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. VC++ 6, having trouble with MS Messenger Header and Lib

VC++ 6, having trouble with MS Messenger Header and Lib

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++delphicssalgorithms
9 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fahr
    wrote on last edited by
    #1

    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

    M 1 Reply Last reply
    0
    • F 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

      M Offline
      M Offline
      Michael P Butler
      wrote on last edited by
      #2

      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

      F 1 Reply Last reply
      0
      • M Michael P Butler

        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

        F Offline
        F Offline
        Fahr
        wrote on last edited by
        #3

        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

        M 1 Reply Last reply
        0
        • F Fahr

          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

          M Offline
          M Offline
          Michael P Butler
          wrote on last edited by
          #4

          #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

          F 1 Reply Last reply
          0
          • M Michael P Butler

            #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

            F Offline
            F Offline
            Fahr
            wrote on last edited by
            #5

            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

            M 1 Reply Last reply
            0
            • F Fahr

              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

              M Offline
              M Offline
              Michael P Butler
              wrote on last edited by
              #6

              #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

              F 2 Replies Last reply
              0
              • M Michael P Butler

                #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

                F Offline
                F Offline
                Fahr
                wrote on last edited by
                #7

                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

                M 1 Reply Last reply
                0
                • F Fahr

                  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

                  M Offline
                  M Offline
                  Michael P Butler
                  wrote on last edited by
                  #8

                  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

                  1 Reply Last reply
                  0
                  • M Michael P Butler

                    #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

                    F Offline
                    F Offline
                    Fahr
                    wrote on last edited by
                    #9

                    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

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups