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 14359 articles. 0 followers. Post

0 Replies
621 Views

Similar Articles

[PageSpeed] 6


Reply:

Similar Artilces:

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...

Calling functions from functions from functions ...
Lets say I have a function g(p,x) where x and p are of some defined type. I also have a function NewtonR which I can use like so: x = NewtonR(g,p,x0) There is also another function I want to call ImplicitTrap which can be done as: u = ImplicitTrap(g,p,u0,step,n) This function defines a function of g, and it is this function that I'd like to pass to NewtonR. Can it be done? Basically the code is implementing the implicit trapezoidal rule for numerical integration with the NR solver being used at each step with automatic differentiation being used to handle the differentiation. M...

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 ...

How to name a function to minimize function names conflict?
Any recommendation on how to name one's own functions so to minimize having it be the same name as someone's else function name? Matlab has one global name space, and there is no way to divide this name space between groups of developers. (Mathworks can do a great service to us by introducing packages in the next release to allow for better file organization, keeping things backward compatible of course) The problem with the current system is that if I put a function, say filter.m, in the path, and there happened to be the same file name in the same path (which I might not be awar...

When is a function not a function?
I've got a collection of functions that accept a function or object (paired with a method name) as a callback. For the longest time I have relied on this test. (typeof cb == 'function') This should work as well, but I am not sure how well it degrades in older browsers. I think there are issues with functions created in another context (eg frame) as well. (cb instanceof Function) Then I came across this. (!!fn && typeof fn != "string" && !fn.nodeName && fn.constructor != Array && /function/i.test( fn + "" )) I'm sure it...

Function functionality
Hey, I&#8217;m sure this is something that is relatively easy to code for, but I haven&#8217;t been able to do it easily without generating lots of different error messages! Basically, I created an M-file, let&#8217;s say it&#8217;s called Batch_Run, and I want it&#8217;s operation to differ depending on what the user types in the command window. For example, currently, if the user types &#8216;Batch_Run&#8217; in the command window, MatLab processes ALL the files in the current directory using the code in the M-file. However, I would also like it so that if the use...

function of a function
Tried to solve numerically: http://groups.google.com/group/sci.math/browse_frm/thread/248f76d024c1ac57/0bba983777a07bc9#0bba983777a07bc9 thus: EQ= { f'[x] == f[f[x]], f[0]== 1} ; NDSolve[EQ,f,{x,0,2}]; But gives an error. NDSolve::ndnum: Differential equation does not evaluate to a number at x = 0. Also does not work even with other f[0] values. Any way to do that? Hi, it can't work because f[0]==1 give in your differential equation f'[0]==f[1] and NDSolve[] can't find the value for f[1] until it has integrated the equation. The neted dependence...

Function with a function
I have a GUI that calls a separate function (a different m-file) to perform a certain task. Since this task takes several minutes to complete, I would like to place some frames on the GUI to show progress as the second function runs. These frames would change colors upon getting to certain stages of the code. I am able to get the frames to change color but they do so only after the second function is finished running. Obviously this is no good. A sample of my code is as follows: set(findobj('Tag',['frame2']),'BackgroundColor','green'); This code is contained w...

Functions of Functions
Hello, I was wondering if anyone could help me with this. I've gone through the book and help files as best I can, but can't seem to figure out why the following doesn't work: I'm trying to work with functions that take functions as parameters and return other functions. Below is an example... (*clear stuff*) Clear[a, b, c, x] (*Define a functions a*) \!\(a[x_] := \((Sin[x] + x\^3\/2)\)\) (*define a function of functions*) \!\(b[f_] = \((f'' + \(3\ f'\)\/2 + 5 f)\)\) (*apply the functional function to a*) c = b[...

function of a function!!
maybe i hasn't well formulated my question before, so my question is: I have a function f = f(g) where g = g(a,b) is another function, i need, in the function f to use a parameter of the function g (let's say a), is there a way to call the parameter a inside the function f?? thanks In article <ef11409.-1@webx.raydaftYaTP>, rafi <mimosi1@hotmail.com> wrote: > maybe i hasn't well formulated my question before, so my question is: > > I have a function f = f(g) where g = g(a,b) is another function, i > need, in the function f to use a parameter of the func...

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...

function to function
Hi friends .. Is it possible to set the parameters in a function with a different function..? If yes can you please a sample to erguzel2000@yahoo.com ...

functions function
The 'functions' function has changed in R14. Further it's help text is misleading. Why would this be a good idea? This was a very useful function. Is there alternative efficient way of obtaining the parent file from a function handle? The help is misleading because it suggests that f = functions(@deblank) f = function: 'deblank' type: 'overloaded' file: 'matlabroot\toolbox\matlab\strfun\deblank.m' methods: [1x1 struct] when what you really get is, >> f = functions(@deblank) f =...

function functions
I am trying to make code for root finding and to do so I must use "function functions". In order to be more familiar with that, I tried to run one of the matlab examples like the following: function y = humps(x) y = 1./((x-.3).^2 + .01) + 1./((x-.9).^2 + .04) - 6; x=0:0.002:1; y=humps(x); plot(x,y) but I encounterd the follwing error: ??? Input argument "x" is undefined. Error in ==> ffff at 2 y = 1./((x-.3).^2 + .01) + 1./((x-.9).^2 + .04) - 6; I appreciate you inform about the problem. "Dariush Abdolah" <dabdolah@hotmail.com> wrote in message...

calling different functions but using one name; or assigning a function to a function?
Hi Folks, I have a program written long ago that uses a function repeatedly. The function contains an algorithm that returns a real value. Now I need to update the program with another function that is an new version of the algorithm. But I also need to maintain the ability to use the old function/algorithm at times. They would never be used at the same time. The user makes a selection of which algorithm to use. So what I am trying to do is (in pseudo code) function old_algo..... function new_algo ..... And a lot of code that is output:= algo(num1,num2,num3,num4,...

Function Name from Inside the function
Is there a way to get a function name from inside the function during the execution time? One reason is that it would greatly aid debugging. To illustrate the concept, let's assume that the function names are stored in the list called $FunctionNames. Now, In[]:= Clear[f, g, h]; f[x_] := (Print[{Last[#], #} &[$FunctionNames]]; x^2) g[x_] := (Print[{Last[#], #} &[$FunctionNames]]; f[x] + 5) h[x_] := Module[{fname = Last[$FunctionNames]}, Print[{Last[#], #} &[$FunctionNames]]; If[MemberQ[debugSymbol...

function name from function pointer
hi, is it possible to get function name from function pointer. I am using gcc compiler on linux. thanks sinbad wrote: > hi, > is it possible to get function name from function pointer. I am using > gcc compiler > on linux. You could fork an nm and a grep? :-) Bjarni -- INFORMATION WANTS TO BE FREE On Nov 11, 12:12=A0pm, sinbad <sinbad.sin...@gmail.com> wrote: > hi, > is it possible to get function name from function pointer. I am using > gcc compiler > on linux. > > thanks You can look at dladdr. It's GNU specific and bel...

function name from function pointer
Dear all, I have been looking for a way to print the function name (as I name it in my source code) via the function pointer. I have been asking the "oracle" (i.e. google) and a lot of forums suggested a very broad range of semi-solutions through ldaddr (not POSIX and using dynamic linking) or backtrace and some braver ones which attempted to "maintain" a table of pointers and names. Did anybody ever find a more elegant (and portable) solution? p.s.: __func__ is not what I'm looking for, since it is defined when entering the function. "Alessan...

function name as arg in function
Is there a way to use a valid function name (as a string, i.e. 'newfunc' ) as an arguement in a user defined function that will evaluate the 'newfunc' function? jeff whitney wrote: > > > Is there a way to use a valid function name (as a string, i.e. > 'newfunc' ) as an arguement in a user defined function that will > evaluate the 'newfunc' function? Have you tried using function handles? Instead of passing the string 'newfunc' pass the function handle @newfunc. Type 'doc function handle' at the command prompt. Also read 'st...

Function name within a function
I need to get the current function name within a function and assign it to a string variable. In C (C99, gcc etc.), we can do this by calling a macro "__func__" (e.g. as below): /**************** void myFunctionName(void) { char* thisFunctionName; thisFunctionName = __func__; printf ("This function name is %s\n", thisFunctionName); } /**************** when this function is called, it outputs as below: "This function name is myFunctionName" However, I would like to implement something like this in VxWorks. Thanks in advance. akarui.tomodachi@gmail...