sFontName should not be a string but an array of integers (0 to 31). Then you would use "lstrcpy" to write the Font Name:
Then try passing VarPtr(sFaceName(0)) to cDWFactory.CreateTextFormat and see how it goes.Code:Private Declare Function lstrcpy Lib "kernel32" Alias "lstrcpyW" (ByVal pszDst As Long, ByVal pszSrc As String) As Long Dim sFontName(0 to 31) as Integer lstrcpy VarPtr(sFaceName(0)), "Arial"




Reply With Quote