|
Hello,
I am writing an small setup program and I need to install some fonts. I had look in MSDN and in many other places, but I can’t find the solution. AddFontResource works but only on the current session after a reboot the font is gone. I also tried CreateScalableFontResource with AddFontResource but I can’t get it to work. I copy the ttf font file to the windows fonts folder and it does not work. Here is a sample function:
void InstallFont(CString sFontFileName, CString sFontLocation){<br />
<br />
CString sFontResource(GetWindowsFolder() + sFontFileName + ".fot");<br />
CString sWinFonts(GetWindowsFolder() + "Fonts\\" + sFontFileName + ".ttf");<br />
<br />
::CopyFile(sFontLocation + sFontFileName + ".ttf", sWinFonts, TRUE);<br />
<br />
CreateScalableFontResource(0, sFontResource, sWinFonts, NULL);<br />
AddFontResource( sFontFileName + ".fot" );<br />
}
If you have any ideas please help. An example will be perfect. Thanks.
|
|
|
|
|
Is the problem something to do with the windows security?
|
|
|
|
|
We have had the same problem. Just copying the .ttf into the fonts directory is not enough. You also need to add some registry keys settings to get teh font to work correctly. Try copying in the font, use word etc to use it, which sometimes gets the font working initially. Then search the registry for the fonts filename, and hopefully that will return the reg keys you need to add, to get the font registering correctly when you first add the font.
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
How can i detect USB isdn modem with VC++ and how can i get 2 isdn phone lines through it?
I can't manage to detect it through SetupDiGetDev if i set INTERFACE flag with modem GUID. I wonder if i'm doing something wrong. Can someone give a example to me?
Thanx in advance for answer!
|
|
|
|
|
I ran into some serious bugs in the adobe reader 6.0 activex control. (pdf.ocx has problems when trying to load .xfdf file) I've been at Adobes forums and posted about this topic. People say that the control has zero support. What is a good pdf viewer control that has support for .xfdf ?
(auto merge with linked pdf and no need to save the result. Just needs to have basic viewing features and has to be able to print)
|
|
|
|
|
My boss wants to be able to change Files of Type pulldown dynamically inside
a CFildDialog callback. For example, we would start with a list of 5 file
types and the last file type is "More...". If the user clicks on "More..."
then the Files of Type combo is to be repopulated with 25 file types, for
example. Then the last entry is "Less..." and so the user can reduce back
to 5 file types.
Has anyone seen this done in a commercial product or a demo? I'm no
stranger to explorer style hookprocs, written them in (and out of) MFC.
I can capture the child control notification, I clear the combobox,
repopulate with a new list. However, the next time the user comes along
and picks a type, I get a null pointer in COMMDLG32.DLL.
Should I give up or is there hope?
|
|
|
|
|
Ok, I read about CImage on MSDN, and I have to include atlimage.h in StdAfx.h
I did it, but it says there is no such file. Where can I download it and where must I store the file (which directory)?
Thanks,
~Michael
|
|
|
|
|
|
hi friends,
i m facing one problem while using services.
the problem is..........
The service behaves well initially when i start manually through service interface(service is not autostart, one has to start manually). As soon as i LOG OFF from the system & again LOG IN to the system i found that service stops however when i check the service interface it shows that service is running and even TASK MANAGER displays the EXE of SERVICE as running status.
i hope u understand my problem.
waiting for reply.
|
|
|
|
|
I hope you registered ur service by /Service
Toughest Steel Comes From Hottest Furnance
|
|
|
|
|
hi thnks for reply , but can u elaborate more how to register service using /Service
|
|
|
|
|
I assume that urs in an ATL Exe Service, so you register it
by servicename /Service
by doing so it wont stop ther service even if you log out.
Toughest Steel Comes From Hottest Furnance
|
|
|
|
|
Anybody knows how to use the TrackMouseEvent function???
I need a some sample code. I geting .
|
|
|
|
|
I'll try it but I didn't use it for a long time. I used the TrackMouseEvent() for an owner drawn caption where I needed to track whether the mouse has left the caption.
Header:
bool m_bMouseTracking
Constructor:
m_bMouseTracking = false;
void OnMouseMove(UINT nFlags, CPoint point):
if( !m_bMouseTracking )
{
TRACKMOUSEEVENT tme;
tme.cbSize = sizeof(tme);
tme.hwndTrack = m_hWnd;
tme.dwFlags = TME_LEAVE | TME_HOVER;
tme.dwHoverTime = 1;
m_bMouseTracking = _TrackMouseEvent(&tme);
}
void OnMouseLeave(WPARAM wparam, LPARAM lparam):
...
m_bMouseTracking = false;
But I think you can use TrackMouseEvent() only with Windows98 and newer. If you want to be compatible to older OS's too, you should look for SetCapture() and ReleaseCapture(). Then you can check on which OS your app is running and switch to the appropriate tracking mechanism...
CU... mYkel
|
|
|
|
|
Hi,
when I include the boost library into my project, I get min and max as "ambiguous symbols".
it is enough to include boost/config.hpp
Now my project is fairly big (and I already removed two "using namespace std" instances in a header file), yet the error persists, and I have no idea how to track it down.
Any ideas?
Flirt harder, I'm a coder.
mlog || Agile Programming | doxygen
|
|
|
|
|
Have you tried defining the macro NOMINMAX in your project settings? This effectively removes Windows min and max macros.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Ok, so say I hava an MS word doc set up like:
blablabla...
Some Header
Some table
Col 1 | Col 2
--------------------------
data1 | Some text
data2 | Some text
data3 | Some text
blablabla...
And I want to extract the header and table data via C++... (7.1)
Where does one start? Any references, ideas, article suggestions.....
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
Start by reading about Word's automation Object model.
You can, I recall, access the document's collection of tables.
Having done this, you should be able to refer to properties of the table to extract text from it.
If you know VB it's helpful
[Hey, you at the back! Stop throwing that stuff at me... ]
Steve S
|
|
|
|
|
i get the handle to a textbox in any opened window on my desktop using Enumhcildwindows function <under hooking="" system=""> and i want to set a text in this textbox automatically.i need a function to do this task..
thank you
E-Email: app_prog@yahoo.com
Hawk,amr
|
|
|
|
|
VERIFY (::SetWindowText (hWnd, _T("foo")));
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi,
I have an output file (text file). In the text file there are a few locations of other text files, along with the name and path of each file.
it seems like if the location is anywhere other than the desktop the file can not be found.
How can I read the location of a file from another text file and open it?
Thank
Ehsan Behboudi
|
|
|
|
|
How can you handle the case where you want to put a Max limit on the size that you can make a MFC dialog based application window.
I store the main dialog windows size in the InitDialog routine, but how do you limit the resizing?
I placed code in the OnSize, but it did not work.
|
|
|
|
|
WM_GETMINMAXINFO message.
Process this and return the minimum and maximum sizes the user can change for the window
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
BEGIN_MESSAGE_MAP(CMyDlg, CDialog)
//{{AFX_MSG_MAP(CMyDlg)
...
ON_WM_SIZING()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void CMyDlg::OnSizing(UINT fwSide, LPRECT pRect)
{
if (pRect->right - pRect->left > 400)
pRect->right = pRect->left + 400;
CDialog::OnSizing(fwSide, pRect);
// TODO:
}
|
|
|
|
|