The Difference Between Pointers and Arrays
Some programmers believe that int a[] and int * a are equivalent.Also some C++ books to say that pointers and arrays are almost same. This belief usually leads to hard
Some programmers believe that int a[] and int * a are equivalent.Also some C++ books to say that pointers and arrays are almost same. This belief usually leads to hard
For example the following code is incorrect: const char *foo(){ char buf[1024]; strcpy(buf, Related Posts Alphabet Quarterly Report Shows Strong Growth for Google CloudUse BitConverter Class to Convert a Byte
If you have coded a template class and use it from VC++, you will get a LNK2001 error message on template member functions. This is because Microsoft deviates a bit
To convert character strings into its integer component: #include int ConvertString(char * str){ int result = 0; for (int index = 0; index
The need to find the Icm is pretty common in C++ programming. This is just a basic code for finding the lcm of two integers: int lcm(int large, int small){
Quite often, we find ourselves using variables to hold one of a set of possible values. For instance, let’s say you have a number of views on a grid. You’ll
This tip is extremely useful in the IDE for debugging. Before the Do loop you want to make safe, you set the var ‘loopnum’ as 0. Then, place these two
Debugging ActiveX EXE components is different from debugging ActiveX DLL components, and a bit more difficult. Here is how to do it: 1. Run your ActiveX EXE component in the
Sometimes we may need to register/unregister a DLL or OCX programatically. This piece of code can do that. Private Declare Function RegisterDLLOCX Lib _ Related Posts How to Migrate From Microsoft
The following code is an efficient, flexible, system-setting-independent procedure. MonthNames is either a listbox or a combobox. If StartMonth is greater than EndMonth, the list of month names will be
Here is a sipel function for stripping double characters from a string: Public Function StripDoubleChar(ByVal Text As String, Char As String) As StringDim Pos As LongDim Start As IntegerDim sTemp
This control allows you to place several toolbars on very little space, bycreating several tabs and showing one toolbar for each tab. The user canswitch beetwen the tabs and the
‘ Get the name of the DLL or EXE that contains’ the class whose CLSID is passed as an argument” Note: Remote servers aren’t taken into accountFunction GetFileFromCLSID(ByVal clsid As
‘ Get the name of the DLL or EXE that contains’ the class whose ProgID is passed as an argument” Remote servers aren’t taken into account” NOTE: Requires GetRegistryValueFunction GetFileFromProgID(ByVal
Private Declare Function GetSaveFileName Lib “comdlg32.dll” Alias _ “GetSaveFileNameA” (pOpenfilename As OpenFilename) As LongPrivate Type OpenFilename lStructSize As Long hwndOwner As Long hInstance As Long lpstrFilter As String lpstrCustomFilter As
‘check whether the specified file is an executable,’ by checking the last 4 characters.’Example: MsgBox “File is exe: ” & IsExecFile(“C:windows otepad.exe”)Function IsExecFile(ByVal sFileName As String) As Boolean Dim sExt
Private Declare Function GetOpenFileName Lib “comdlg32.dll” Alias _ “GetOpenFileNameA” (pOpenfilename As OpenFilename) As LongPrivate Type OpenFilename lStructSize As Long hwndOwner As Long hInstance As Long lpstrFilter As String lpstrCustomFilter As
Private Declare Function FindFirstFile Lib “kernel32” Alias “FindFirstFileA” _ (ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As LongPrivate Declare Function FindNextFile Lib “kernel32” Alias “FindNextFileA” _ (ByVal hFindFile As Long,
Thanks to the undocumented TlbInf32 library you can emulate the VB6 CallByName() function in VB5 too. First, add a reference to the “TypeLib Information” type library in your project. This
ADODataNav is an activex data navigational control disigned in and for Visual Basic that you can connect to an ADO MSData control giving you two usefull toolbars for navigation and
‘ build a list of all the individual words in a string” returns a collection that contains all the unique words.’ The key for each item is the word itself’
‘ evaluate the area of a triangle’ given its three sidesFunction TriangleArea(side1 As Double, side2 As Double, _ side3 As Double) As Double ‘ this function uses the Heron formula
‘ Returns an array with the first N prime numbers” Note: you can easily convert this routine to VB4 and VB5 by’ returning the result array through an argument instead
‘ Return True if a character belongs to a given catagory” CHARTYPE can be the sum of one or more of the following values’ 1 = Uppercase alpha char [A-Z]’
‘ convert from Celsius to Fahrenheit degreesFunction CelsiusToFahrenheit(ByVal value As Single) As Single CelsiusToFahrenheit = value * 1.8 + 32End Function’ convert from Fahrenheit to Celsius degreesFunction FahrenheitToCelsius(ByVal value As
Introduction As you have probably heard thousands oftimes, XML is a core technology in .NET. XML is a cornerstone of web services and ADO.NET recordsets (now calleddatasets) are internally stored
Private Declare Function LoadIconByID Lib “user32” Alias “LoadIconA” (ByVal _ hInstance As Long, ByVal lpIconName As Long) As LongPrivate Declare Function DrawIcon Lib “user32” (ByVal hDC As Long, _ ByVal
Type BITMAP bmType As Long bmWidth As Long bmHeight As Long bmWidthBytes As Long bmPlanes As Integer bmBitsPixel As Integer bmBits As LongEnd TypePrivate Declare Function GetObjectAPI Lib “gdi32” Alias
Private Type PICTDESC cbSize As Long pictType As Long hIcon As Long hPal As LongEnd Type Private Declare Function OleCreatePictureIndirect Lib “olepro32.dll” _ (lpPictDesc As PICTDESC, riid As Any, ByVal
‘ Move and resize a ProgressBar control so that it fits inside’ a StatusBar’s Panel.” The last argument is the panel index (one-based).Sub MoveProgressBarIntoPanel(pb As ProgressBar, sb As StatusBar, _