
Sometimes you run into a situtation where you want to delete all the files or a particular type of file (like text files – *.txt) in a folder.Here is a function to do just that: Private Sub DeleteFilesInFolder(ByVal strFolder As String, OptionalstrFileExt As String =
Though each character of BSTR and Unicode strings are 2 characters wide, there is a fundamental difference between the two. BSTR strings have to be length prefixed, which means that the memory locations at the very beginning of the string contain the length of the string. BSTRs also have to
import java.text.*;import java.util.*;public class my_data { private SimpleDateFormat formatter; private Date currentdate; public my_data() { currentdate=new Date(); formatter=new SimpleDateFormat(
Sometimes we may need to restrict users from entering anything besides numbers in a textbox. The following code can achieve this: Option ExplicitPrivate strClipboardText As StringPrivate Sub txtNumberBox_KeyPress(KeyAscii As Integer) If (KeyAscii
Please note that using the join function makes this code VB6 only (for only a small performance gain). dim i as longdim s as stringfor i = 0 to 100000 s = s &
Define a class, say SessionTimeoutIndicator, which implements theinterface javax.servlet.http.HttpSessionBindingListener. Next create a SessionTimeoutIndicator object and add it to the user session. When the session is removed, the SessionTimeoutIndicator.valueUnbound() method will be called by the Servlet engine. You can then implement valueUnbound() to do the required operation.
When writing a COM object using C++, care should be taken to ensure that all C++ exceptions generated by the code are handled within the call itself. If any C++ exception is not handled, the call will fail.For example: CMyComObject::foo(){ HRESULT hr;… throw hr;}