Click here to Skip to main content
16,016,229 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Comma Delimeted CString Parsing Pin
David Crow28-Sep-06 7:52
David Crow28-Sep-06 7:52 
GeneralRe: Comma Delimeted CString Parsing Pin
efriese128-Sep-06 8:54
efriese128-Sep-06 8:54 
AnswerRe: Comma Delimeted CString Parsing Pin
James R. Twine28-Sep-06 8:59
James R. Twine28-Sep-06 8:59 
QuestionHow to make Button for MSAccess ? Pin
01fanker28-Sep-06 5:20
01fanker28-Sep-06 5:20 
AnswerRe: How to make Button for MSAccess ? Pin
John M. Drescher28-Sep-06 6:04
John M. Drescher28-Sep-06 6:04 
QuestionRe: How to make Button for MSAccess ? Pin
01fanker28-Sep-06 20:29
01fanker28-Sep-06 20:29 
AnswerRe: How to make Button for MSAccess ? Pin
S Douglas30-Sep-06 22:19
professionalS Douglas30-Sep-06 22:19 
Questionhelp creating a com object CDOMessage Pin
flippydeflippydebop28-Sep-06 4:28
flippydeflippydebop28-Sep-06 4:28 
i wonder if someone can help me with the creaion of a COM object. I am trying to

I am trying to create an object of CDOMessage but am failing at the 1st hurdle.

Firstly, information about the COM object can be found here.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdosys/html/c138a402-4842-4bb3-988e-43cb9917e94b.asp

At the bottom of the page the example has VB and C++ mixed in one but the c++ example looks like this:

<br />
#import "c:\program files\common files\system\ado\msado15.dll" no_namespace raw_interfaces_only<br />
#import <cdosys.dll> no_namespace raw_interfaces_only<br />
#include <cdosysstr.h>  // string constants in this file<br />
#include <iostream.h><br />
<br />
main(){<br />
  CoInitialize(NULL);  // single-threaded apartment<br />
  IMessage* pMsg = NULL;<br />
  /*<br />
  ** Create an instance of the Message COM class.<br />
  */<br />
  HRESULT hr = CoCreateInstance(__uuidof(Message),<br />
                                NULL,<br />
                                CLSCTX_INPROC_SERVER,<br />
                                __uuidof(IMessage),<br />
                                reinterpret_cast<void**>(&pMsg));<br />


However when i try to compile the above code i get the error:

Error 1 error C2065: 'IMessage' : undeclared identifier c:\c++localprojects\cdomessage\cdomessage\cdomessagedlg.cpp 103


Now if i fire up OLE/COM Viewer that you get with Visual Studio and do a search in "All Objects" for CDOMessage i find
that it is all registered ok with my system.

notice in the example above __uuidof & __uuidof is being used. I have not come across these before so went about calling
CoCreateInstance the normal way passing interface id's and class id's

for example here is a call from a com intro article here on cp: http://www.codeproject.com/com/comintro.asp

<br />
HRESULT     hr;<br />
IShellLink* pISL;  <br />
<br />
hr = CoCreateInstance ( CLSID_ShellLink,         // CLSID of coclass<br />
                        NULL,                    // not used - aggregation<br />
                        CLSCTX_INPROC_SERVER,    // type of server<br />
                        IID_IShellLink,          // IID of interface<br />
                        (void**) &pISL );        // Pointer to our interface pointer<br />


Now for me to create a CDOMessage COM object i need know:

1) the CLSID of the coclass
2) the IID (interfaceid)
3) an interface pointer

however using OLE/COM Viewer the CLSID is {CD000001-8B95-11D1-82DB-00C04FB1625D} instead of a readable form like CLSID_ShellLink.
Is it ok for me to just pass through CD000001-8B95-11D1-82DB-00C04FB1625D?? Secondly, OLE/COM Viewer does not show me the IID for me
to pass through.. And finally what interface pointer should i use?
AnswerRe: help creating a com object CDOMessage Pin
led mike28-Sep-06 5:29
led mike28-Sep-06 5:29 
GeneralRe: help creating a com object CDOMessage Pin
flippydeflippydebop28-Sep-06 6:02
flippydeflippydebop28-Sep-06 6:02 
GeneralRe: help creating a com object CDOMessage Pin
led mike28-Sep-06 6:10
led mike28-Sep-06 6:10 
GeneralRe: help creating a com object CDOMessage Pin
flippydeflippydebop28-Sep-06 10:35
flippydeflippydebop28-Sep-06 10:35 
GeneralRe: help creating a com object CDOMessage Pin
flippydeflippydebop29-Sep-06 1:01
flippydeflippydebop29-Sep-06 1:01 
GeneralRe: help creating a com object CDOMessage Pin
led mike29-Sep-06 5:08
led mike29-Sep-06 5:08 
GeneralRe: help creating a com object CDOMessage Pin
flippydeflippydebop1-Oct-06 22:59
flippydeflippydebop1-Oct-06 22:59 
QuestionIs there anybody knowns where was IE's "Manage Add-ons" dialog implemented? Pin
314159265328-Sep-06 3:28
314159265328-Sep-06 3:28 
QuestionModal and modeless dialogs Pin
Wim Engberts28-Sep-06 2:50
Wim Engberts28-Sep-06 2:50 
AnswerRe: Modal and modeless dialogs Pin
David Crow28-Sep-06 2:55
David Crow28-Sep-06 2:55 
GeneralRe: Modal and modeless dialogs Pin
Wim Engberts28-Sep-06 3:01
Wim Engberts28-Sep-06 3:01 
QuestionHow to color every letter in a Listbox diffrent Pin
Mike-Kuki28-Sep-06 2:41
Mike-Kuki28-Sep-06 2:41 
AnswerRe: How to color every letter in a Listbox diffrent Pin
Hamid_RT28-Sep-06 2:51
Hamid_RT28-Sep-06 2:51 
GeneralRe: How to color every letter in a Listbox diffrent Pin
Mike-Kuki28-Sep-06 2:58
Mike-Kuki28-Sep-06 2:58 
GeneralRe: How to color every letter in a Listbox diffrent Pin
John M. Drescher28-Sep-06 6:06
John M. Drescher28-Sep-06 6:06 
GeneralRe: How to color every letter in a Listbox diffrent Pin
Hamid_RT29-Sep-06 8:24
Hamid_RT29-Sep-06 8:24 
GeneralRe: How to color every letter in a Listbox diffrent Pin
Mike-Kuki29-Sep-06 22:09
Mike-Kuki29-Sep-06 22:09 

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.