|
Is there any way to get reference of the caller function? In a program, a function calls to another which further calls to some other function and so on. In any function, is it possible that which function transferred controlled to current function?
In .NET we can get the current function name using MethodInfo.GetCurrentMethod but this class (MethodInfo) doesn't support the parent function info which called this current method. We need to get that; Any suggestion/help will be appreciated.
Thanks,
Sameers
Need custom software? Contact DevelopersINN[^]
Need to add reminders for your Outlook emails? Try Outlook PA[^]
|
|
|
|
|
Normally, a method shouldn't be bothered with things like which method is calling it. Why do you think that you need that?
The information is in the call stack. One method of getting that is to throw an exception and catch it, then you get an exception object that contains an analysis of the call stack. Not a very efficient method, though.
---
b { font-weight: normal; }
-- modified at 4:23 Sunday 8th January, 2006
|
|
|
|
|
|
Thanks for the link. It works. Great.
Thanks again,
Need custom software? Contact DevelopersINN[^]
Need to add reminders for your Outlook emails? Try Outlook PA[^]
|
|
|
|
|
Hi, I can't find any documentation about inserting other controls (for example a linkLabel) to a DataGrid. All I know is that I have to inherit from DataGridColumnStyle class and override some methods. The question is how to do it? What methods have to be overriden? I've seen the article about putting a combobox in a DG but I don't find it satisfying.
_slav_
|
|
|
|
|
By definition, the articles on putting a combobox in a grid will contain all the code you need, no matter how satisfying they may or may not appear.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Is there a way to handle WM_SYSCOMMAND (specifically SC_CLOSE ) in a Windows Forms application other than handling the Closing event?
Thanks,
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Override your forms WndProc procedure. You'll get to see every message that comes into that form and act on it, either before or after, your the forms base WndProc method does.
Control.WndProc Method[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Is there a tool for generating autommatically a makefile?!
Thank you,
Maze
who dares wins!
|
|
|
|
|
Check the structure of what my problem is:
S.No Zones Emp.Name sales
1 South 001 10
2 South 002 9
3 South 005 11
Sum South 30
4 East 009 5
5 East 100 7
Sum East 12
6 North 999 9
7 North 777 1
Sum North 10
the above is what i want to build, now can anyone has done this kind of thing before. Plz help me i have to submit this in 2 days you can contact me on sood_is_in@yahoo.co.in
sdf
|
|
|
|
|
Sorry, but us doing your homework for you doesn't do you any good. Sure, you might get a passing grade, but further down the line, when you try to build upon what you don't understand now, you'll fall flat on your face and fail.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Happily, this kind of mentality isn't going to get your work done... and I see you've missed your deadline.
But, putting a table structure up and asking if anyone has done this before, also, doesn't really ask any kind of question that we could help you with. It'll get you a Yes or No answer. Mostly Yes because we've all put data structures together. After all, that what programming is all about, the organization, management and manipulation of data.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I was wondering if it is considered bad style to make event handlers public. Say you do this:
public void Send(object sender, SomeEventArgs e)
{
}
I can't find anything in the coding guidelines that say one way or the other whether this is considered good or bad style. On the other hand, I'm having a hard time finding an example of public event handlers in the .NET framework.
The reason I would have for making event handlers public is that it would allow a third party to connect and disconnect event handlers in one object to events in another object. This would allow the flow of events through an application to be configurable during runtime.
|
|
|
|
|
It's not a real good idea unless you want code from outside your containing class to be able to call those handlers. Even code that isn't actually firing an "event" can call your handler if it uses the correct parameters.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote: It's not a real good idea unless you want code from outside your containing class to be able to call those handlers. Even code that isn't actually firing an "event" can call your handler if it uses the correct parameters.
That's a good point to consider. If it's important that the event handler be called in response to an event, especially when the source of that event is important, it should probably remain private.
|
|
|
|
|
I have written a small application in Managed C++ that traverses the filesystem and comes up with an array of FileInfo objects representing each file within the path provided and its subdirectories. The point of this is to sort the entire list (potentially thousands of files) by size, filename and subsets, dates, etc. regardless of the directory they reside in. The problem I am having is that I can't sort the FileInfo type.
using ArrayList* files seems to be my best option for collecting the list,
then files->Add(someFileInfoObject) to populate the array.
This all works well and I get an accurate list of files. But files->Sort() needs to access IComparable::CompareTo, which is not implemented by the FileInfo class. I tried to create a new class, MyFileInfo based on FileInfo to implement IComparable, but was then told by Visual Studio that FileInfo is sealed, so I can't inherit from it.
I could spend my time creating custom sorting routines, but there's got to be a way to sort FileInfo objects that I'm overlooking. If I can't inherit from FileInfo, therefore can't add the IComparable interface to it, which seems the most elegant solution, I'm planning to create a __gc class MyFileInfo : public IComparable that contains its own FileInfo class rather than inheriting from it, then just passes along the information needed from within FileInfo. This seems it may work, but would require typing dozens of little stub routines just to allow MyFileInfo to pretend to be an extended FileInfo.
The reason I'm asking instead of just doing is that sorting files seems to be something that ought to be supported by default someplace. Any suggestions or ideas?
-mike
-www.channelmike.com
-- modified at 13:40 Friday 6th January, 2006
|
|
|
|
|
Sort is not something the FileInfo class really should support anyway.
How about using FileInfo to gather all the particulars for each file, like filename, parent folder, size, ..., and dumping that information into a ListView, DataTable, or even an Access database. You could then provide, or use as the case may be, the sorting methods without adding the overhead of the rest of the FileInfo class.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I think you can pass an IComparer to Sort(), just write your own FileInfoComparer.
|
|
|
|
|
Last time (1996) I developed with Delphi, there was a control with seperate "pages" to visually put controls onto and then switch the "pages" by code.
I.e. like a TabControl, but without displaying the tabs. Something like a "StackedPanelControl ".
Is anyone aware of such a control for Windows Forms 2.0?
--
Affordable Windows-based CMS for only 99 €: try www.zeta-producer.com for free!
|
|
|
|
|
I don't think there is a similar control. I would imagine that rolling your own control using Panels wouldn't be very difficult.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is the MarshallByRefObject class only used in Remoting or can it be used in the case of Windows Sockets too? Supposing, I want to serialize a class and send it over a UDP Socket connections to all the clients, then does the class have to be inherited from the ISerializable interface or the MarshallByRefObject class?
Can anyone help?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
Do you really think that sending a serialized class over UDP is a good idea? UDP does not garantee the arrival of packets, but more importantly, it doesn't garantee that they are received in the correct order!
Your deserialization code must be able to put up with this eventuality and be able to recover from it. What is the impact of not being able to recieve this object on your client, ... server? Can your data model withstand a few, some, or all or your clients not receiving this object?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave,
Thanks for your reply. Well my cirteria is that all the clients in the network have to broadcast a keep alive message so that the server can receive the packets. The packets will basically contain the Computer name of the client and the port number it is listening at.
Is UDP a good choice for this or is there any other better model for it?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|