|
-
WordBreakProc
Hi Dan,
I have a problem with the WordBreakProc. I'm trying to create my own word
wrapping routine but when the controls calls the call back function
my program crash.
Any suggestions ?
thanks
----------------------------------------------------------
'Form1.frm
Private Sub Form_Load()
SendMessage Text1.hwnd, EM_SETWORDBREAKPROC, 0, AddressOf
EditWordBreakProc
End Sub
'Module1.bas
Public Function EditWordBreakProc(ByVal lpch As Long, _
ByVal ichCurrent As Long, ByVal cch As Long, _
ByVal code As Long) As Long
Debug.Print "From Callback EditWordBreakProc"
On Error GoTo hdlr
Select Case code
Case WB_ISDELIMITER
EditWordBreakProc = 1
Case WB_LEFT
EditWordBreakProc = 0
Case WB_RIGHT
EditWordBreakProc = 0
End Select
Debug.Print EditWordBreakProc
Exit Function
hdlr:
Debug.Print Error
End Function
-
Re: WordBreakProc
"Jacques Levy" <jlevy3@tampabay.rr.com> wrote:
>Hi Dan,
>
>I have a problem with the WordBreakProc. I'm trying to create my own word
>wrapping routine but when the controls calls the call back function
>my program crash.
>
>Any suggestions ?
>
>thanks
>
>----------------------------------------------------------
>'Form1.frm
>Private Sub Form_Load()
> SendMessage Text1.hwnd, EM_SETWORDBREAKPROC, 0, AddressOf
>EditWordBreakProc
>End Sub
>
>'Module1.bas
>Public Function EditWordBreakProc(ByVal lpch As Long, _
> ByVal ichCurrent As Long, ByVal cch As Long, _
> ByVal code As Long) As Long
>
> Debug.Print "From Callback EditWordBreakProc"
> On Error GoTo hdlr
>
>
> Select Case code
> Case WB_ISDELIMITER
> EditWordBreakProc = 1
> Case WB_LEFT
> EditWordBreakProc = 0
> Case WB_RIGHT
> EditWordBreakProc = 0
> End Select
> Debug.Print EditWordBreakProc
>
> Exit Function
>
>hdlr:
>
> Debug.Print Error
>End Function
>
>
Best guess - you don't have a ByVal on the lParam parameter of you SendMessage
declaration.
You might want to check out my book "Dan Appleman's Win32 API Puzzle Book
and Tutorial for
Visual Basic Programmers". It's designed to help programmers learn to handle
this type of problem.
Dan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks