Click here to Skip to main content
15,898,134 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: A simple hooking problem Pin
generic_user_id7-Oct-02 4:06
generic_user_id7-Oct-02 4:06 
Generalclass not accessible in class wizard... Pin
nss4-Oct-02 8:40
nss4-Oct-02 8:40 
GeneralRe: class not accessible in class wizard... Pin
Carlos Antollini4-Oct-02 8:53
Carlos Antollini4-Oct-02 8:53 
Generalwow! Thanks! Pin
nss4-Oct-02 9:17
nss4-Oct-02 9:17 
Generalretain focus on modeless dlg, once Pin
brianwelsch4-Oct-02 8:33
brianwelsch4-Oct-02 8:33 
GeneralRe: retain focus on modeless dlg, once Pin
Anonymous4-Oct-02 11:06
Anonymous4-Oct-02 11:06 
GeneralInline and optimisations Pin
krisn4-Oct-02 8:28
krisn4-Oct-02 8:28 
GeneralRe: Inline and optimisations Pin
alex.barylski4-Oct-02 10:52
alex.barylski4-Oct-02 10:52 
AFAIK either method should work under certain circumstances.

MSDN says:

The __forceinline keyword instructs the compiler to inline the function without performing any cost/benefit analysis.

If your using VC++ 6.0 you can specify whether inline should occur with:

Project->Settings->C/C++->Category->Optimizations->Inline function expansion


Check your build mode to make sure it's set to Any suitable for both debug and release.

I always use the C++ implicit inline method for trivial functions.

class myClass{
  int myInline(){ return 100; }
};


I'm not 100% sure, but I think it's gaurenteed to inline when declared and defined as above and you avoid un-needed inline keywords. Also I tried this a while back and came to this conclusion...You cannot under any circumstance inline a ctor() in debug.

You asked:
"Now the code still does not get inlined. If I move the function definition into the header file, then it is inlined."

So why not do it this way...? Smile | :)

Cheers! Smile | :)

"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
GeneralRe: Inline and optimisations Pin
Joe Woodbury7-Oct-02 21:18
professionalJoe Woodbury7-Oct-02 21:18 
GeneralRe: Inline and optimisations Pin
l a u r e n4-Oct-02 11:14
l a u r e n4-Oct-02 11:14 
GeneralRe: Inline and optimisations Pin
alex.barylski4-Oct-02 14:51
alex.barylski4-Oct-02 14:51 
GeneralRe: Inline and optimisations Pin
krisn6-Oct-02 23:21
krisn6-Oct-02 23:21 
GeneralRe: Inline and optimisations Pin
Mike Nordell4-Oct-02 23:04
Mike Nordell4-Oct-02 23:04 
GeneralRe: Inline and optimisations Pin
krisn6-Oct-02 23:22
krisn6-Oct-02 23:22 
GeneralRe: Inline and optimisations Pin
Mike Nordell14-Oct-02 8:18
Mike Nordell14-Oct-02 8:18 
GeneralMouse position Pin
Act_4474-Oct-02 6:55
sussAct_4474-Oct-02 6:55 
GeneralRe: Mouse position Pin
Roger Allen4-Oct-02 7:05
Roger Allen4-Oct-02 7:05 
GeneralRe: Mouse position Pin
Anonymous4-Oct-02 7:54
Anonymous4-Oct-02 7:54 
GeneralCOleSafeArray::PutElement Pin
Kash4-Oct-02 5:58
Kash4-Oct-02 5:58 
GeneralRe: COleSafeArray::PutElement Pin
Ranjan Banerji4-Oct-02 8:50
Ranjan Banerji4-Oct-02 8:50 
QuestionHow to capture mouse movement with a derived base class Pin
work_to_live4-Oct-02 5:40
work_to_live4-Oct-02 5:40 
AnswerRe: How to capturing mouse movement with a derived base class Pin
Tomasz Sowinski4-Oct-02 5:51
Tomasz Sowinski4-Oct-02 5:51 
GeneralRe: How to capturing mouse movement with a derived base class Pin
work_to_live4-Oct-02 7:07
work_to_live4-Oct-02 7:07 
Generalproblem with CPtrArray Pin
Tom Putzeys4-Oct-02 5:29
sussTom Putzeys4-Oct-02 5:29 
GeneralRe: problem with CPtrArray Pin
Pavel Klocek4-Oct-02 6:34
Pavel Klocek4-Oct-02 6:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.