In a VB application, I want to add all symbol TrueType font facename to a combobox in a form. I use EnumFontFamiliesEx API function and
EnumFontFamExProc callback function to implement it. My code is like:
In form:

Dim udtLogFont as LOGFONT
udtLogFont.lfCharSet = SYMBOL_CHARSET
udtLogFont.lfPitchAndFamily = 0
EnumFontFamiliesEx me.hdc, udtLogFont, AddressOf EnumFontFamExProc, ObjPtr(cboFont), 0




In module:

public Function EnumFontFamExProc(udtElfe as ENUMLOGFONTEX, udtNtme as NEWTEXTMETRICEX, byval nFontType as Integer, lParam as ComboBox) as
Integer
Dim sFaceName as string, sFontName as string

on error resume next

If nFontType = TRUETYPE_FONTTYPE then
sFaceName = StrConv(udtElfe.elfLogFont.lfFaceName, vbUnicode)
sFontName = Left(sFaceName, InStr(sFaceName, vbNullChar) - 1)
'Now how I can get the combobox object from lParam?
'..................
End If
EnumFontFamExProc = 1
End Function




In EnumFontFamExProc, lParam just is ObjPtr(cboFont). How I can call AddItem method of cboFont Object? In other words, How I can get the
combobox object from lParam? I read the article "Not reference counting" in MSDN, it has some code to get object by CopyMemory, I do so but illegal operation is caused. Any help or suggestions is appreciated.