Ahmed Salijee

January 2006 - Posts

Visual C++ - Can I do native code?

I am not much of a C++ code but one of the questions I get often is on C++ and native code. Sometimes it is just a comment that “Visual Studio .NET forces you to move all your code to .NET. That is why we have not migrated our C++ code from v6 to the latest version”. This is totally incorrect. I guess part of the confusion is due to VB where you do need to transition your code to a .NET based environment

 

Can I continue to develop native code with C++ (i.e. no dependencies on the .NET Framework at all?)

Yes

 

Will I need to make any changes to my Visual C++ v6 code if my move to VS03 or VS05?

That depends (a nice diplomatic answer) but in general yes. With the more recent versions of C++ we have moved towards closer compiler compliance and as such these changes are required to confirm to the spec. You can visit http://msdn2.microsoft.com/en-us/library/4162y30b.aspx which has links on breaking changes in the VS03 and VS05 compiler

This article on devx is already very good at explaining the changes. I quite like the final comment The changes described here affect not just Visual C++ 6.0 code ported to Visual Studio 2005. Rather, they apply to legacy C++ code ported to an ISO compliant C++ compiler in general. The fear from these changes has led many project managers to defer upgrades at all costs. This policy isn't justified, though. Almost without exception, these changes are only for the best.”

 

For ATL and MFC compatibility issues check here.

 

Can I develop pure .NET based application with C++?

Yes. The compiler supports a /clr flag along with a /pure flag. There are some limitations of libraries you can use if you are aiming for a pure .NET based app.

 

Can I take my existing code and expose it to the .NET Framework?

Yes. In fact you have a mixed mode which is a combo of .NET and native (the best of both worlds??). You might also want to check out Quake II for .NET

 

Are there any other resources I can use?

http://msdn.microsoft.com/visualc/previous/migrating/default.aspx is best link to get started with migrating

http://blogs.msdn.com/branbray/ is a nice blog on Visual C++ Internals and practices

A nice web cast on extending C++ code with .NET

The FAQ on MSDN is good too.

 

Besides the better compliant code the better security checking (via the /GS flag for example for buffer overruns checks) is a nice good reason for moving code along

Team Foundation Server due in March

As per Soma?s blog and VSLive announcement, Team Foundation Server ? which is the part that includes source control, work item tracking, automated builds etc ? will ship in Mar. Cool.  You can catch the video of the keynote and a write-up here

Updated WPF Labs Go Live on MSDN!

The updated WPF Labs based on WinFX Jan CTP are now live on the Windows Vista Dev Center! Visit http://msdn.microsoft.com/windowsvista/building/presentation/default.aspx

Sparkle is out - or should that be Expression Interactive Designer

The first public CTP of Sparkle is out. Tim Sneath has summarized some the resources at http://blogs.msdn.com/tims/archive/2006/01/24/516706.aspx. He also has a VERY QUICK quickstart here J . Go check it out and download the CTP now. Direct link to download

Where's my mobile sites

The research usually shows how mobile devices dominate over traditional PCs in terms of volume and with most of these devices are now GPRS and WiFi capable, I find it strange how few websites are mobile aware. I use my cell phone and an old Pocket PC 2002 based device quite a bit these for browsing and overall it is quite disappointing to see how few websites are mobile optimized. Surely the market opportunity is there or do we make up the minority. I am not expecting the user experience to be the same or as rich but it would be nice if web developers could take into account the growing market.

 

Personally I like to follow sports new and I have the BBC website to be excellent on both my cell phone and PPC. The BBC’s mobile friendly site has actually led me to using their site in general a lot more. They have a low graphics version their site and the performance and UI is excellent. Exchange also supports OMA (Outlook Mobile Access) and this also does an excellent job when I need to get to some email that is not synched to my device (I typically only sync my Inbox).

 

BTW The ASP.NET Mobile Controls makes developing mobile sites quite easy.

 

Enterprise Library 2 Released

I am writing this from Heathrow airport so who knows when it will get posted. Chances are the news will not be that hot when it does get posted

 

The patterns & practices Enterprise Library is a library of application blocks designed to assist developers with common enterprise development challenges. Application blocks are a type of guidance, provided as source code that can be used "as is," extended, or modified by developers to use on enterprise development projects. This release of Enterprise Library includes six application blocks (Caching, Cryptography, Data Access, Exception Handling, Logging and Security), and provides similar functionality to the previous releases for the .NET Framework 1.1; however, Enterprise Library has been redesigned to use the new capabilities of the .NET Framework 2.0.

 

Highlights of this release include:

 

  • Support for .NET Framework 2.0 Best Practices. This release makes use of many exciting new features of .NET Framework 2.0 and Visual Studio 2005, including generics and Visual Studio Team System unit tests. In addition, the new platform capabilities have enabled us to deprecate certain Enterprise Library features including the Configuration Application Block and much of the Security Application Block. Migration guidance is included in the Enterprise Library documentation.

     

    • Improvements based on customer feedback. It has been almost a year since the original release of Enterprise Library and we incorporated many improvements based on feedback from customers including our online community of over 15,000 people. This includes configurable instrumentation, improvements to the flexibility and performance of the Logging Application Block, and support for more database types through the Data Access Application Block.

       

Does anyone do blog posts from Outlook

I have been playing a bit with the My.Blogs sample available from MSDN. You can get some info on this here. It looks cool and provides me with the ability to post from Outlook. I have seen apps that integrate with Outlook and allow you to read blogs but nothing that allows you to do posting ? or have I just missing something obvious. This simple VSTO addin seems to do the trick but I still need to test it for reliability.

The one problem I have been finding though with the My.Blogs sample is that I get an HTTP 500 error whenever I post. The post goes through but the error is annoying and makes me think that perhaps is something is going wrong.

A test from Outlook using My.Blogs

This is a second test using the My.Blogs from MSDN. In this case a VSTO Outlook add-in is created and I can post directly from Outlook – yeah !!

This is a test from the My.Blogs Sample App

I am testing this from a sample MSDN app. Apologies if it appears on the aggregated home page. I will delete the postings asap