by Chad
3. July 2010 09:25
Icons make our applications more usable and visually stimulating. Before scouring the internet for free icons or purchasing an icon library, check out the icons that ship with (non-Express versions of) Visual Studio for free.
Since Visual Studio 2005, Visual Studio has shipped with common Windows and Office icons to encourage us to build more consistent looking applications.
Icon formats include bmp, ico, png, and xaml. Also, some animations are included in gif and avi formats. The Visual Studio Icon Library is a zip file in the program files directory.
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\VS2010ImageLibrary\1033
by Chad
11. June 2010 16:10
Can not call friend function on object which is not an instance of defining class
Google offered little help resolving this problem, so I thought I’d create this keyword-rich blog post so that someday it might climb the page ranks and help someone.
At work, we have an ASP.NET website that uses our Visual Basic 6 COM library via .NET Interops. Everything works quite well until you create a new .aspx page and forget to add the AspCompat=”true” @page directive attribute. It’s an easy thing to forget (it’s bitten me twice now.) The difficult part is that the COMException has an error message that is misleading: “Can not call friend function on object which is not an instance of defining class”.
AspCompat=”true”
The solution is actually very simple. The problem is caused because ASP.NET pages execute in a multithreaded apartment (MTA) and the VB6 COM Components expect to be in a single-threaded apartment (STA.) Adding the AspCompat=”true” attribute to the @page directive to force the page to execute in a STA.
The MSDN documentation does offer one word of caution about setting AspCompat=”true”. It can introduce performance issues if you instantiate your COM objects inside the page’s constructor. Microsoft recommends keeping that code in the page event handlers such as Page_Init and Page_Load.
6b93cd0d-0486-4781-89fa-92071ab99e4f|0|.0
Tags:
ASP.NET | COM | Web
by Chad
29. April 2010 17:22
I’ve had some people ask for this list so I’m putting it up here for everyone. Below is my outline from Wednesday night’s Springfield .NET Users group meeting presentation. These are all of the new VS2010 features that I covered. Enjoy!
New VS2010 Features
- Visual
- IDE redesigned for improved readability
- Unnecessary lines and gradients removed
- Multi-monitor support
- Document windows (Code Editor, Design View, etc.) can be placed outside of the IDE window.
- Code Editor & Design View can now be viewed side-by-side
- Performance
- Start-up is faster
- Add References Dialog is faster
- Code Editor
- Zoom
- Clicking a symbol highlights all instances of that symbol
- Move to next/previous with Shift+Ctrl+Up/Down
- Box Selection Enhancements
- Box selection Alt+Select or Shift+Alt+Arrow (available prior to 2010)
- Text Insertion: Type into a box to insert new text on every line
- Paste Contents of one box to another
- Zero-Length boxes
- Navigate To
- Edit > Navigate To
- Upper case characters make the search case-sensitive
- Wildcard, regex, and boolean operators not supported
- Intellisense
- "Contains"
- Camel case
- Completion v. Suggestion Mode
- Suggestion mode doesn't insert the suggested intellisense item
- Toggle Mode: Ctrl+Alt+Space when intellisense menu is visible.
- Debugging
- Data Tips: Tool tip watch windows
- "Stick" & "Float" debug values to the code editor
- Like floating watch window
- Scrolls with code
- Hides when new file is viewed
- Can add comments
- Can be imported/exported (as .xml)
- From debug > export datatips
- Break points window
- Can label break points
- Search and filter on labels
- Helps manage break points
- Can be imported/exported (as .xml)
- Thread Window
- Flag Just my Code > Group by Flagged > Collapse un-flagged - shows just my threads
- Search by field values
- Inline Call stack expansion
- Click arrow in location field
- Search call stacks
- Thread arrow
- Save a mini dump
- While VS breaks on an error > Debug > Save Dump
- VS can now open a .dmp file directly (not file > open project)
- Historical Debugger (Team System, Managed Code only, 32 bit only)
- Tools > Options > Historical Debugging
- Allows you to step back in time
- WPF & Silverlight Designer
- Silverlight Designer support (VS2008 was read-only)
- Drag-and-Drop data binding in WPF
- Debugging - WPF Tree Visualizer