Click here to Skip to main content
16,006,378 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: combo box value Pin
David Crow15-Sep-04 3:00
David Crow15-Sep-04 3:00 
GeneralADO, Winsock, Client/Server Pin
Kudakwashe Mafutah14-Sep-04 23:01
Kudakwashe Mafutah14-Sep-04 23:01 
GeneralC++ reference question Pin
Maxime Labelle14-Sep-04 23:00
Maxime Labelle14-Sep-04 23:00 
GeneralRe: C++ reference question Pin
Ryan Binns14-Sep-04 23:18
Ryan Binns14-Sep-04 23:18 
GeneralRe: C++ reference question Pin
Maxime Labelle15-Sep-04 2:00
Maxime Labelle15-Sep-04 2:00 
GeneralRe: C++ reference question Pin
Maxime Labelle15-Sep-04 2:08
Maxime Labelle15-Sep-04 2:08 
GeneralRe: C++ reference question Pin
Mike Beckerleg15-Sep-04 3:21
Mike Beckerleg15-Sep-04 3:21 
GeneralRe: C++ reference question Pin
Taka Muraoka15-Sep-04 4:28
Taka Muraoka15-Sep-04 4:28 
Ryan Binns wrote:
Well, you're right. It's not correct code, and is particularly dangerous.

I don't have time to look it up now but I'm virtually certain there's an utterly obscure rule floating around in the spec somewhere: if a function returns a temporary object into a reference variable, that temporary object must stay alive for as long as the reference variable does.

I remember studying some funky magic written by one of those C++ gurus and he was relying on this behaviour.

[edit]
And yes, making the reference const may have had something to do with it
[/edit]




Lets be honest, isn't it amazing how many truly stupid people you meet during the course of the day. Carry around a pad and pencil, you'll have twenty or thirty names by the end of the day - George Carlin

Awasu 2.0.3 [^]: A free RSS reader with support for Code Project.

GeneralRe: C++ reference question Pin
Ryan Binns15-Sep-04 16:30
Ryan Binns15-Sep-04 16:30 
GeneralDisplaying unicode chars in textbox - evc++ Pin
soodamani14-Sep-04 22:59
soodamani14-Sep-04 22:59 
QuestionHow To Profile an ISAPI DLL in VC.NET Pin
raed14-Sep-04 22:25
raed14-Sep-04 22:25 
Generalreleasing resources in MFC Pin
nnvidya14-Sep-04 22:21
nnvidya14-Sep-04 22:21 
GeneralRe: releasing resources in MFC Pin
David Crow15-Sep-04 3:05
David Crow15-Sep-04 3:05 
QuestionHow to use VC++ with MsWord.olb to create a table in a *.doc? Pin
杀手无敌14-Sep-04 22:14
杀手无敌14-Sep-04 22:14 
GeneralCFileHeader Pin
fd975014-Sep-04 21:08
professionalfd975014-Sep-04 21:08 
GeneralRe: CFileHeader Pin
Blake Miller15-Sep-04 4:10
Blake Miller15-Sep-04 4:10 
GeneralRe: CFileHeader Pin
fd975015-Sep-04 4:43
professionalfd975015-Sep-04 4:43 
GeneralDateTime control in MFC which takes upto milliseconds Pin
ledallam14-Sep-04 20:25
ledallam14-Sep-04 20:25 
GeneralRe: DateTime control in MFC which takes upto milliseconds Pin
Arsalan Malik14-Sep-04 20:57
Arsalan Malik14-Sep-04 20:57 
GeneralRe: DateTime control in MFC which takes upto milliseconds Pin
ledallam14-Sep-04 21:04
ledallam14-Sep-04 21:04 
GeneralRe: DateTime control in MFC which takes upto milliseconds Pin
Arsalan Malik14-Sep-04 23:09
Arsalan Malik14-Sep-04 23:09 
GeneralDate Time control which milliseconds Pin
ledallam14-Sep-04 20:17
ledallam14-Sep-04 20:17 
GeneralNT Services without threads Pin
emmatty14-Sep-04 19:35
emmatty14-Sep-04 19:35 
GeneralRe: NT Services without threads Pin
ThatsAlok14-Sep-04 20:05
ThatsAlok14-Sep-04 20:05 
GeneralFree c++ compiler Pin
elfokab14-Sep-04 19:35
elfokab14-Sep-04 19:35 

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.