method definition 
Author Message
 method definition

 Question:  How can I change the method definition?
 I make a mistake when I add one method.

[id(16), helpstring("method O_GetImage")] HRESULT O_GetImage3([out, retval]
VARIANT *pVal);

I want to change O_GetImage3 to O_GetImage. Where are the places do I need
to change. Can I delete this method?

Thanks..



Sun, 06 Mar 2005 21:35:03 GMT  
 method definition

Quote:

>  Question:  How can I change the method definition?
>  I make a mistake when I add one method.

> [id(16), helpstring("method O_GetImage")] HRESULT O_GetImage3([out, retval]
> VARIANT *pVal);

> I want to change O_GetImage3 to O_GetImage. Where are the places do I need
> to change. Can I delete this method?

You need to change it right here, as well as in any classes that
implement the interface and any code that calls the implementations.
If you miss anything, the compiler will complain about it, either
because GetImage3 will no longer exist or because GetImage will not
have been implemented.

The only potential hazard for any of this is if your component is
already being used by a client.  If it's still under development, there
shouldn't be any issues.



Sun, 06 Mar 2005 23:16:44 GMT  
 method definition
Thanks.

But In my case, I need to recompile some head file.
Why is that?


Quote:

> >  Question:  How can I change the method definition?
> >  I make a mistake when I add one method.

> > [id(16), helpstring("method O_GetImage")] HRESULT O_GetImage3([out,
retval]
> > VARIANT *pVal);

> > I want to change O_GetImage3 to O_GetImage. Where are the places do I
need
> > to change. Can I delete this method?

> You need to change it right here, as well as in any classes that
> implement the interface and any code that calls the implementations.
> If you miss anything, the compiler will complain about it, either
> because GetImage3 will no longer exist or because GetImage will not
> have been implemented.

> The only potential hazard for any of this is if your component is
> already being used by a client.  If it's still under development, there
> shouldn't be any issues.



Tue, 08 Mar 2005 03:07:17 GMT  
 method definition

Quote:

> But In my case, I need to recompile some head file.
> Why is that?

The MIDL compiler creates a couple of files that are included or
referenced in your ATL project, so once you change the definition in
the IDL, you'll also have to recompile some or all of the C++ files.

Is that what you wanted to know?

Quote:



> > >  Question:  How can I change the method definition?
> > >  I make a mistake when I add one method.

> > > [id(16), helpstring("method O_GetImage")] HRESULT O_GetImage3([out,
> retval]
> > > VARIANT *pVal);

> > > I want to change O_GetImage3 to O_GetImage. Where are the places do I
> need
> > > to change. Can I delete this method?

> > You need to change it right here, as well as in any classes that
> > implement the interface and any code that calls the implementations.
> > If you miss anything, the compiler will complain about it, either
> > because GetImage3 will no longer exist or because GetImage will not
> > have been implemented.

> > The only potential hazard for any of this is if your component is
> > already being used by a client.  If it's still under development, there
> > shouldn't be any issues.



Tue, 08 Mar 2005 04:33:30 GMT  
 method definition
After I delete the method(form the x.h) and recompile the project.
has warning C4259..., double click the message, and the method still
showing in x.h.

how to solve this problem?

Thansk.

x.h
virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
onnect(
            /* [in] */ BSTR sType,
            /* [retval][out] */ BOOL __RPC_FAR *pVal) = 0;

Quote:


> > But In my case, I need to recompile some head file.
> > Why is that?

> The MIDL compiler creates a couple of files that are included or
> referenced in your ATL project, so once you change the definition in
> the IDL, you'll also have to recompile some or all of the C++ files.

> Is that what you wanted to know?




> > > >  Question:  How can I change the method definition?
> > > >  I make a mistake when I add one method.

> > > > [id(16), helpstring("method O_GetImage")] HRESULT O_GetImage3([out,
> > retval]
> > > > VARIANT *pVal);

> > > > I want to change O_GetImage3 to O_GetImage. Where are the places do I
> > need
> > > > to change. Can I delete this method?

> > > You need to change it right here, as well as in any classes that
> > > implement the interface and any code that calls the implementations.
> > > If you miss anything, the compiler will complain about it, either
> > > because GetImage3 will no longer exist or because GetImage will not
> > > have been implemented.

> > > The only potential hazard for any of this is if your component is
> > > already being used by a client.  If it's still under development, there
> > > shouldn't be any issues.



Tue, 08 Mar 2005 05:07:37 GMT  
 method definition

Quote:

> After I delete the method(form the x.h) and recompile the project.
> has warning C4259..., double click the message, and the method still
> showing in x.h.

> how to solve this problem?

> Thansk.

> x.h
> virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
> onnect(
>             /* [in] */ BSTR sType,
>             /* [retval][out] */ BOOL __RPC_FAR *pVal) = 0;

x.h is automatically generated by MIDL.  Don't touch it, fix your IDL
and recompile your type library and MIDL will regenerate an updated x.h.


Tue, 08 Mar 2005 22:29:07 GMT  
 method definition
Could you pls tell me how to recompile the type library?

Thansk.

Quote:
> x.h is automatically generated by MIDL.  Don't touch it, fix your IDL
> and recompile your type library and MIDL will regenerate an updated x.h.



Tue, 08 Mar 2005 22:40:20 GMT  
 method definition
How about the ID No, do I need to modify it (If I delete 16, can I change
[id(17).. to [id(16)]?

Thanks.

 [id(16), helpstring("method O_GetImage")] HRESULT O_GetImage3([out, retval]

Quote:
> VARIANT *pVal);



Quote:

> > After I delete the method(form the x.h) and recompile the project.
> > has warning C4259..., double click the message, and the method still
> > showing in x.h.

> > how to solve this problem?

> > Thansk.

> > x.h
> > virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
> > onnect(
> >             /* [in] */ BSTR sType,
> >             /* [retval][out] */ BOOL __RPC_FAR *pVal) = 0;

> x.h is automatically generated by MIDL.  Don't touch it, fix your IDL
> and recompile your type library and MIDL will regenerate an updated x.h.



Tue, 08 Mar 2005 22:58:52 GMT  
 method definition
You can but you don't have to. There is no requirement that IDs be
sequential. ID value does not affect your C++ code, unless you choose to
implement IDispatch by hand and not with, say, IDispatchImpl
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> How about the ID No, do I need to modify it (If I delete 16, can I
change
> [id(17).. to [id(16)]?

> Thanks.

>  [id(16), helpstring("method O_GetImage")] HRESULT O_GetImage3([out,
retval]
> > VARIANT *pVal);



Wed, 09 Mar 2005 00:07:35 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Method definition in an IDL file

2. method definition order relevant [or compiler bug]??

3. Performance of stuct and class definitions nested in a class definition

4. Tunnelling service methods into a single method

5. Can a method be declared inside another method?

6. Why static method cannot be abstract method?

7. Dynamic Method call ( Invoke method ) failing in service when compiled as ReleaseMinDependancy

8. calling an interface method from another method in the same class

9. Calling a method from within a method, legal?

10. use method from CMainFrm class fin CMyappApp::InitInstance method of an SDI app

11. Hidden methods vs Overriden Methods

 

 
Powered by phpBB® Forum Software