J'ai un serveur COM(qui lui m�me est un client COM) avec un .idl donn� et j'essaye de developper un client, j'arrive bien � cr�er une instance de mon serveur (Hello.exe se lance)mais lors de l'appel d'une m�thode de mon serveur, j'ai une erreur du genre 'First-Exception 0x000006B5: No Name.'Sachant que je voie appara�tre la liste des m�thodes expos�es par le .idl.
Ci-dessous se trouvent le .idl de mon serveur et les qlq ligne de code du cot� client:
Auriez-vous une petite id�e ?
Code SRV:
Code CLIENT :Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76 [ uuid(xxx), version(1.0), helpstring("Hello 1.0 Type Library") ] library Hello_Library { importlib("stdole32.tlb"); importlib("stdole2.tlb"); //! This is the public COM interface exposed by the Hello [ object, uuid(yyy), dual, helpstring("IHello Interface"), pointer_default(unique) ] interface IHello : IDispatch { [id(1), helpstring("method ConnectMCU")] HRESULT SayHello(); ...... }; //! This interface is used for testing (for example by the testing tool) [ object, uuid(zzz), dual, helpstring("IHelloTest Interface - this interface is used for tests"), pointer_default(unique) ] interface IHelloTest : IDispatch { }; //! Declares the COM object and its interfaces [ uuid(xxx), helpstring("Hello Class") ] coclass Ello { [default] interface IHello; interface IHelloTest; }; //! This fake object is used by scripting languages to access the IHelloTest interface [ uuid(www), helpstring("HelloTest Class - This class is used by VB to access the IHelloTest interface"), hidden, noncreatable ] coclass HelloTest { [default] interface IHelloTest; }; //! This fake object is used to declare the IOther and IOther2 //! interfaces, [ uuid(vvv), hidden, noncreatable ] coclass HelloRegisterAllInterfaces { interface IOther; interface _IOtherEvents; interface IOther2; }; }; {
Code:
1
2
3
4
5
6 CComPtr<IHello> m_pHello; HRESULT hr =::CoCreateInstance(CLSID_Ello, NULL, CLSCTX_LOCAL_SERVER| CLSCTX_REMOTE_SERVER,IID_IHello,(void**)&m_pHello); HRESULT h0 = m_pHello->SayHello(); //ERROR !!