Click here to Skip to main content
15,909,440 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Webcam Capture and print A5 Paper, Codes (Two Cameras) Pin
Eddy Vluggen2-Jul-13 0:32
professionalEddy Vluggen2-Jul-13 0:32 
Questionvb6 to vb.net Pin
Smith00530-Jun-13 19:13
Smith00530-Jun-13 19:13 
AnswerRe: vb6 to vb.net Pin
Dave Kreskowiak1-Jul-13 2:21
mveDave Kreskowiak1-Jul-13 2:21 
QuestionHow to get address of a function or method Pin
treddie30-Jun-13 11:05
treddie30-Jun-13 11:05 
AnswerRe: How to get address of a function or method Pin
TnTinMn30-Jun-13 16:46
TnTinMn30-Jun-13 16:46 
GeneralRe: How to get address of a function or method Pin
treddie1-Jul-13 12:17
treddie1-Jul-13 12:17 
GeneralRe: How to get address of a function or method Pin
TnTinMn1-Jul-13 14:28
TnTinMn1-Jul-13 14:28 
GeneralRe: How to get address of a function or method Pin
treddie1-Jul-13 20:43
treddie1-Jul-13 20:43 
Gawd I'm so stupid sometimes. I was driving home from the store today, and realized I hadn't started the listening process during form load. My version works now...You're version worked perfectly from the get-go.

But furthermore, to get mine to work, I had to change the function declarations to the "other" style.

From:
VB
Private Declare Function SetWindowLong Lib "user32" (ByVal hWnd As IntPtr, _
                                                     ByVal nIndex As Integer, _
                                                     ByVal newProc As Win32WndProc) As IntPtr

Private Declare Function CallWindowProc Lib "user32" (ByVal lpPrevWndFunc As IntPtr, _
                                                      ByVal hWnd As IntPtr, _
                                                      ByVal Msg As Integer, _
                                                      ByVal wParam As Integer, _
                                                      ByVal lParam As Integer) As Integer

To:
VB
<DllImport("user32")> _
Private Shared Function SetWindowLong(ByVal hWnd As IntPtr, _
                                      ByVal nIndex As Integer,
                                      ByVal newProc As Win32WndProc) As IntPtr
End Function

<DllImport("user32")> _
Private Shared Function CallWindowProc(ByVal lpPrevWndFunc As IntPtr, _
                                       ByVal hWnd As IntPtr, _
                                       ByVal Msg As Integer, _
                                       ByVal wParam As Integer, _
                                       ByVal lParam As Integer) As Integer
End Function


Why is one different than the other? I notice that the first is not shared and the second one is.
But I have never encountered any problems before using the first syntax.

modified 2-Jul-13 3:01am.

GeneralRe: How to get address of a function or method Pin
TnTinMn2-Jul-13 7:32
TnTinMn2-Jul-13 7:32 
GeneralRe: How to get address of a function or method Pin
treddie2-Jul-13 9:35
treddie2-Jul-13 9:35 
AnswerRe: How to get address of a function or method Pin
Bernhard Hiller1-Jul-13 0:57
Bernhard Hiller1-Jul-13 0:57 
GeneralRe: How to get address of a function or method Pin
treddie1-Jul-13 12:18
treddie1-Jul-13 12:18 
GeneralRe: How to get address of a function or method Pin
treddie1-Jul-13 20:30
treddie1-Jul-13 20:30 
AnswerRe: How to get address of a function or method Pin
Richard Deeming1-Jul-13 1:54
mveRichard Deeming1-Jul-13 1:54 
GeneralRe: How to get address of a function or method Pin
treddie1-Jul-13 12:20
treddie1-Jul-13 12:20 
GeneralRe: How to get address of a function or method Pin
treddie1-Jul-13 19:29
treddie1-Jul-13 19:29 
GeneralRe: How to get address of a function or method Pin
Richard Deeming2-Jul-13 1:25
mveRichard Deeming2-Jul-13 1:25 
GeneralRe: How to get address of a function or method Pin
treddie2-Jul-13 9:41
treddie2-Jul-13 9:41 
QuestionHow to express this in a Regex? Pin
Sonhospa28-Jun-13 0:50
Sonhospa28-Jun-13 0:50 
AnswerRe: How to express this in a Regex? Pin
thanh_bkhn28-Jun-13 2:50
professionalthanh_bkhn28-Jun-13 2:50 
News[RESOLVED] Re: How to express this in a Regex? Pin
Sonhospa28-Jun-13 2:59
Sonhospa28-Jun-13 2:59 
QuestionMS at it again Pin
treddie26-Jun-13 19:57
treddie26-Jun-13 19:57 
AnswerRe: MS at it again Pin
Eddy Vluggen27-Jun-13 0:23
professionalEddy Vluggen27-Jun-13 0:23 
GeneralRe: MS at it again Pin
treddie28-Jun-13 11:20
treddie28-Jun-13 11:20 
GeneralRe: MS at it again Pin
Eddy Vluggen3-Jul-13 6:56
professionalEddy Vluggen3-Jul-13 6:56 

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.