Generated Code In Header Files

G

Gaz

When I add say, a click event handler for a button on a form, code gets
generated in the header file within the declaration of the form class
itself. If I am not mistaken this makes the code inlined which is not what
I want. Why handler code not generated in the cpp file?

Thanks.
 
C

Carl Daniel [VC++ MVP]

Gaz said:
When I add say, a click event handler for a button on a form, code
gets generated in the header file within the declaration of the form
class itself. If I am not mistaken this makes the code inlined which
is not what I want. Why handler code not generated in the cpp file?

Because that's the way the designers work.

Don't worry about the code being inlined or not - on .NET (almost) all the
inlining is left up to the JIT compiler anyway, so whether the code is
defined inline in the header file or out of line in the CPP file is of
little consequence - it's just not "The C++ Way".

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top