Re: Managed code, .H and .CPP



Ignazio wrote:
> When creating forms with Visual C++ 2005, all the code for building
> the interface (the InitializeComponent method) and event handlers are
> set in the .H file, as they were inline methods. So I ask, for
> managed code they are effectively inline methods or they are handled
> indifferently if they are in the class declaration or outside of it?
> Do I still have to write declarations and definitions in different
> files for avoiding multiple compiling when including the headers or
> it is handled more like C# for managed code?

Methods defined in the class body are (I believe) NOT implicitly inline in a
managed class - they have to be represented in the IL as methods, and then
it's up to the JIT to inline them if it decides to.

That said, methods defined in the class definition are linked "as if" they
were inline, just as with standard C++, and fairly analogously to C#.

-cd


.



Relevant Pages