How to navigate from one interface to another - please help 
Author Message
 How to navigate from one interface to another - please help

Dear All,

I have a client code as follows

                        try

                        {

                                    IAPScomPtr spIAPScom(__uuidof(APScom));
// Here the COM class name is sent.

                                    long ip;

                                    long op;

                                    ip = 123;

                                    spIAPScom->GetConnected(ip, &op);

                                    IAPScomxt1Ptr spIAPScomPtr(spIAPScom);

                                    spIAPScomPtr->GetConnectedxt1(ip, &op);

                        }

                        catch(const _com_error& Err)

                        {

                                    TCHAR buff[255] = {0};

                                    wsprintf(buff, _T("Error: 0x%x "),
Err.Error());

                                    MessageBox(buff, _T("Tell Anand Error
Code 1"));

                        }

The server has two interface one is IAPScom and the other is IAPScomxt1. I
am not able to navigate from one interface to another. The above client code
is not working when I try to get the interface pointer for IAPScomxt1. Am I
missing any thing? Please help.

My server code IDL definition is like this:

// APSServer.idl : IDL source for APSServer.dll

//

// This file will be processed by the MIDL tool to

// produce the type library (APSServer.tlb) and marshalling code.

import "oaidl.idl";

import "ocidl.idl";

            [

                        object,

                        uuid(FF647628-A634-42D5-AC66-F56E397CBEA6),

                        dual,

                        helpstring("IAPScom Interface"),

                        pointer_default(unique)

            ]

            interface IAPScom : IDispatch

            {

                        [id(1), helpstring("method GetConnected")] HRESULT
GetConnected([in] long InputValue, [out] long* OutputValue);

            };

            [

                        object,

                        uuid(457028FE-57C4-4102-9074-1663E8461AEB),

                        helpstring("IAPScomxt1 Interface"),

                        pointer_default(unique)

            ]

            interface IAPScomxt1 : IUnknown

            {

                        [helpstring("method GetConnectedxt1")] HRESULT
GetConnectedxt1([in] long InputValue, [out] long* OutputValue);

            };

[

            uuid(261889FE-D9DB-4E39-B5F6-656E93F88473),

            version(1.0),

            helpstring("APSServer 1.0 Type Library")

]

library APSSERVERLib

{

            importlib("stdole32.tlb");

            importlib("stdole2.tlb");

            [

                        uuid(68BE6516-61FF-4013-9F29-2557CCCA299F),

                        helpstring("APScom Class")

            ]

            coclass APScom

            {

                        [default] interface IAPScom;

                        interface IAPScomxt1;

            };

Quote:
};

Only IAPScom is derived from IDispatch the other interface IAPCcomxt1 is
derived from IUnknown.

Thanks

Anand



Sun, 10 Oct 2004 01:14:13 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. New to ATL Please Help - Navigating Interface with two types of server (Exe and Dll)

2. Please help!!!!Please help!!!!Please help!!!!Please help!!!!Please help!!!!Please help!!!!Please help!!!!

3. Navigate and IWebBrowser2 interface

4. Create one singleton object in other interface's method (in one project)

5. Calling one Interface method into another Interface

6. Please help!!!!Please help!!!!Please help!!!!

7. please any one help me in dividing 1024 bit number with 1024 bit another number

8. Some one please help me - it's urgent

9. Please help me one more time:(

10. Novice seeks help with interfaces (please:-)

11. Please help with interface implementation.

12. Using one header file for several source files - help please

 

 
Powered by phpBB® Forum Software