We help IT Professionals succeed at work.

get calling function name in the called function

yaelt
yaelt asked
on
Medium Priority
154 Views
Last Modified: 2010-05-02
Hi,

i have an existing code with function X.
i want to know in function X, who is its calling function
(it get called from about 70-80 different places so i really dont want to send a parameter or set the tag property or sth like that ... i want sth in the X function itself ).

help
Comment
Watch Question

Head of Software Services
CERTIFIED EXPERT
Commented:
Not possible I am afraid. You have to pass a parameter or set a global variable to store this information. I know that you can get it in the IDE, this is because VB itself maintains this table only in the IDE and not at runtime. It may be possible to examine the call stack but this probably won't give you any useful information as well as being extremely complex.

Author

Commented:
ok 10x
i'll do it the looong way :-(

well, i have a problem : i've tried 2 make an exe & get a message : invalid file format
what is it ???????

(tried 2 compile an old vb code that was already comipled successfully b4 )

TimCotteeHead of Software Services
CERTIFIED EXPERT

Commented:
When do you get this message, is any section of code highlighted or a file identified here?

Author

Commented:
i get it while the program tries to write the exe to the disk ( after compilation ).
the compilation completes succesfully but i cant get the exe.
TimCotteeHead of Software Services
CERTIFIED EXPERT

Commented:
As far as I can gather this may be of help in identifying the problem areas:

Invalid file format (Error 321)


A Visual Basic form file is damaged. This error has the following causes and solutions:

The form has a damaged ActiveX control.
Try replacing the ActiveX control on the form.

The number of properties in the current version of the ActiveX control don't match the number expected.
Try replacing the ActiveX control with an earlier or later version.
Valliappan ANSenior Tech Consultant
CERTIFIED EXPERT

Commented:
I know that I am late to the question, still,

for your proc./function name getting, have a look at:

http://www.inquiry.com/techtips/thevbpro/10_minute_solutions/10min0200np.asp
(call stack - how to do)

and

http://www.aivosto.com/vbwatch.html
(tool to do the same)

Author

Commented:
how do i know whick activX
i cant find a log or sth that tells me what causes the problem

Author

Commented:
how do i know whick activX
i cant find a log or sth that tells me what causes the problem

Author

Commented:
strangly, when i've closed the inbox i got my exe ...
( ??? )
TimCotteeHead of Software Services
CERTIFIED EXPERT

Commented:
Time to close this one then yaelt!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.