Click here to Skip to main content
15,900,466 members
Home / Discussions / COM
   

COM

 
GeneralRe: T2OLE or AllocSysString()? Pin
Anders Molin18-Mar-03 13:21
professionalAnders Molin18-Mar-03 13:21 
AnswerRe: T2OLE or AllocSysString()? Pin
Michael Dunn18-Mar-03 13:23
sitebuilderMichael Dunn18-Mar-03 13:23 
GeneralRe: T2OLE or AllocSysString()? Pin
LukeV18-Mar-03 13:52
LukeV18-Mar-03 13:52 
GeneralCLSIDFromProgID was failed. Please help.. Pin
Vorrarit Luengwattanakij18-Mar-03 7:32
Vorrarit Luengwattanakij18-Mar-03 7:32 
GeneralRe: I want to write an Add-in for VS, help please Pin
qcth18-Mar-03 3:47
qcth18-Mar-03 3:47 
GeneralJava + COM Pin
-=jarl=-17-Mar-03 5:39
-=jarl=-17-Mar-03 5:39 
GeneralRe: Java + COM Pin
Jörgen Sigvardsson20-Mar-03 10:27
Jörgen Sigvardsson20-Mar-03 10:27 
GeneralInvalidCastException Pin
SQ_Lusi13-Mar-03 1:25
SQ_Lusi13-Mar-03 1:25 
I have a small testing code in c# for the WM4.7:
<br />
using System;<br />
using Messenger;<br />
<br />
namespace MessengerDemo<br />
{<br />
<br />
  class MessengerDemo<br />
  {<br />
 <br />
[STAThread]<br />
static void Main(string[] args)<br />
{<br />
 MsgrObject msgr = new MsgrObject();<br />
 MessengerApp mapp = new MessengerApp(); <br />
  <br />
   <br />
<br />
 if(args.Length == 0) <br />
 {<br />
  foreach(IMsgrService service in msgr.Services) <br />
  {<br />
   Console.WriteLine(service.ServiceName);<br />
  }<br />
 } <br />
 if(args.Length == 1)<br />
 {<br />
  if(args[0].Equals("logoff"))<br />
   msgr.Logoff();<br />
<br />
  if(args[0].Equals("quit"))<br />
   mapp.Quit();<br />
 }<br />
}<br />
  }<br />
}<br />


The logoff method called on the messenger object works fine. The problem is the quit method, which is part of IMessengerApp, IMessengerApp2 and IMessengerApp3. I got no compiling errors with the code above, but if I run the prog with the argument quit, I got this Exeption:
<br />
D:\Projects\Messenger\bin\Debug>messenger quit<br />
<br />
<br />
Unhandled Exception: System.InvalidCastException: QueryInterface for interface Messenger.IMessengerApp3 failed.<br />
  at Messenger.MessengerAppClass.Quit()<br />
  at MessengerDemo.MessengerDemo.Main(String[] args) in d:\projects\messenger\messenger.cs:line 39<br />


Why it wants to cast it, the ImessengerApp3 should be part of Messenger.MessengerAppClass.... Anybody got an idea?
QuestionHow to determine the threading model of an out-of-process server Pin
Jason Bafas12-Mar-03 5:04
sussJason Bafas12-Mar-03 5:04 
GeneralActiveX accessing other ActiveX Ctrls in a browser Pin
sanskypotov11-Mar-03 22:28
sanskypotov11-Mar-03 22:28 
GeneralAfxOleInit() + RPC_E_CHANGED_MODE Pin
Swinefeaster11-Mar-03 12:00
Swinefeaster11-Mar-03 12:00 
Generaladd-in for outlook express Pin
Naidu10-Mar-03 22:32
Naidu10-Mar-03 22:32 
GeneralRe: add-in for outlook express Pin
Amit Dey14-Mar-03 7:44
Amit Dey14-Mar-03 7:44 
GeneralRe: add-in for outlook express Pin
Naidu18-Mar-03 15:37
Naidu18-Mar-03 15:37 
GeneralRe: add-in for outlook express Pin
Amit Dey19-Mar-03 5:40
Amit Dey19-Mar-03 5:40 
GeneralRe: add-in for outlook express Pin
Stephane Rodriguez.15-Mar-03 7:25
Stephane Rodriguez.15-Mar-03 7:25 
GeneralRe: add-in for outlook express Pin
Amit Dey15-Mar-03 11:28
Amit Dey15-Mar-03 11:28 
GeneralRe: add-in for outlook express Pin
Stephane Rodriguez.16-Mar-03 3:10
Stephane Rodriguez.16-Mar-03 3:10 
GeneralRe: add-in for outlook express Pin
Amit Dey16-Mar-03 8:54
Amit Dey16-Mar-03 8:54 
GeneralRe: add-in for outlook express Pin
Stephane Rodriguez.16-Mar-03 9:29
Stephane Rodriguez.16-Mar-03 9:29 
GeneralRe: add-in for outlook express Pin
Amit Dey16-Mar-03 10:31
Amit Dey16-Mar-03 10:31 
GeneralRe: add-in for outlook express Pin
Stephane Rodriguez.16-Mar-03 11:09
Stephane Rodriguez.16-Mar-03 11:09 
GeneralRe: add-in for outlook express Pin
Amit Dey16-Mar-03 13:49
Amit Dey16-Mar-03 13:49 
GeneralRe: add-in for outlook express Pin
Stephane Rodriguez.16-Mar-03 19:49
Stephane Rodriguez.16-Mar-03 19:49 
GeneralRe: add-in for outlook express Pin
Amit Dey16-Mar-03 14:11
Amit Dey16-Mar-03 14:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.