Click here to Skip to main content
15,913,587 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to link menu and dialog box? Pin
anuchelvi5-Sep-04 19:11
anuchelvi5-Sep-04 19:11 
AnswerRe: How to link menu and dialog box? Pin
Arsalan Malik5-Sep-04 19:58
Arsalan Malik5-Sep-04 19:58 
GeneralRe: How to link menu and dialog box? Pin
anuchelvi5-Sep-04 22:16
anuchelvi5-Sep-04 22:16 
GeneralRe: How to link menu and dialog box? Pin
Arsalan Malik5-Sep-04 22:52
Arsalan Malik5-Sep-04 22:52 
GeneralRe: How to link menu and dialog box? Pin
anuchelvi5-Sep-04 23:47
anuchelvi5-Sep-04 23:47 
GeneralRe: How to link menu and dialog box? Pin
anuchelvi6-Sep-04 0:01
anuchelvi6-Sep-04 0:01 
GeneralRe: Pls hellllllllllpppppppppppppp Pin
anuchelvi6-Sep-04 1:39
anuchelvi6-Sep-04 1:39 
Questionhow to pass parameter? Pin
Member 13169505-Sep-04 19:07
Member 13169505-Sep-04 19:07 
AnswerRe: how to pass parameter? Pin
User 2155975-Sep-04 21:40
User 2155975-Sep-04 21:40 
AnswerRe: how to pass parameter? Pin
Gary R. Wheeler6-Sep-04 3:03
Gary R. Wheeler6-Sep-04 3:03 
QuestionHow to get session of a process ? Pin
n4_t15-Sep-04 17:37
n4_t15-Sep-04 17:37 
AnswerRe: How to get session of a process ? Pin
Blake Miller7-Sep-04 13:51
Blake Miller7-Sep-04 13:51 
GeneralRe: How to get session of a process ? Pin
n4_t114-Sep-04 19:44
n4_t114-Sep-04 19:44 
QuestionMouse Hover? Pin
Timothy Grabrian5-Sep-04 17:33
professionalTimothy Grabrian5-Sep-04 17:33 
AnswerRe: Mouse Hover? Pin
Ryan Binns5-Sep-04 18:16
Ryan Binns5-Sep-04 18:16 
AnswerRe: Mouse Hover? Pin
Michael Dunn5-Sep-04 20:21
sitebuilderMichael Dunn5-Sep-04 20:21 
GeneralFont Embedding Pin
dArK cHAriSmA5-Sep-04 16:40
dArK cHAriSmA5-Sep-04 16:40 
GeneralRe: Font Embedding Pin
Chris Hills11-Sep-04 13:50
Chris Hills11-Sep-04 13:50 
I did this for an MFC application recently. I guess it’ll be similar with Borland.

I created a custom resource, gave it a name, and associated it with the .TTF file. Then when I built the .exe file, I found the byte sequence for the .TTF file inside. So that’s the first step – getting the .TTF file into the .exe file.

The second step is to get the byte sequence at run time. Call ::FindResource(), then ::LoadResource(), then ::LockResource(), then ::SizeofResource().

The third step is to tell Windows to use the byte sequence as a TrueType font. I haven’t found a good way of doing this. I don’t know if there is a good way. The method I use uses two indirections. Having found the byte sequence, write it out to a temporary file, then read in the file using ::AddFontResource(). Then call ::CreateFontIndirect(&lf), having set lf.lfFaceName to the name of your font, and hope that Windows chooses to use your font.

Then call ::FreeResource() (I’m not sure if this is necessary, but some of the MSDN samples do it). And before your program ends, call ::RemoveFontResource(), otherwise your font will probably be in the system for ever more.

HTH,
Chris.
QuestionHow do you Get/Set comments from files? Pin
kusanagi20005-Sep-04 16:31
kusanagi20005-Sep-04 16:31 
AnswerRe: How do you Get/Set comments from files? Pin
Timothy Grabrian5-Sep-04 17:40
professionalTimothy Grabrian5-Sep-04 17:40 
AnswerRe: How do you Get/Set comments from files? Pin
Ryan Binns5-Sep-04 18:19
Ryan Binns5-Sep-04 18:19 
GeneralManipulation of Bitmap Pixels using Win32 APIs Pin
essra5-Sep-04 13:49
essra5-Sep-04 13:49 
GeneralRe: Manipulation of Bitmap Pixels using Win32 APIs Pin
Christian Graus5-Sep-04 15:36
protectorChristian Graus5-Sep-04 15:36 
GeneralRe: Manipulation of Bitmap Pixels using Win32 APIs Pin
essra6-Sep-04 0:49
essra6-Sep-04 0:49 
GeneralRe: Manipulation of Bitmap Pixels using Win32 APIs Pin
Christian Graus6-Sep-04 10:39
protectorChristian Graus6-Sep-04 10:39 

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.