|
|
Thanks Chris
but see
-Font files must be in the SYSTEM subdirectory of the WINDOWS directory to be used by the AddFontResource function.
-The CreateScalableFontResource function is used to install TrueType fonts
-The EnumFontFamiliesEx function enumerates all fonts in the system that match the font characteristics..
I want to load a Font directly for a *.ttf or *.fon file. This file can be everywhere ( CD..)
Never the less thank you very much for trying to help me
|
|
|
|
|
AskQuestion wrote: -Font files must be in the SYSTEM subdirectory of the WINDOWS directory to be used by the AddFontResource function.
So just copy the .fon or .ttf file(s) to the Fonts folder before calling AddFontResource() .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
|
thx Chris
it took a while to understand, since the help in msn isn't correct. AddFontResource.. really worked.
thx again, you really have been a great help
|
|
|
|
|
i used the winexec function forexecute the.exe file with specified path.
but i want execute the .exe file with specified buffer of byte of .exe file.
is it posible?
please help me.
|
|
|
|
|
samira-samehforooghy wrote: ...with specified buffer of byte of .exe file.
Can you explain what you mean by this?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
samira-samehforooghy wrote: but i want execute the .exe file with specified buffer of byte of .exe file.
you want to have parameters to your executable ? or call a particular function in an executable ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Hello samira!
It isn't possible. because a exe file must be in a path of disk for execution ,
and don't execute a file that there isn't in disk.
good luck.
Zo.Naderi-Iran
|
|
|
|
|
Is it possible to detect memory leaks for a non debug version (customize/release) ?
|
|
|
|
|
what you mean by this? you need to debug the release version ????
Ninety-eight percent of the thrill comes from knowing that the thing you designed works, and works almost the way you expected it would. If that happens, part of you is in that machine.
|
|
|
|
|
What is wrong with my just installed licensed VS NET. 2003, while creating a project it puts default files and configurations etc. and I get this strange encoding for 'MFC application' project only:
just example from default created some MFC application project
BOOL Ctest2App::InitInstance()
{
// °І¦pАіҐОµ{¦Ўёк°TІMіж«ь©wЁПҐО ComCtl32.dll 6.0 (§t) ҐH«бЄ©Ґ»
// ҐH±ТҐОµшД±¤ЖјЛ¦ЎЎA«h Windows XP »Эn InitCommonControls()ЎC§_«hЄєёЬЎA
// Ґф¦уµшµЎЄє«ШҐЯ±NҐў±СЎC
InitCommonControls();
CWinApp::InitInstance();
// Єм©l¤Ж OLE µ{¦Ў®w
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
// јР·ЗЄм©lі]©w
// ¦pЄG±z¤ЈЁПҐОіoЁЗҐ\ЇаЁГҐB·Qґо¤ЦіМ«б§№¦ЁЄєҐi°х¦жАЙ¤j¤pЎA±zҐiҐH±q¤U¦C
// µ{¦ЎЅXІѕ°Ј¤Ј»ЭnЄєЄм©l¤Ж±`¦ЎЎAЕЬ§уАx¦sі]©wИЄєµnїэѕчЅX
// TODO: ±zАіёУѕA«Чק惡¦r¦к (ЁТ¦pЎA¤ЅҐq¦WєЩ©ОІХВґ¦WєЩ)
SetRegistryKey(_T("Ґ»ѕч AppWizard ©ТІЈҐНЄєАіҐОµ{¦Ў"));
LoadStdProfileSettings(4); // ёь¤JјР·З INI Аɿﶵ (Ґ]§t MRU)
// µnїэАіҐОµ{¦ЎЄє¤еҐуЅdҐ»ЎC¤еҐуЅdҐ»tіd¦b¤еҐуЎB®Ш¬[µшµЎ»PАЛµш¶Ў¶i¦жіs±µ
...
... etc ...
While there is no such a problem with other types of projects, only with MFC application one?
9ine
|
|
|
|
|
A bug means that it uses the Taiwanese character set! When you run the MFC AppWizard make surte you change the "resources" language and it will be fine.
The Rob Blog Google Talk: robert.caldecott
|
|
|
|
|
never mind, I missed resourse language type, which was chinese by default?
9ine
|
|
|
|
|
Yes, it's chinese by default. Annoying, isn't it?
--
|
|
|
|
|
or a version pirated from China
-prakash
|
|
|
|
|
Mine's a pure and legal MSDN Universal copy. Still Chinese by default.
--
|
|
|
|
|
Hi everybody. I got a question related to an article for the Code Project I'm working at. I got this function in VC++ which returns a structure to VB. The structure contains a long member and a BSTR member. In VB the structure contains a long member and a String member, so their data types are matched. Ok. With the long member, there are no problems.
However, when I put a text in the BSTR member, like this:
cmResponse.theBSTR = SysAllocString(ConvertCharToBSTR("String added in <br />
VC++"));
(I pasted the ConvertCharToBSTR function at the end of this message)
I get the following data back in VB:
"S|t|r|i|n|g| |a|d|d|e|d| |i|n| |V|C|+|+|"
That | is actually some weird character. Of course, I realize this is probably some data type alignment issue. I tried sending char but with no use: VB requires SysAllocString to allocate the string in order to successfully receive it. Also, I think the String type from VB is not UNICODE while C++ sends an Unicode. I did make it work (although this is not entirely correct) like this:
LPCWSTR test = (LPCWSTR)"testing";<br />
cmResponse.sFifth = SysAllocString(test);
However, because "testing" has 7 letters, I get an eight character in VB : "|". So in VB it looks like this "testing|". If I write "testin" it's ok since it has 6 characters.
So what could be the problem? How can I do it to get this string correctly to VB? So far, the only solution I can figure out is to allocate a number of characters equal to the lenght of the string divided by 2 using SysAllocString, then if the string has an un-even number of characters, add a space to it. Which of course is an ugly solution.
Here's the ConvertCharToBSTR function, for all that matters...
BSTR ConvertCharToBSTR(char* CharValue)<br />
{<br />
int i;
int iLength = strlen(CharValue);
unsigned short* bstrResult = new unsigned short[iLength + 1];
<br />
for (i = 0; i < iLength; i++)<br />
{<br />
char iCharacter = CharValue[i];
bstrResult[i] = iCharacter;
bstrResult[i + 1] = '\0';
}<br />
return bstrResult;
}
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
ConvertCharToBSTR looks very messy function, could you not consider using _bstr_t[^]
-prakash
|
|
|
|
|
Doesn't work.
I put:
_bstr_t sTest = "Testing";<br />
cmResponse.sFifth = sTest;
Where sFifth is a _bstr_t. The VB application crashes when doing so.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Axonn Echysttas wrote: cmResponse.sFifth = sTest;
cmResponse.sFifth = sTest.Detach(); is the right way to use it
sFifth should also be BSTR
-prakash
-- modified at 5:53 Wednesday 2nd November, 2005
|
|
|
|
|
Hm.
error C2039: 'Detach' : is not a member of '_bstr_t'
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
did you include comutil.h ?
-prakash
|
|
|
|
|
Of course I did! : ). Anyway, the right way to do it is _variant_t, just thought you people want to know. With that it works ok, even if there are still some minor issues.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Axonn Echysttas wrote: Anyway, the right way to do it is _variant_t
ofcource I know that, But since BSTR worked for you in the first place I was keeping the solution simple for you.
-prakash
|
|
|
|