- 01Net - Rétrospective 2006 : les fournisseurs d'accès à Internet passent la vitesse supérieure
- Podcast - Rétrospective 2006 : le coup d'envoi de la haute-définition
- ZDNet Hebdo Podcast - 2 au 5 janvier 2007
- Sennheiser MKH416 - 148
- .NET Rocks: cott Guthrie Looks Ahead
- ARCast.net - The EFx Architectural-Guidance Software Factory
- Best Damn Tech Show, Period. (12/25/06)
- Best Damn Tech Show, Period. 01.01.07
- Web 2.0 Podcast: A Conversation with Bruce Chizen
- Bryce Roberts - Technology and Venture Capitalism
- TechNet Radio - Collaborating with Sharepoint Server 2007: An interview with Arpan Shah
- ASP.NET Podcast Show 81 - AJAX Control Toolkit
- Dr. Pauline Mele - BioTech Nation
- Pro Audio Interfacing
Sunday, 31 December 2006
What I listened to this week #7
Saturday, 30 December 2006
Mixing legacy MFC code with Windows Forms (Part 3)
Summary:
The ability to intimately mix unmanaged MFC/C++ code with managed code is one of my favorite features in .NET. Migration projects that would otherwise take years can be done in a matter of months.
To re-use legacy MFC/C++ code with minimal changes and call the code from a C# Winforms application, you need to:
- Create an MFC DLL project and activate the /CLR switch to indicate that this is a mixed assembly.
- Add the legacy source files to the MFC DLL project.
- Prepare the legacy code so that it compiles for Unicode (see Converting an MFC project to Unicode)
- Add a managed class to the above project. This class will be the interface between the managed Winforms application and the legacy MFC/C++ code.
Project settings:
- Dynamically link against the MFC DLLs: in Configuration Properties > General > Use of MFC
- Compile for Unicode (this is mandatory because .NET works only with Unicode): General > Character Set
- Make it a mixed assembly: General > Common Language Runtime Support, set to /CLR. This way the DLL can contain both unmanaged and managed code. The managed code will be visible to any managed application using the DLL.
Can I debug the legacy MFC/C++ code loaded as part of the managed application?
Yes! In the project properties for the managed executable using the DLL, go to the Debug tab and tick Enable unmanaged code debugging.
Step by step:
- Create an MFC DLL using the MFC DLL Wizard. Call the project Legacy for instance. Options: Regular DLL using MFC DLL. If the legacy code is an MFC-based MDI application, the main frame will be created as soon as the DLL is loaded (through CLegacyApp::InitInstance)
- Add the source files containing the legacy code to this new project.
- Set the project settings as described above.
- Compile and fix all Unicode issues and other compiler annoyances...
- Created a LegacyWrapper C++ class.
Issues associated with compiling with /CLR:
- Warning LNK4248: unresolved typeref token (01000013) for '_TREEITEM'; image may not run. Solution here. This is because _TREEITEM is defined in a native library, but the forward declaration is done in an MSIL module. Forcing the definition of _TREEITEM in stdafx.h eliminates the warning.
Cool things in Visual Studio 2005
Useful features that do not exist in Visual Studio 2003
- Code definition window (separate window that shows automatically the definition of the variable currently under the cursor)
- Find all references command
- Class view is searchable
- Class view shows base types and derived types (C++)
- Class view contains a subpane showing members of current class (makes the tree cleaner)
- Find in files dialog is modeless (crucial for refactoring) and automatically moves to display the matched string.
New in Visual Studio 2005: http://msdn2.microsoft.com/en-us/library/88fx1xy0(VS.80).aspx
Wednesday, 27 December 2006
IE7 or Firefox?
IE7:
- I like the thumbnails view (Ctrl Q)
- I like the way it handles RSS feeds: by displaying an HTML view of the feed content first, before offering you to add it to your list.
- I don't like the text search.
Firefox:
- I like the text search (embedded in the status bar instead of a modal dialog)
- I like the download manager.
Sunday, 24 December 2006
Books I currently flip through #2
Software Engineering...
Web Services...
- Web Services Platform Architecture: SOAP, WSDL, WS-Policy, WS-Addressing, WS-BPEL, WS-Reliable Messaging, and More
- Core Security Patterns: Best Practices and Strategies for J2EE™, Web Services, and Identity Management
Enterprise Databases...
Sound
What I listened to this week #6
Video
- Mike Flasko and Anthony Jones: Winsock and .NET Protocol Agnostic Development
- SOA, Advanced Web Services, .NET and Security: The Microsoft View
- Service-Oriented Architecture (SOA): The IBM View
- PhotoSynth: What. How. Why.
- dnrTV #44 - Mark Miller on Load on Demand
Sound
- Bob Marsh, Tad Hirsch, Blaine Cook, Evan Henshaw-Plath - Telephony for Community and Activism
- IFW SOA 2006-12-06
- Live from the Canadian Vista Launch Events!
- Digital Media Insider Podcast 4: (((Echo)))
- Life Hacks with Gina Trapani
- Open Source Options
- Failure: Learning From Your Mistakes (and Ours) -
- ARCast - Web Services Security Patterns (Part 1)
- ARCast - Web Services Security Patterns (Part 2)
- Marc Fleury : JBoss est la société à abattre
- Dave Gray and Dana Smith - Visual Thinking
Saturday, 23 December 2006
Installing a wireless adapter under Vista RC2
I bought a Netgear WG111T USB2.0 adapter to connect to my Netgear DG834PN router. I thought I would have problems with Vista RC2 but I was surprised how easy it was.
I followed the install intructions: installed the drivers first then plugged-in the USB adapter. The drivers installed without any problem.
To make things easier, I disabled security on the router and enabled broadcasting of the SSID.
I tried starting up the 'NETGEAR WG111T Smart Wizard' but that didn't work: the wizard always closes immediately after launch, so I used the software built into Vista instead. Went into Network and Sharing Center > Manage wireless networks, clicked Add. Then I selected Add a network that is in range of this computer. The wizard displayed my wireless connection with a little icon indicating that it was insecure.
I selected the connection then gave a try to Internet Explorer: no problem, Internet worked like a charm.
Then I enabled WEP security and disabled the SSID broadcast. Went back to Manage wireless entworks, clicked Add. This time, my wireless connection was displayed as secured this time. I selected it and Vista prompted me for a key. Out of the 4 WEP keys it asked only the first one, which I entered, then it connected successfully.
Checked that IE still works OK, no problem.
Sunday, 17 December 2006
What I listened to this week #5
- Drums and Drumming, Part I
- IFW SOA 2006-12-13
- IFW SOA 2006-12-19
- NET Rocks: Live from the Canadian Vista Launch Events!
- actualité - Podcast 01net. du 15 décembre 2006
- ARCast.net - Non-Code Artifacts Approach Zero with Scott Hansleman
- Best Damn Tech Show, Period. (12/18/06)
- Web 2.0 Podcast: A Conversation with Jeff Bezos
- .NET Rocks! #200 - The 200th Episode Quiz Show!
- ZDNet Hebdo Podcast - 11 au 15 décembre 2006
- Daniel Lehenbauer and Kurt Berglund: Interactive 2D controls on WPF 3D Surfaces
Monday, 11 December 2006
What I listened to this week #4
- .NET Rocks! #205 - Venkat Subramaniam & Andrew Hunt Talk Agile
- Rob Short: Operating System Evolution
- Expression - Part One: The Overview
- Expression Web Training Video
- Omri Gazitt - What is Microsoft doing with Web Services?
- Ted Neward on Interoperability
- Jim Harper - Identity Crisis: Identity and Public Policy
- 2006.12.11 Emerging Technologies : Interview with Rockford Lhotka
- Web 2.0 Show - Episode 31 - Chris Matthieu
- Pro Audio Basics
Wednesday, 6 December 2006
Handy Collections
- Generic key/value pair collection that automatically sorts based on the key: SortedList<TKey,TValue>
- Same as above but without the automatic sorting and better performance with large number of items: Dictionary<TKey,TValue>
http://msdn2.microsoft.com/en-us/library/5tbh8a42.aspx
Declare either of them it as follows:public SortedList<int, Antenna> antennas;
for each (KeyValuePair<int, Antenna^> kvp in rigging->antennas)
{
Antenna^ antenna = kvp.Value;
CString antennaId;
antennaId.Format(_T("%d"), kvp.Key);
(...)
}
- I'm using key/value pair collections because I want to be able to retrieve an element given its key. But it is possible to perform much more complex retrievals in a very elegant way. Anything that implements IEnumerable can be searched.
Monday, 4 December 2006
What I listened to this week #3
Vista
- Scott Field: How secure is Vista, really? - Part I
- Scott Field: How secure is Vista, really? - Part II
- InfoCard - Deep Architecture
SOA
- ARCast - Patterns and Anti-Patterns for SOA (Part 1 of 2)
- ARCast - Patterns and Anti-Patterns for SOA (Part 2 of 2)
- SOA : "je ne veux plus entendre parler de WS-*"
- SOA Governance and Control
- Warning, Trough Approaching!
Misc
Friday, 1 December 2006
C# or C++/CLI?
Advantages of C#
- no cpp/h, just one file
- better IDE support:
- better intellisense
- code auto-complete
- refactoring (auto rename, method extraction, ...)
- code snippets
- compile errors displayed as you type
- no, it's not Microsoft proprietary, there is an ECMA standard for it.
- support for mixing managed and unmanaged code. Excellent for re-use of legacy code.
- cool language extensions (e.g. for each, ...)
- no, it's not Microsoft proprietary, there is an ECMA standard for it
Articles:
Subscribe to:
Posts (Atom)