2008年7月30日星期三

Visula Studio Tips

Tip #4 : Conditional Compilation Symbols


[Conditional("condition1")]
public void Foo()
{
...
}

But I found some limitations for it:
1, can not apply to interface functions;
2, the return type of functions MUST be void.


Tip #3
: In MFC projects, use "Call Browser". You can see it in right click popup menu.




Tip #2 : enable mixed mode debug. When you call managed functions from un-managed world. You may found the managed codes sample can NOT be loaded. Here is the trick to enable the load.



Tip #1 : use "ctrl + i" to search. after press the two keys, you can see a telescope shown on the screen, then type the word you want to search. Some time this is more convenient than "ctrl + f".

2008年7月22日星期二

Expression Blend Tips


Tip #1:
Use "search" to find the property you want.
Tip #2:
Use "Color Eyedropper", you can pick any displayed color on your PC screen.

2008年7月9日星期三

Use Google Reader read RSS


在使用多种RSS阅读器之后,感觉还是 Google Reader 最好,推荐给大家。这是个 Web 应用程序,不需要安装,只要访问 www.google.com/reader 即可。当然你需要一个 google 帐号。注意上图中使用红色圆圈标出的部分,使用这些功能可以方便的帮助你管理的你 feeds 。都是很简单的东西,这里就不多说了,自己动手试试吧。

2008年7月7日星期一

Minimun Windows Version for VC2008

Our project team is moving codes from vs2005 to vs2008. Most legacy codes are MFC based. We saw one compile error after the migration. We dig out the reason in MSDN.

Origin : in Chinese, in English

---- from MSDN ---

Visual C++ 概念:移植和升级
如何:修改 WINVER 和 _WIN32_WINNT
从 Visual C++ 2008 开始,Visual C++ 不支持面向 Windows 95、Windows 98、Windows ME 或 Windows NT。如果您的 WINVER 或 _WIN32_WINNT 宏被指定到这些 Windows 版本之一,则需要修改宏。当升级从 Visual C++ 的以前版本创建的项目时,如果将 WINVER 或 _WIN32_WINNT 宏指定到不再受支持的 Windows 版本,可能会看到与这些宏相关的编译错误。

2008年7月6日星期日

New Updates to MFC in VS2008

Here is a 30 minutes vedio talk about new updates to MFC in vs2008. If you are working with MFC, this is what you should watch.

2008年7月4日星期五

WPF ?

So many ab. in this world. What's WPF? If C# == C++ , then WPF == MFC; WPF just another package in .NET framework.












To develop WPF application, you need these dev tools:
1, Visual Studio 2008 (or 2005 with some sp);
2, Microsoft Expression Blend, for the GUI programming, if you never heard it, google it.

2008年7月3日星期四

The power of UserControl

System.Windows.Controls.UserControl, here is some trick you can use it.

Senario 1:
You need display a image in your program. You can use xaml only, or you can use C# codes only. In some cases, combine xaml and Csharp is powerful. First you create a UserControl which only contain the picture, then you get a new class. In Cshap codes, you just "new" one instance.

If you create a image use codes only, you need there lines at least:
Image img = new Image();
BitmapFrame bmp = BitmapFrame.Create(new Uri(@"C:\myImage.jpg", UriKind.RelativeOrAbsolute));
img.Source = bmp;
img.Stretch = Stretch.Fill;

But, use expression blend, you can create a new user control just by several mouse click. Then in codes, just one line:
new MyImage();