There was a windows form application based on .NET 4.0 and Visual Studio 2010, it was working well on a PC which we developed it. when we move its debug folder which including generated executable files, it crashed (We use Windows 7): We expanded “Show problem details” button and saw the following information: Description: Stopped [Read More ...]
Actually, there is no big different if you want to programmatically click a button in either WPF or Windows Form. They might have slightly different approach. Click: Button1.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); Press: typeof(Button).GetMethod("set_IsPressed", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(Button1, new object[] { true }); Unpress: typeof(Button).GetMethod("set_IsPressed", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(Button1, new object[] { false }); Other solution is just ButtonAutomationPeer: Please [Read More ...]
About Big endian and Little endian explanation, please read the following content from Microsoft: When designing computers, there are two different architectures for handling memory storage. They are called Big Endian and Little Endian and refer to the order in which the bytes are stored in memory. Windows NT was designed around Little Endian architecture [Read More ...]
There is no direct function to convert a string to upper case or lower case in Linux C. Here we collect 2 functions from internet: #include <ctype.h> static char* Str2Upper(char *str) { if(str == NULL) return NULL; char *p = str; while(*str) { *str = toupper(*str); [Read More ...]
There is a C++ project which is migrated from old VC++ 6.0, We use Visual Studio 2010 now. We have the following small piece of C++ header code in a .h file: #include "Accessor.h" #include "SvMemDB.H" #include "cnserver.h" #include <fstream.h> When we compile the project, we first got the following compile error: error C1083: Cannot [Read More ...]
We have a C++ project based on Linux system, so we need a good Editor but not Visual Studio since the C++ is for Linux. And, we do not want to use Ubuntu but just use Windows 7. So we decide to download Eclipse for C/C++ Windows Edition from Eclipse official site. (Note: our Windows [Read More ...]
Our program got an error in some case, and the windows 7 pops up the following window: xxxx has stopped working windows can check online for a solution to the problem. Check online for a solution and close the program Close the program Debug the program When we expand the problem details, we see a [Read More ...]
If you are using Windows 7 or Windows Vista, or Windows Server 2008, you should know the UAC (User Account Control), this is one of significant differences between Windows XP and the newer Windows System. “User Account Control (UAC) determines the privileges of a user. If you are a member of the Built-in Administrators group, [Read More ...]
How to convert seconds number to a string using format “hh:mm: ss”? Method1: int totalTimeLength = 50; string timeString = Convert.ToString(TimeSpan.FromSeconds(totalTimeLength)); Method2: int intHours = (int) (totalTimeLength / 3600); int intMinutes = (int) (totalTimeLength / 60) % 60; int intSeconds = (int)totalTimeLength % 60; string timeString = intHours .ToString() + ":" + intMinutes .ToString() + [Read More ...]