|
Make all the text smaller and no one will notice... 
|
|
|
|
|
i can't, becoz if i make all the text smaller the hindi text seems like dot dot dot...
Regards,
Vishal
|
|
|
|
|
I've never played with different texts... so can't help too much there...
|
|
|
|
|
1) Is Aparajita is Hindi font and
2) Is सरकारी is unicode string or ascii string?
If it is unicode than you must choose the font as Mangal and than check.
"Every Little Smile can touch Somebody's Heart...
May we find Hundreds of Reasons to Smile Everyday... and
May WE be the Reason for someone else to smile always!" (ICAN)
"Your thoughts are the architects of your destiny."
|
|
|
|
|
SP 24 wrote: 1) Is Aparajita is Hindi font and
Yes
SP 24 wrote: 2) Is सरकारी is unicode string or ascii string?
Unicode String
SP 24 wrote: If it is unicode than you must choose the font as Mangal and than check.
Checked with Mangal. The result is same.
Actually the string contains both english and hindi.
Regards,
Vishal
|
|
|
|
|
I am facing this problem with Bengali and Oriya only but not in Hindi. Please check that you have Mangal font installed in your system?
It should be in SystemDrive:\Windows\Fonts folder. One more thing that I do is copy the font of mangal in Windows 7 or Vista and installed it in your pc. Might be your problem is resolved.
"Every Little Smile can touch Somebody's Heart...
May we find Hundreds of Reasons to Smile Everyday... and
May WE be the Reason for someone else to smile always!" (ICAN)
"Your thoughts are the architects of your destiny."
|
|
|
|
|
can you check you aprajita font in font folder, what is the maximum size it's support?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi Alok ji,
Please ask this question to Vishal .
BTW the string is Unicode than there is no need to set the Hindi font. He can set Mangal instead.
"Every Little Smile can touch Somebody's Heart...
May we find Hundreds of Reasons to Smile Everyday... and
May WE be the Reason for someone else to smile always!" (ICAN)
"Your thoughts are the architects of your destiny."
|
|
|
|
|
SP 24 wrote: Please ask this question to Vishal .
yeap.... thanks!
SP 24 wrote: there is no need to set the Hindi font. He can set Mangal instead.
some times it's project requirement to use some particular fonts and never depend on UNICODE based on size and shape they take
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
ThatsAlok yeap.... thanks!
ThatsAlok some times it's project requirement to use some particular fonts and never depend on UNICODE based on size and shape they take
Yae but for English and Unicode font, I don't think so that it is being used.
For an example if I have English string might be "abcd" and I set some Hindi font. If any shape is mapped in that Hindi font than it might be a hindi value without meaning. So for English font we have to take care of it.
Example :
In some Hindi font "a is mapped with shape क" and in some other font may be "a is mapped with shape अ".
"Every Little Smile can touch Somebody's Heart...
May we find Hundreds of Reasons to Smile Everyday... and
May WE be the Reason for someone else to smile always!" (ICAN)
"Your thoughts are the architects of your destiny."
|
|
|
|
|
Aprajita Font maximum size is 72. I had tried Mangal Font also, but no success.
Regards,
Vishal
|
|
|
|
|
Did you check the font in fonts folder ??
"Every Little Smile can touch Somebody's Heart...
May we find Hundreds of Reasons to Smile Everyday... and
May WE be the Reason for someone else to smile always!" (ICAN)
"Your thoughts are the architects of your destiny."
|
|
|
|
|
SP 24 wrote: Did you check the font in fonts folder ??
Yes checked.
Same problem with bengali font. Oriya not checked.
Regards,
Vishal
|
|
|
|
|
vishalgpt wrote: Yes checked.
It means that your font is in font folder. Right.
Now open Winword and write the path that you want to show in edit control and select all and set the font Mangal and check it is same as displayed in your edit control. If yes than try to check with different size.
Or copy the Mangal font from vista and windows 7 machine. New version of Mangal font looking nice.May be your problem is resolved by installing it in your system.
"Every Little Smile can touch Somebody's Heart...
May we find Hundreds of Reasons to Smile Everyday... and
May WE be the Reason for someone else to smile always!" (ICAN)
"Your thoughts are the architects of your destiny."
|
|
|
|
|
SP 24 wrote: It means that your font is in font folder. Right.
YES.
It is ok with winword. But not with Edit Control. I am on Windows 7.
Regards,
Vishal
|
|
|
|
|
Please share your code where you set the font in Edit control.
"Every Little Smile can touch Somebody's Heart...
May we find Hundreds of Reasons to Smile Everyday... and
May WE be the Reason for someone else to smile always!" (ICAN)
"Your thoughts are the architects of your destiny."
|
|
|
|
|
Can't say a thing without seeing your code.
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
So, got no idea why this is not working but it simply not working.
SIZE_T BASE_BUFFER_SIZE = 512;
BYTE * bInitialBuffer = NULL;
bInitialBuffer = (BYTE *)VirtualAlloc(0,
BASE_BUFFER_SIZE, MEM_RESERVE, PAGE_READWRITE);
if(bInitialBuffer == NULL)
{
TRACE("VirtualAlloc failed!");
return NULL;
}
DWORD dwReadBytes;
while (FALSE != ReadFile(hDevice, bInitialBuffer, BASE_BUFFER_SIZE,
(LPDWORD)&dwReadBytes, 0) && dwReadBytes > 0)
{
TRACE1("got buffer! %d",dwReadBytes );
}
if(dwReadBytes <= 0) TRACE("failed!");
GetLAstError() returns Invalid access to memory location.
I am dealing with virtual alloc for a first time :P
What am i doing wrong?
Thanks
011011010110000101100011011010000110100101101110
0110010101110011
|
|
|
|
|
csrss wrote: VirtualAlloc(0,
BASE_BUFFER_SIZE, MEM_RESERVE, PAGE_READWRITE);
Just a hunch. The doc says that MEM_RESERVE flag Reserves a range of the process's virtual address space without allocating any actual physical storage in memory or in the paging file on disk.
If you're actually going to do something with the memory, MEM_COMMIT may be a good option (you could combine flags, like MEM_RESERVE | MEM_COMMIT ). At least the doc[^] says so.
You also failed to tell what's "not working". I'm assuming that your ReadFile call failed, and GetLastError returns invalid access to memory location. Reading that, I'm assuming that since you're just reserving memory with your VirtualAlloc call, and not committing it before using, you're getting an invalid access error.
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
Yep, you are right. But here with this stuff i got more and more problems. For example, i cannot return bytes from function, (this code is a function, which should read a file into BYTE array and return this array among with nr of bytes read).
BYTE *ReadBytes(HANDLE hDevice, LPDWORD lpdwBytesRead)
{
SIZE_T BASE_BUFFER_SIZE = 512;
BYTE * bInitialBuffer = NULL;
bInitialBuffer = (BYTE *)VirtualAlloc(0,
BASE_BUFFER_SIZE, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
if(bInitialBuffer == NULL)
{
TRACE("VirtualAlloc failed!");
return NULL;
}
DWORD dwReadBytes;
while (FALSE != ReadFile(hDevice, bInitialBuffer, BASE_BUFFER_SIZE,
(LPDWORD)&dwReadBytes, 0) && dwReadBytes > 0)
{
TRACE1("got some buffer! %d", dwReadBytes);
lpdwBytesRead += dwReadBytes;
}
return bInitialBuffer;
}
and if i call it:
DWORD read = 0;
BYTE *DataBuffer = ReadBytes(hFile, &read);
read is always zero, and i got no bytes returned from function... And i cannot use just defined size (skip memory allocation).
Help ;(
011011010110000101100011011010000110100101101110
0110010101110011
|
|
|
|
|
One step at a time. Have you progressed from your previous error, or not? With the MEM_RESERVE flag, do you still get an invalid access error while calling ReadFile ?
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
At this moment:
while (FALSE != ReadFile(hDevice, bInitialBuffer, BASE_BUFFER_SIZE,
(LPDWORD)&dwReadBytes, 0) && dwReadBytes > 0)
{
TRACE1("got some buffer! %d", dwReadBytes);
dwReadBytes contains right value, which is 106 bytes, that is exactly the size of my file (just a text file). Here :
lpdwBytesRead += dwReadBytes;
It tries to append them, but lpdwBytesRead contain some trash, even if it has been initialized outside the function to zero:
DWORD read = 0;
BYTE *DataBuffer = ReadBytes(hFile, &read);
When function returns, read is zero and there is no buffer returned
011011010110000101100011011010000110100101101110
0110010101110011
|
|
|
|
|
This piece of code works (you had trouble bringing the buffer to the calling function, which is resolved here)
#define BASE_BUFFER_SIZE 512
BOOL ReadBytes(HANDLE hFile, PBYTE bInitialBuffer)
{
DWORD dwReadBytes;
while (FALSE != ReadFile(hFile, bInitialBuffer, BASE_BUFFER_SIZE,
(LPDWORD)&dwReadBytes, 0) && dwReadBytes > 0)
{
}
if(dwReadBytes <= 0)
{
return FALSE;
}
return TRUE;
}
void CMTest1Dlg::OnBnClickedOk()
{
HANDLE hFile = NULL;
hFile = CreateFile(L"C:\\temp\\myfile.txt", GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
if(INVALID_HANDLE_VALUE == hFile){
AfxMessageBox(L"CreateFile failed");
return;
}
BYTE *buffer = NULL;
buffer = (BYTE *)VirtualAlloc(0, BASE_BUFFER_SIZE, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
if(NULL == buffer)
{
AfxMessageBox(L"VirtualAlloc failed!");
return;
}
BOOL bRead = ReadBytes(hFile, buffer);
}
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
csrss wrote: i cannot return bytes from function, (this code is a function, which should read a file into BYTE array and return this array among with nr of bytes read).
This has nothing to do with VirtualAlloc .
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
I know it is not perfect :P (the code)
I have never worked with unsigned type allocation before. (the only proper way for returning unsigned type from function i know is to declare buffer size and make this, BYTE, static)
If i pass a pointer to BYTE to this function from calling function, it still returns empty BYTE buffer.
I am out of ideas.
Somebody, help? :P
011011010110000101100011011010000110100101101110
0110010101110011
|
|
|
|