Monday, February 13, 2012 4:52 AM
As described in title, how to achieve this in vs2008? Is it possible? I know it can be done with vs2010 MEF, but I have no idea how to do it in vs2008. Can anyone give me some help?
Tuesday, February 14, 2012 7:58 AMModerator
You also can achieve this in VS2008.
The VS2008 also has MEF.
You can refer to the following articles:
MEF for Beginner (concept) - part 1
MEF for Beginner – Part 2 (VS 2008)
Lucy Liu [MSFT]
MSDN Community Support | Feedback to us
Thursday, February 16, 2012 1:20 AMThank you, lucy. I have read the articles you provide. But I mean vs2008 itself doesn't support MEF. I think if you want to use MEF in visuao studio, vs itself must know call export objects. VS2010 is designed to do this while VS2008 not. Or did I misunderstanding?
Thursday, February 16, 2012 10:20 PMModerator
Scott, the code editor was completely rewritten in VS 2010, and is actually implemented with WPF. While you can render adornments and other elements in the code editor in VS 2010, there is NO supported way to extend the earlier editor in a similar fashion.
The older editor is entirely Win32 based and with the exception of some ability render custom glyphs in the widget bar, there is no support for drawing directly to the code editor's HWND. You would essentially have to hijack and handle the WM_PAINT message on the underlying Win32 HWND (something we do not support, nor recommend attempting).
Saturday, February 18, 2012 5:02 AMThanks. So, it is hard to achieve it in vs2008? Anyway, I will try the not recommend way, just for fun! Thanks again.
Saturday, February 18, 2012 11:10 PMModerator
Correct. There simply are not any extensibility interfaces or hooks into the older code editor that allow you to do so. As soon as one or more 'extensions' start subclassing the underlying Win32 HWND to handle messages of any kind, all bets are off. You have zero control over whoever else might try something similar. This is why it's unsupported, and definitely not recommended.
- Marked As Answer by lucy-liuModerator Monday, February 20, 2012 7:24 AM