Good point. I shouldn't speak for Andrew, but like me, he was probably taking the definition from the Windows version of the function, not the Windows Mobile one.
--- In [email protected], "George Henne" <g...@...> wrote: > > I haven't tried this myself, but isn't the correct library coredll.lib, > at least according to this? > <http://msdn.microsoft.com/en-us/library/aa911432.aspx> > > > >I'm struggling to get started with this. I keep getting the error > >"Variable is undefined" with my test code, no matter what variations I > >try. Am I making a glaringly obvious error? > > > >I'm declaring the function as follows: > > > >Declare "Function GetTextExtentPoint32 Lib ""gdi32"" (ByVal hDC As Long, > >ByVal lpsz As String, ByVal cbString As Long, byVal lpSize() As Long) > As Long" > > > >The error occurs on the following line: > > > >If GetTextExtentPoint32(hdc, "Hello", Len("Hello"), thisTextSize) <> 0 Then > > > >The context is: > > > >Dim thisTextSize(1) > >Dim thisSize > >Dim hdc > > > >hdc = GetDC(lblSomeText.hwnd) > > > >'--->Error occurs on following line: > >If GetTextExtentPoint32(hdc, "Hello", Len("Hello"), thisTextSize) <> 0 Then > > > > thisSize = thisTextSize(0) > >Else > > thisSize = 0 > >End If > > > > > > > > > >--- In [email protected], "George Henne" <gh@> wrote: > >> > >> You might be able to do this with a DECLARE function. The underlying API > >> call you have to make is this: > >> > >> <http://msdn.microsoft.com/en-us/library/ms901137.aspx> > >> > >> > >> > >> >Hi > >> > > >> >Does anyone know if it's possible to determine the width of a text > >> >string at a given font size (similar to VB's TextWidth function)? > >> > > >> >Andrew > >> > > >> > > >> > > >> >------------------------------------ > >> > > >> >Yahoo! Groups Links > >> > > >> > > >> > > >> > > > > > > > > > >------------------------------------ > > > >Yahoo! Groups Links > > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nsb-ce" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nsb-ce?hl=en -~----------~----~----~----~------~----~------~--~---
