Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / General / December 2004

Tip: Looking for answers? Try searching our database.

Automation : CodeElementFromPoint question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Flaviu Matan - 22 Dec 2004 21:57 GMT
Is there any way one can get a CodeElement from the body of a VC++ (or even
C#) function (local variable, function call etc.) using the Automation and
Extensibility API in VS .NET?

Thanks in advance,
Flaviu
Gary Chang[MSFT] - 23 Dec 2004 08:35 GMT
Hi Flaviu,

> Is there any way one can get a CodeElement from the body of a VC++ (or
> even C#) function (local variable, function call etc.) using the
Automation and
> Extensibility API in VS .NET?

Do you mean is there an VS.NET Extensibility API similal to the
CodeElementFromPoint method or anything else, the usage of the
CodeElementFromPoint?

Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Flaviu Matan - 29 Dec 2004 12:33 GMT
Hi,

What I want to know is if CodeElementFromPoint can return a valid
CodeElement if the cursor is placed on the name of a local variable inside a
function body . Given the following piece of code:

int _tmain(int argc, _TCHAR* argv[])

{

   int idx = 0;

   return 0;

}

if the cursor is placed on "idx", CodeElementFromPoint called in my VC .NET
addin will return a vsCMElementFunction CodeElement coresponding to the
"_tmain" function (instead of a vsCMElementLocalDeclStmt I suppose).
Note: I called CodeElementFromPoint with every vsCMElement enum value, the
result being the same as mentioned above.

Please let me know if what I am trying to do is achiveable using
Extensibility API.

Thanks in advance,
Flaviu

> Hi Flaviu,
>
[quoted text clipped - 17 lines]
> This posting is provided "AS IS" with no warranties, and confers no rights.
> --------------------
Gary Chang[MSFT] - 30 Dec 2004 10:01 GMT
Hi Flaviu,

>What I want to know is if CodeElementFromPoint can return a valid
>CodeElement if the cursor is placed on the name of a local variable
>inside a function body

Do you mean a vsCMElementLocalDeclStmt  here?

If so, I think it is impossible. A CodeFunction object only has the
CodeParameter elements, so you colud not retrieve a  
vsCMElementLocalDeclStmt object from a function...

Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.