Click here to Skip to main content
15,898,036 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionxml to database conversion Pin
KarthikMano28-Oct-07 22:19
KarthikMano28-Oct-07 22:19 
AnswerRe: xml to database conversion Pin
Dave Kreskowiak29-Oct-07 5:04
mveDave Kreskowiak29-Oct-07 5:04 
GeneralRe: xml to database conversion Pin
KarthikMano31-Oct-07 19:16
KarthikMano31-Oct-07 19:16 
QuestionHow to pass a structure contains an array in any size ? Pin
Ky Nam28-Oct-07 21:46
Ky Nam28-Oct-07 21:46 
AnswerRe: How to pass a structure contains an array in any size ? Pin
Dave Kreskowiak29-Oct-07 5:00
mveDave Kreskowiak29-Oct-07 5:00 
GeneralRe: How to pass a structure contains an array in any size ? Pin
Ky Nam29-Oct-07 5:23
Ky Nam29-Oct-07 5:23 
GeneralRe: How to pass a structure contains an array in any size ? Pin
Dave Kreskowiak29-Oct-07 7:51
mveDave Kreskowiak29-Oct-07 7:51 
GeneralRe: How to pass a structure contains an array in any size ? Pin
Ky Nam29-Oct-07 19:04
Ky Nam29-Oct-07 19:04 
It just works Smile | :)

Public Declare Function AdjustTokenPrivileges Lib "advapi32.dll" (ByVal tokenhandle As IntPtr, ByVal disableprivs As Boolean, ByVal Newstate As IntPtr, ByVal bufferlength As Integer, ByVal PreivousState As TokenPrivileges, ByRef Returnlength As Integer) As Boolean

 Public Class TokenPrivileges
     Inherits List(Of LUIDAndAttributes)
     Implements IDisposable

     Dim P As IntPtr

     Public Function AllocHGlobal() As IntPtr
         FreeHGlobal()

         P = Marshal.AllocHGlobal(Marshal.SizeOf(GetType(Integer)) + Marshal.SizeOf(GetType(LUIDAndAttributes)) * Count)
         Dim P2 As IntPtr = P

         Marshal.WriteInt32(P2, 0, Count)
         P2 = Sum(P2, Marshal.SizeOf(Count.GetType))

         For Each LUIDAndAttributes As LUIDAndAttributes In Me
             Marshal.StructureToPtr(LUIDAndAttributes, P2, False)
             P2 = Sum(P2, Marshal.SizeOf(LUIDAndAttributes.GetType))
         Next

         Return P
     End Function

     Public Sub FreeHGlobal()
         If P <> IntPtr.Zero Then
             Marshal.FreeHGlobal(P)
             P = IntPtr.Zero
         End If
     End Sub

 End Class

 Public Shared Function Sum(ByVal P As IntPtr, ByVal I As Integer) As IntPtr
     If IntPtr.Size = 4 Then
         Return New IntPtr(P.ToInt32 + I)
     Else
         Return New IntPtr(P.ToInt64 + I)
     End If
 End Function

GeneralRe: How to pass a structure contains an array in any size ? Pin
Dave Kreskowiak30-Oct-07 2:25
mveDave Kreskowiak30-Oct-07 2:25 
QuestionMoving buttons Pin
matjame28-Oct-07 20:51
matjame28-Oct-07 20:51 
AnswerRe: Moving buttons Pin
Tom Deketelaere28-Oct-07 21:41
professionalTom Deketelaere28-Oct-07 21:41 
GeneralRe: Moving buttons Pin
matjame28-Oct-07 21:43
matjame28-Oct-07 21:43 
GeneralRe: Moving buttons Pin
Christian Graus29-Oct-07 0:14
protectorChristian Graus29-Oct-07 0:14 
GeneralRe: Moving buttons Pin
Paul Conrad29-Oct-07 17:17
professionalPaul Conrad29-Oct-07 17:17 
QuestionNavigation of Internet connection Pin
ankur010128-Oct-07 19:39
ankur010128-Oct-07 19:39 
AnswerRe: Navigation of Internet connection Pin
Dave Kreskowiak29-Oct-07 4:37
mveDave Kreskowiak29-Oct-07 4:37 
Questionimage editor Pin
Aamir Mustafa28-Oct-07 18:16
Aamir Mustafa28-Oct-07 18:16 
AnswerRe: image editor Pin
Dave Kreskowiak29-Oct-07 4:33
mveDave Kreskowiak29-Oct-07 4:33 
QuestionHow to Create a Reverse Index by VB.NET? Pin
Asianhawk28-Oct-07 16:18
Asianhawk28-Oct-07 16:18 
AnswerRe: How to Create a Reverse Index by VB.NET? Pin
Dave Kreskowiak28-Oct-07 16:52
mveDave Kreskowiak28-Oct-07 16:52 
QuestionDatagrid Column Width Pin
ejaz_pk28-Oct-07 15:44
ejaz_pk28-Oct-07 15:44 
AnswerRe: Datagrid Column Width Pin
Dave Kreskowiak28-Oct-07 16:41
mveDave Kreskowiak28-Oct-07 16:41 
AnswerRe: Datagrid Column Width Pin
Salman Sheikh28-Oct-07 18:35
Salman Sheikh28-Oct-07 18:35 
QuestionTutorial beginner on Web Services using VB.NET 2003 Pin
kendo1728-Oct-07 13:49
kendo1728-Oct-07 13:49 
AnswerRe: Tutorial beginner on Web Services using VB.NET 2003 Pin
Paul Conrad28-Oct-07 14:17
professionalPaul Conrad28-Oct-07 14:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.