Why still flicker in my animation(GDI+,MFC)?
Many articles talk about using double buffer to eliminate filker, but I found their methodes don’t work.Then I found even I draw one single line in CView::OnDraw method, the window flickers on mouse moving which causes CView::Invalidate(true).
设计开发
关于TListBox自绘状态下的repaint闪烁问题
又是一个flicker prob.但这个控件的闪烁问题和以往遇到的有些不同,一般情况下只要禁止控件重绘背景(WM_ERASEBKGND这个消息)就可以解决。我先用了简单的设置方式(那个直接设置vcl控件属性禁止重绘背景),但发现没有效果,后来又用了窗口子类化,重写了窗口过程拦下了重绘背景的消息,但是实际运行发现也没有效果,最后我用SPY++查看这个控件时发现,一个TListBox实际上是由2部分组成,一个TScrollBox负责控制2边滚动条的显示,还有一个InnerListBox是实际显示item的控件,以前的几种尝试方式都是针对错了对象的,如果将子类化的hwnd用inner的就没问题了,基本解决了重绘整个控件时的闪烁问题,但是还是有一点小bug:由于TListBox自绘时并不会卡准最后一个Item的下边一定和控件的下边位置一致,所以有可能在控件内空出一部分空间,如果禁用了背景重画,则空出的这部分空间的颜色无法控制,而另一种方式通过打开inner的双缓冲也可以解决闪烁的问题,但是还是这部分空出的空间的颜色会有时正常(拖动滚动条移动时)有时不正常(用滚轮移动时),这个问题还有待解决。
cvs server: sticky tag `xxx’ for file ‘xxx’ is not a branch…
貌似是cvs的一个经典问题,今天在修改的时候取了一个历史版本,好像就自动给加上了个版本号的tag,然后在commit的时候就出现了这个问题,提示修正后才能commit。
google一下果然是经典问题,很快找到了答案:对出这个错的文件执行update -A后清掉当前的tag就可以了。
[ZT]如何把string解析为int?
Q:如何把string解析为int?
A:简单的方法有三种:
string source = “1412”;
int result = 0;
// 使用Convert.ToInt32(string value);
result = Convert.ToInt32(source);
// 使用Int32.Parse(string value);
result = Int32.Parse(source);
// 使用Int32.TryParse(string s, out int result);
Int32.TryParse(source, out result);
[ZT]All PSP Error Codes
First 4 digits indicate the functional area that reported an error : 8002 is the kernel, 8001 is the standard libc (and the error numbers correspond to the POSIX errno.h constants). Others are less well known, but you can see the wifi range from your list, for instance.
[ZT]PSP program formats
The PSP uses ELF (Executable and Linking Format) as the executable format. These are packaged into a EBOOT.PBP along with other files for easy distribution and loading. When loaded, the MIPS cpu can run the code in kernel or user mode. Most of the XMB and drivers for the hardware boot in kernel mode. Most of the kernel code and device drivers for the PSP are coded in a relocateable executable format with the extension .prx. This format is a proprietary format made by Sony. Note that .prx format code need not run in kernel mode, but a vast majority of them are because Sony provided them to control the PSP hardware.
如何使MFC的MDI默认不创建空child窗口
[color=#008000]// Parse command line for standard shell commands, DDE, file open[/color]
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
[color=#008000]// 防止开启后自动创建child[/color]
[color=#0000D0]if[/color] (cmdInfo.m_nShellCommand==CCommandLineInfo::FileNew)
{
[color=#0000D0]if[/color] (cmdInfo.m_strFileName==[color=#808080]””[/color])
{
cmdInfo.m_nShellCommand=CCommandLineInfo::FileNothing;
}
}
[color=#008000]// Dispatch commands specified on the command line[/color]
[color=#0000D0]if[/color] (!ProcessShellCommand(cmdInfo))
[color=#0000D0]return[/color] [color=#0000D0]FALSE[/color];
本代码由xTiNt自动着色 http://kbadboy.yeah.net
[ZT]Porting a 1.50 firmware homebrew to 3.xx firmware
3.xx firmwares require your homebrew be in prx format. To get your homebrew in this format, you need to follow a few basic steps: