Click here to Skip to main content
16,021,988 members
Home / Discussions / COM
   

COM

 
GeneralRe: Getting Excel sheet names [modified] Pin
gtag2-Oct-09 6:17
gtag2-Oct-09 6:17 
GeneralRe: Getting Excel sheet names Pin
Stuart Dootson2-Oct-09 8:59
professionalStuart Dootson2-Oct-09 8:59 
GeneralRe: Getting Excel sheet names Pin
gtag2-Oct-09 23:53
gtag2-Oct-09 23:53 
GeneralRe: Getting Excel sheet names Pin
Stuart Dootson3-Oct-09 0:11
professionalStuart Dootson3-Oct-09 0:11 
GeneralRe: Getting Excel sheet names Pin
Richard MacCutchan3-Oct-09 0:39
mveRichard MacCutchan3-Oct-09 0:39 
GeneralRe: Getting Excel sheet names Pin
gtag3-Oct-09 0:43
gtag3-Oct-09 0:43 
GeneralRe: Getting Excel sheet names Pin
gtag12-Nov-09 18:31
gtag12-Nov-09 18:31 
QuestionCall an COM Server dispinterface C++ Pin
Juergen_8030-Sep-09 4:58
Juergen_8030-Sep-09 4:58 
Hi All,

I have a little tricky question for you all. Maybe (I hope so) someone can help me with my problem.

I work in Visual Studio 2005 with an C++ project. This project does not support ATL + MFC and it should not be changed, if it’s possible. Now I should call an function / get an information out of an COM (.exe) server that is still running.

Below you can see the code that was created by the MIDL Compiler / by the OLE/COM Object Viewer from my test_programm.exe(COM server).

In the code of the Test.idl file you can see the following:
dispinterface ICWOLEEvents {
properties:
methods:
[id(0x00000001)]
void OnConfigurationApply([in, out] VARIANT_BOOL* pAccept);
[id(0x00000002)]
void OnShowMessageDlg(
[in] IMsgDlg* pIMsg,
[out, retval] VARIANT_BOOL* Result);
};

The problem now I have is that I must call / work with the OnConfigurationApply and the OnShowMessageDlg functions in my C++ project. I’ve implemented the three (Test_h.h / Test_i.c / Test.idl) files in my project and I could recompile it without any error messages.

Now my questions are:
- How can I work with these two functions(OnConfigurationApply and the OnShowMessageDlg) in my C++ project?
- Is there anywhere an simple/complete c++ example project?
- Can someone explain me how I must start to work / get some information with these functions?

I’ve posted a few weeks a similar question. But now after my holiday I will post this question a little bit more detailed again.

Let me know if you need any more information about these files.

MANY MANY thanks for any hints.

Juergen

Test_h.h
.
.
.
MIDL_INTERFACE("6775FB91-B5BE-11D6-A996-0050BA24C7B9")
    ICWOLEEvents : public IDispatch
    {
    };
.
.
.


Test_i.c
//Created with the MIDL Compiler
.
.
.
MIDL_DEFINE_GUID(IID, IID_ICWOLE2,0xF560F761,0x2948,0x11D7,0xA9,0xBF,0x00,0x50,0xBA,0x24,0xC7,0xB9);
MIDL_DEFINE_GUID(CLSID, CLSID_CWOLEv2,0xF560F763,0x2948,0x11D7,0xA9,0xBF,0x00,0x50,0xBA,0x24,0xC7,0xB9);
.
.
.


Test.idl
// Generated .IDL file (by the OLE/COM Object Viewer)
//
// typelib filename: test_programm.exe
[
  uuid(90B4344B-90CD-4527-BC00-4F4D45C793D6),
  version(2.13),
  helpstring("CW  CWOLE")
]
library CW_CWOLE
{
    // TLib :     // TLib : OLE Automation : {00020430-0000-0000-C000-000000000046}
    importlib("stdole2.tlb");

    // Forward declare all types defined in this typelib
    interface ICWOLE2;
    dispinterface ICWOLEEvents;
.
.
.
.
.

    [
      uuid(6775FB91-B5BE-11D6-A996-0050BA24C7B9),
      version(1.1),
      helpstring("Event dispatch interface for CW CWOLE")
    ]
    dispinterface ICWOLEEvents {
        properties:
        methods:
            [id(0x00000001)]
            void OnConfigurationApply([in, out] VARIANT_BOOL* pAccept);
            [id(0x00000002)]
            void OnShowMessageDlg(
                            [in] IMsgDlg* pIMsg, 
                            [out, retval] VARIANT_BOOL* Result);
    };

    typedef [uuid(5CBBA151-1C47-4D6C-B14C-C527E333F812), version(1.2)]
    enum {
        ECS_DEFAULT = 0,
        ECS_FRONT = 1,
        ECS_LEFT = 2,
        ECS_RIGHT = 3,
        ECS_LEFTUP = 4,
        ECS_RIGHTUP = 5,
        ECS_TOP = 6,
        ECS_BACK = 7,
        ECS_BACKLEFTUP = 8,
        ECS_BACKRIGHTUP = 9,
        ECS_BOTTOM = 10
    } ECamSetup;

    typedef [uuid(9545E3CA-6401-4418-A040-DA3A89E2C792), version(1.3)]
    enum {
        EPM_PERSP = 0,
        EPM_ORTHO = 1,
        EPM_2D = 2
    } EProjectionMode;

    [
      uuid(F560F763-2948-11D7-A9BF-0050BA24C7B9),
      version(2.13),
      helpstring("CWOLE2")
    ]
    coclass CWOLEv2 {
        [default] interface ICWOLE2;
        [default, source] dispinterface ICWOLEEvents;
    };

AnswerRe: Call an COM Server dispinterface C++ Pin
Juergen_801-Oct-09 21:14
Juergen_801-Oct-09 21:14 
AnswerRe: Call an COM Server dispinterface C++ Pin
Stuart Dootson1-Oct-09 22:03
professionalStuart Dootson1-Oct-09 22:03 
QuestionWMP SDK 11 audio and video file DRM and attribute querying Pin
Barney Wray29-Sep-09 5:17
Barney Wray29-Sep-09 5:17 
QuestionIShellLinkW getArguments gives some strange symbols instead of the shortcuts' arguments Pin
coderomega26-Sep-09 11:26
coderomega26-Sep-09 11:26 
Questionhow to use an interface belong to another library in idl file Pin
samfromcn26-Sep-09 1:26
samfromcn26-Sep-09 1:26 
AnswerRe: how to use an interface belong to another library in idl file Pin
«_Superman_»26-Sep-09 6:49
professional«_Superman_»26-Sep-09 6:49 
GeneralRe: how to use an interface belong to another library in idl file [modified] Pin
samfromcn26-Sep-09 15:50
samfromcn26-Sep-09 15:50 
AnswerRe: how to use an interface belong to another library in idl file Pin
Vi228-Sep-09 20:14
Vi228-Sep-09 20:14 
QuestionMake Extra Cash At Home Pin
aqasim25-Sep-09 1:21
aqasim25-Sep-09 1:21 
AnswerRe: Make Extra Cash At Home Pin
Stuart Dootson25-Sep-09 2:38
professionalStuart Dootson25-Sep-09 2:38 
AnswerRe: Make Extra Cash At Home Pin
Richard MacCutchan25-Sep-09 5:56
mveRichard MacCutchan25-Sep-09 5:56 
QuestionRendering html pages wth mshtml alone (no webbrowser object or shdocvw!) Pin
gxie23-Sep-09 16:46
gxie23-Sep-09 16:46 
AnswerRe: Rendering html pages wth mshtml alone (no webbrowser object or shdocvw!) Pin
«_Superman_»23-Sep-09 20:38
professional«_Superman_»23-Sep-09 20:38 
GeneralRe: Rendering html pages wth mshtml alone (no webbrowser object or shdocvw!) Pin
gxie24-Sep-09 3:03
gxie24-Sep-09 3:03 
GeneralRe: Rendering html pages wth mshtml alone (no webbrowser object or shdocvw!) Pin
«_Superman_»24-Sep-09 21:25
professional«_Superman_»24-Sep-09 21:25 
QuestionHow to use Mysql Database in ATLCOM project. Pin
Rits11038923-Sep-09 1:22
Rits11038923-Sep-09 1:22 
AnswerRe: How to use Mysql Database in ATLCOM project. Pin
Rits11038915-Oct-09 20:54
Rits11038915-Oct-09 20:54 

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.