all groups > vb.net upgrade > november 2006 >
You're in the

vb.net upgrade

group:

VarPtr function is not supported


VarPtr function is not supported Jorge NO[at]SPAM aol.com
11/29/2006 12:00:00 AM
vb.net upgrade: Can anyone tell me how to deal with this
Re: VarPtr function is not supported Herfried K. Wagner [MVP]
11/29/2006 2:33:53 PM
<Jorge@aol.com> schrieb:
[quoted text, click to view]

Describe the scenario where you are using this function in more detail.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
Re: VarPtr function is not supported Jorge NO[at]SPAM aol.com
11/30/2006 8:49:22 PM
I am attempting to rewrite someone elses code from VB6 dealing with
creating a floating application bar tool bar since I cannot find a
vb.net equivalent.

Some of the code I am ashamed to admit I do not fully understand so i
am trying to figure it out. here is just one example

' Called when the AppBar receives a WM_MOVING message
Friend Function OnMoving(ByVal lparam As Long) As Long
Dim rc As RECT
Dim pt As POINTS
Dim abEdgeProposed As TAppBarEdge
Dim w As Long
Dim h As Long
' We control the moving of the AppBar. For example, if the mouse
moves
' close to an edge, we want to dock the AppBar
' The lParam contains the window's position proposed by the system



CopyMemory VarPtr(rc), lparam, Len(rc)



' Get the location of the mouse cursor
pt = GetMessagePosition
' Where should the AppBar be based on the mouse position?
abEdgeProposed = CalcProposedState(pt)
If (FabEdgeProposedPrev <> abeFloat) And (abEdgeProposed =
abeFloat) Then
' While moving, the user took us from a docked/autohidden
state to
' the float state. We have to calculate a rectangle location
so that
' the mouse cursor stays inside the window.
rc = FABS.rcFloat
w = rc.Right - rc.Left
h = rc.Bottom - rc.Top
With rc
.Left = pt.X - w \ 2
.Top = pt.Y
.Right = pt.X - w \ 2 + w
.Bottom = pt.Y + h
End With
End If
' Remember the most-recently proposed state
FabEdgeProposedPrev = abEdgeProposed
' Tell the system where to move the window based on the proposed
state
GetRect abEdgeProposed, rc
' Tell our derived class that there is a proposed state change
OnAppBarStateChange True, abEdgeProposed
' Tell the system the new rectangle
CopyMemory lparam, VarPtr(rc), Len(rc)
' Trap default processing
OnMoving = 0
End Function






On Wed, 29 Nov 2006 14:33:53 +0100, "Herfried K. Wagner [MVP]"
[quoted text, click to view]
Re: VarPtr function is not supported Herfried K. Wagner [MVP]
12/1/2006 12:49:21 PM
<Jorge@aol.com> schrieb:
[quoted text, click to view]

=> 'System.Runtime.InteropServices.Marshal.PtrToStructure'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
AddThis Social Bookmark Button