How to get function Name against function address of vtable?

  • Permalink
  • submit to reddit
  • Email
  • Follow


Hello,

I need to call the co-class function by reading its address from
vtable of COM exposed interface methods. I need some generic way to
read addresses.

Now I need to call the function, which would have specific address(NOT
KNOWN) arguments(parameters) which I have collected from TLB, and name
as well. How that address corresponds to that function name to which I
am going to call.

For this I need to traverse vtable which is holding functional
addresses, LASTLY need to correspond function address with NAME of
that function. This is I dont know. How? More over one function with
the same name may appear in vtable(Overloading case). In that case we
need to distinguish function names w.r.t their addresses. How to
tackle ?

Regards
Usman
0
Reply glitteringsounds 3/12/2010 10:30:27 AM

See related articles to this posting
comp.os.programmer.win32 14281 articles. 0 followers. Post

0 Replies
427 Views

Similar Articles

[PageSpeed] 30

Reply:

Similar Artilces:

Get address of function by name at runtime?
Can something like this be done in Solaris or Linux? i.e. Find the address of a function from a string variable and call it dynamically at run time? void main(void) { char *s="FindData"; void (*fPointer) (void); /* Get address of desired function */ fPointer=SomehowGetAddressOfFunctionFromString(s); /* Call Function */ fPointer(); } void FindData(void) { printf("It worked\n"); } Martin Crouch <spamspamspam@spaml.com> writes: > Can something like this be done in Solaris or Linux? i.e. Find the > address of a function from a string variable ...

... so why do I have to give the class name when getting the address of a member function?
So to steal a couple of lines from the FAQ, I have typedef int (Fred::*FredMemFn)(char x, float y); FredMemFn a[] = { &Fred::f, &Fred::g, &Fred::h, &Fred::i }; If this is inside another member function of Fred, why do I have to give the class name? After all, if I wanted to _call_ f(char, float) it would happily work it out. Just curious... (had to code up some calls passing member functions today, which is not something I do a lot) Andy Andy Champ wrote: > So to steal a couple of lines from the FAQ, I have > > typedef int (Fred::*FredMemFn)(char x, float ...

Need to get to function names using an assembly instruction address
Hi Folks, I want to get to a function/routine name, given an address of an instruction address. Something like what a dbx subcommand on AIX like '0x????????/i' would do or what a 'listi <function name> would do. Where does dbx find this name string. I have been trying to see if I can dig up something from the XCOFF file, but that approach seems pretty panful. I checked the 'dbx' binary on my AIX 5.1 box, and it does seems not to have been linked to libld.a, which would be required to use for a little less painless approach to getting to symbol strings, unless dbx doe...

get name of function within function
Is there a way to find out the name of the function within the function? I'm doing troubleshooting of a page in which I call a lot of functions. I had a simple error message pop up, which was okay back when the page way simple. Now that the page has grown, it's a PITA to find out where exactly the error message is being triggered. It would be very helpful if I could find out which function I'm "in" when the error message gets called. On Apr 17, 11:56 am, lawp...@gmail.com wrote: > Is there a way to find out the name of the function within the > function? > >...

how to get name of function from within function?
I want to get the name of the function from within the function. Something like: def myFunc(): print __myname__ >>> myFunc() 'myFunc' Really what I want to do is to easily strip off the prefix of a function name and call another function. Like this: def prefix_myFunc(a, b, c): name = __myname__[7:] call(name, a, b, c) That would call myFunc(a, b, c). How do I accomplish this 'elegantly', err...'pythonicly'..=) Also, is there a way to turn normal positional args into a tuple without using *? Like this: def f(a, b, c): print get_args_as_tuple() ...

function name to function address translation?
Help! I've been doing C language development for a long time, but this problem has me stumped. I would like the user to be able to enter the name of a function that has been linked into the application they are currently running, and have the application call the function they have requested. Example code: char fn_name[80]; int (*p_fn)(int,int,int *); int res1,res2; printf("Function name? "); scanf("%s",fn_name); p_fn = translate_function_name_to_function_address(fn_name); if (p_fn) res2 = (*p_fn)(5,20,&res1); else printf("ERROR - requested functi...

How to get the current function name inside a function?
Hi, In gnu C++, I can use __PRETTY_FUNCTION__ to get the function info inside a function. I'm wondering if it is possible to do the similar thing in matlab? Thanks, Peng In article <3f296615-8ab0-444b-813b-2093bd02f934@d45g2000hsc.googlegroups.com>, Peng Yu <PengYu.UT@gmail.com> wrote: >In gnu C++, I can use __PRETTY_FUNCTION__ to get the function info >inside a function. >I'm wondering if it is possible to do the similar thing in matlab? Try [ST,I] = dbstack; __PRETTY_FUNCTION__ = ST.name; -- "All human knowledge takes the form of interpretati...

How to know the function name by function pointer's address
Hi forks: I use the gcc's compiler flag -finstrument-functions which will generate instrumentation calls for entry and exit to every functions.Just after function entry and just before function exit, the fol- lowing profiling functions will be called with the address of the current function and its call site. The prototype of function which shall be called afetr function entry is void __cyg_profile_func_enter (void *this_fn, void *call_site); the pointer this_fn is the address of callee function, and the call_site is the address of caller function. How do I know the function name b...

get-function-name
Hello, I want to write a generic errorhandler-function. This function should return the functionname, where the error has happened in a dynamic way. Is it possible to fetch the functionname from inside a function? Regards Michael Michael H´┐Żnisch <Michael.Hoenisch@ascad.de> writes: > Hello, > > I want to write a generic errorhandler-function. This function should > return the functionname, where the error has happened in a dynamic way. > > Is it possible to fetch the functionname from inside a function? Not portably. Moreover, a lot of functions don't have a...

Getting Function Name
Bosses, I have defined a Function which prints Error, it takes couple of Parameters, What I want is, IF I can some how send the name of the function as one of the parameter so that when the Error Function prints the message it also tells me from which function it has been called is it possible as my Script Executes George Kinley <georgekinley@hotmail.com> wrote in comp.lang.perl.misc: > Bosses, > I have defined a Function which prints Error, it takes couple of Parameters, > What I want is, IF I can some how send the name of the function as one of > the parameter so that w...

get the address of a function??
Is the following program print the address of the function? void hello() { printf("hello\n"); } void main() { printf("hello function=%d\n", hello); } please advice. thanks.... John said: > Is the following program print the address of the function? > > void hello() > { printf("hello\n"); > } > > void main() > { > printf("hello function=%d\n", hello); > } The behaviour of the program is undefined in at least three ways. So - maybe it will do what you want, and maybe it won't. Maybe it w...

getting the function name
Is there a way in Python to print the name of the function one is currently in? The code def foo(): debug = True if (debug): print "entered",__name__ x = foo() outputs "entered __main__" I want to print "entered foo". Of course I could just hard-code the string "foo" in a print statement, but I don't want to have the function name written in more than one place. beliavsky@aol.com wrote: > Is there a way in Python to print the name of the function one is > currently in? >>> def f(): .... tb = traceback.extract_s...

Get the name of a function
Hi all, is there a way to retrive the function name like with self.__class__.__name__? Using self.__dict__.__name__ I've got >>> def test(): .... print(self.__dict__.__name__) .... >>> test <function test at 0x0178DDF8> But I really just want the function name, so 'test' Any help? Thanks, Mattia On 8/5/2011 11:52 AM gervaz said... > Hi all, is there a way to retrive the function name like with > self.__class__.__name__? yes, but not reliably: Python 2.6.4rc2 (r264rc2:75497, Oct 20 2009, 02:55:11) [GCC 4.4.1] on linux2 Type "help"...

get function address
how can i get the one function address if i know the memory address of shared object contains the function???e.g the libc memory address is: b7f01000-b805d000 r-xp 00000000 08:06 6172 /lib/tls/i686/cmov/ libc-2.9.so b805d000-b805e000 ---p 0015c000 08:06 6172 /lib/tls/i686/cmov/ libc-2.9.so b805e000-b8060000 r--p 0015c000 08:06 6172 /lib/tls/i686/cmov/ libc-2.9.so b8060000-b8061000 rw-p 0015e000 08:06 6172 /lib/tls/i686/cmov/ libc-2.9.so how can i calculate the function 'fprintf' address? On Jun 17, 10:34=A0pm, Xend <firperf...@gmail.com> w...

How to call a function by a string of name & How to get the name of a class?
---------------------------This is my task:-------------------------------------- There are hundred of similar classes and a large file(in processing) with thousand of instances of these classes. I should export these instances into a XML file (I use Tiny XML), however not total instances, but these which belong to the selected classes and the selected attributes(member variable and value). In advance, I will have a configuration file (also XML format), to define which classes and which attributes we need, that is a user-defined file. The problem are: 1, How do I get the name of a class? Ju...

Finding The Function's Name At An Address
I have a process that hangs every once in a while. Here's what ps says: F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD 0 S 520 32695 32688 0 84 0 - 605847 184467 ? 00:00:09 java As you can see it's in an interruptible sleep, but I'd like to know what it's waiting on. In this case WCHAN just shows the (partial) address (this is not a result any System.map issues as it normally will show the function name) of the function. Why does WCHAN not show the function's name, is it because it could be a user defined function? Debugg...

a function to output multiple variable names, getting the name of a var into a string,
Hi, $mice = array('mickey','minni','mighty'); $pets = array('cow'=>'bessie','dog'=>'fido','mice' => $mice); $config = 'some setting'; function showvars($message){ $args = func_get_args(); echo"<pre>"; print_r($args);echo"</pre>"; echo "$message <BR>"; foreach ($args as $k=>$v) { $name = var_name($k,get_defined_vars()); echo '$'.$k.' = '.$v."<br>"; } } function var_name (&$iVar, &$aDefinedVars){ foreach ($aD...

Getting address of a function through some string
#include<string.h> void (*foobar)(); void main() { char *str; strcpy(str,"Fun1"); strcat(str,"method1"); foobar= ( Here i should get the address of Fun1method1 function through "str") (*foobar)(); } void Fun1Method1() { printf("Here ... I am !!!"); } Can any one please help with this .... Prashanth Badabagni wrote: > #include<string.h> > > void (*foobar)(); > void main() > { > > char *str; > strcpy(str,"Fun1"); > strcat(str,"method1...

Get name of calling function...
Given a currently executing function is there a cross browser way to get (1) the name of the calling function (assuming there is one) and (2) the name of the current function? I've see references to (depricated) arguments.callee - but that doesn't work in IE. Your input appreciated hzgt9b <celoftis@gmail.com> writes: > Given a currently executing function is there a cross browser way to > get (1) the name of the calling function (assuming there is one) and > (2) the name of the current function? > > I've see references to (depricated) arguments.callee - but...

Getting a function name from string
If I have a string that contains the name of a function, can I call it? As in: def someFunction(): print "Hello" s = "someFunction" s() # I know this is wrong, but you get the idea... /David "David Rasmussen" <david.rasmussen@gmx.net> wrote in message news:436943e0$0$2083$edfadb0f@dtext02.news.tele.dk... > If I have a string that contains the name of a function, can I call it? > As in: > > def someFunction(): > print "Hello" > > s = "someFunction" > s() # I know this is wrong, but you get the idea... > >...

How to get argument name for some function?
For example: function test($left, $right) { } $ret = some_php_api('test'); print_r($ret); //it would be /* array( 1 => 'left', 2 => 'right', ) */ Yarco wrote: > For example: > > function test($left, $right) > { > } > > $ret = some_php_api('test'); > > print_r($ret); > > //it would be > /* > array( > 1 => 'left', > 2 => 'right', > ) > */ I can't help you with your main question. However, assuming this is a function you control, could you track this yourself? $arg...

How do I get the name of the caller function?
Hi, Say I write function "X" which I intend to be called by other Matlab functions. Is there a command I can insert into X which would report the name of the function that called X? I don't want to have to pass the name of the caller function to X as an input variable. i.e. this would not be a suitable solution: X(inArgA,inArgB,mfilename) Cheers Look at the dbstack function which gives you the entire calling sequence. Regards ML "Malcolm Lidierth" <ku.ca.lck@htreidil.mloclam> wrote in message <hrc5to$foq$1@fred.mathworks.com>... > Look a...

how to get function names from the file
I have got names of functions stored in the file. For the simplicity expect one row only with two function names: printFoo, printFOO In my code I would like to define functions and then to read function names from the file, so the functions can be executed in the order the function names are stored in a file. While trying to read the names from the file I am getting always "strings" and I am not able to execute them. I would like to write my code so it will look something like: def printFoo(): print "foo" def printFOO(): print "FOO" # here I would lik...