P/Invoking C++ callback functions crashes when .NET application is not in focus
A C++ DLL exports one function having its only parameter as a pointer to another function: #define AFX_EXT_CLASS __declspec(dllexport)typedef void
Read moreA C++ DLL exports one function having its only parameter as a pointer to another function: #define AFX_EXT_CLASS __declspec(dllexport)typedef void
Read moreForm.Show() is an asynchronous call. Subsequent section of codes will run while the form is being loaded. Form.ShowDialog() is a
Read more1. Install the Visual Studio 2008 QFE. Note this functionality is not available on the Express versions of the Visual
Read more‘Email address: Regex.IsMatch(Me.txtEmail.Text, “w+([-+.’]w+)*@w+([-.]w+)*.w+([-.]w+)*”) ‘Alpha-numeric (no space): Regex.IsMatch(Me.txtUsername.Text, “^[0-9a-zA-Z]+$”) ‘Alpha-numeric with space, at least 5 chars:Regex.IsMatch(Me.txtUsername.Text, “[0-9a-zA-Z’ ‘]{5,} )
Read moreIf the user clicks ‘Yes’, the following will close the messagebox first before doing any other thing. Private Sub TestMsgBox()
Read moreThe following code apply ES_NUMBER to allow only digits to be typed into the edit control. Public Const GWL_STYLE As
Read moreThe following code will run flawlessly but at the end, Obj will still contain the assigned properties (.prop1 = 0
Read moreTemporary folders are useful to store simple logs during execution of the program. It is also used for storing the
Read moreDepending on system preferences (in Control Panel/Sounds), the .NET WebBrowser control (just like Internet Explorer) may produce a click sound
Read moreFor some reason, the generic Dictionary in .NET 2.0 is not XML serializable. The following code snippet is a XML
Read moreOnly applicable to .Net desktop application. For .NET compact framework application, use SHCreateShortcut and creates a shortcut in WindowsStartup folder.
Read moreEver wondered how to create a button which toggles it’s state in C# windows Forms? It used to exist in
Read moreEarly-binding: Variable types are defined at compile time (e.g. string, integers): String st = “hello world”;Boolean ok = st.Contains(“hello”); The
Read moreIf an HTTPWebRequest is made via a secure connection (HTTPS) and the certificate is not trusted, a WebException with Exception.Status
Read moreDeclarations: ‘Type of each element in the ArrayListPublic Structure ArrayListEntry…End Structure ‘ArrayList containing elements of above typePublic myArrayList As New
Read more