|
I haven't heard about Java including 'reflection' yet, but I suppose that's a good thing. The first I heard of it was in a book on C#, and I have yet to understand why anyone cares about it. I can't figure out any use for it, any value added in terms of efficiency, readability, or maintainability. Any "improvement" that doesn't add to any of the above is mere clutter, and deserves no attention. As far as I can tell, C++ doesn't have this attribute, and it lacks nothing for its absence.
Some people think of it as a six-pack; I consider it more of a support group.
|
|
|
|
|
Oh..
I think your are wrong. Im new to C# but AFAIK with reflection you can create something like "PlugIns"
with a LOT less code than in C++ ...
|
|
|
|
|
is it somehow related to message reflection in MFC?
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
Yes, reflection is a technique that's been in Java for a long time. The Sun page for it can be found here[^]. Basically, it allows you to examine (reflect) a class at runtime and create objects and run functions that you don't know about at compile time. As the API states, you shouldn't use it where something else would be more appropriate, but it can be very useful.
C++ does have some reflection features already - you can use RTTI to examine a class, and there are various techniques for implementing the rest of reflection (policies, STL, etc).
So, it's not correct to say that C++ doesn't have reflection, but some parts of it you need to handle yourself.
|
|
|
|
|
'reflection' is the ability to obtain detailed information about an object type at runtime. You could, for instance, obtain a list of all the method signatures of an object and invoke a method explicitly through the runtime. C++ has very limited run time type information, it can compare types at runtime and perform safe dynamic casts, nothing flashy.
C++ does have templates though, which are more than sufficient to do most of the codegeneration and type inspection tricks that reflection allows - but using the compiler rather than the runtime.
Have a look at http://www.boost.org/libs/mpl/doc/[^] if you are feeling brave
Ryan
|
|
|
|
|
I have a program, that displays this in the debug window when i exit it. Do i have to worry? What does the exit code mean? I thought a healthy program should return an exit code of 0.
The thread 0xF48 has exited with code 2 (0x2).
The thread 0x3B8 has exited with code 2 (0x2).
The thread 0xF70 has exited with code 2 (0x2).
The thread 0xDCC has exited with code 2 (0x2).
The program 'D:\Documents\BarcodeRT ver2.2\Debug\BarcodeRT.exe' has exited with code 2 (0x2).
|
|
|
|
|
An exit code of 2 has no intrinsic meaning, nor does 0. It's the convention that 0 means "app exited normally" but that's not a rule. The process and each thread has an exit code, and the code can be used for whatever purpose the app wants.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
Since you have the code you ought to be able to see where the threads are setting the exit code to 2. Hopefully there will be an explaination of what the originall programmer meant by exiting with 2 rather than any other number.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fuity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Well, i wrote the program, and it spawns an additional 1 thread. I didnt return any value when i exit the thread, and that's why i'm wondering why it returns a value of 2.
|
|
|
|
|
Um, Could you post a snippet of the code that generates the thread and the function that exits the thread code? That may help?
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fuity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
in a VC++ SDI application, how to invert the screen, through code.
thank you
Bugfixer
|
|
|
|
|
use this small piece of code that help you to read each pixel of image
or use CXimage lib that wil help you out from this problem
I Think It will Work
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Can some one point me to , a conpletes list of Windows messages , i.e WM_CLOSE , or CPL_DLUBLECLICK
you can send me the link at :
aamir@signalcommunications.com.au
Aamir
|
|
|
|
|
|
Hi all,
Kindly suggest me an efficient way of handling rowsets in SQL CE. My dialog class is bit heavy and I am using the IRowset interface for SQLCE data retrieval. The application hangs when it reaches this method after few test runs. Not able to find where does the problem lie. Please suggest me the necessary resolution.
Thanks in advance,
Mallee
|
|
|
|
|
Hi all,
just wanting to know if it is possible to write code for a new rule or something of that nature that allows me to capture an email coming into my home email, and then parse and retrive data out of it?
I am looking at "Creating a Rule" in "Platform SDK: Exchange Server" but i'm not sure if that will help me, and I would like to use C++ (.Net.. only if absolutely forced to)
thanx
|
|
|
|
|
I was adding some XP flavor to my app so I can get double buffering on my listviews, and what I found out is if I have the manifest file in the directory with the program, it crashes. Without it, it don't.
So I then try to debug the sucker and noticed that WM_INITDIALOG does *NOT* get called first!
WM_NOTIFY and WM_COMMAND are being called first, and crashing.
Can anyone tell me why windows is doing this? I thought WM_INITDIALOG is supposed to ALWAYS be called first! It *IS* always called first without the manifest file though.
I am not using any windows per se, just a Dialog to do all my work.
I then added some code to basically check if WM_INITDIALOG is called, and if not, I return TRUE. What do you know, now my app works fine with all the XP flavored features. I just can't understand WHY it is doing this!
Anyone shed some light on this?
Thanks!
|
|
|
|
|
I`ve been building a program. it runs well in the debug setting, but in the release version, it will bring out an error " could not write to address memory ......". I think it`s the OS. I use win 2000 pro. Any idea?
|
|
|
|
|
|
Hi,
This is a really basic question, but for the life of me, I can't figure it out. I have an MFC dialog app that I could like to determine if it has input focus. I've tried things like GetTopLevelWindow, GetActiveWindow, and compared them to m_hWnd, but the case is never true, what should I try?
Thanks,
Aaron
modified 12-Jul-20 21:01pm.
|
|
|
|
|
GetFocus() ?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I think that works alright for my purposes.
Thanks
modified 12-Jul-20 21:01pm.
|
|
|
|
|
Hi all
I'm trying to create a simple web application with hyperlink. Please take a look at this sample.
http://msdn.microsoft.com/msdnmag/issues/03/09/net/default.aspx
What I'm trying to do is to copy the way Microsoft represents their hyperlinks (look at ones with figures).
I know how to create those hyperlinks with Javascript but I don't know with asp.net I would like to know if there are any sample codes can help me to do that
Thanks
|
|
|
|
|
Im in a property page. If the user clicks a button, how
can I make it go to another property page? I try using
the SetActivePage() command, but I always get unhandled
exemption error right here:
BOOL CPropertySheet::SetActivePage(int nPage)
{
-->> if (m_hWnd == NULL)
{
GetPropSheetHeader()->nStartPage = nPage;
return TRUE;
}
return (BOOL)SendMessage(PSM_SETCURSEL, nPage);
}
Any ideas? Please any response any one can give me will
be greatly appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
DanYELL wrote:
If the user clicks a button...
What does the button-click handler look like?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|