|
Or team members in a race to please the boss (chetana is usually a girl's name and vikram a boy's)
|
|
|
|
|
Maybe they should get together and make beautiful programs ...
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
hi all,
please tell me What characters are not valid and not supported in URL?
thanks in advance.
|
|
|
|
|
Try something like this[^], it's amazing what you can learn.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
I am facing a strange problem.
In my dialog application (Win32), I have a button control.
I am loading a "Greek" string ("Επιλογή Εκτυπωτή")from a string DLL and trying to
>Case-1
display on the button control.
>Case-2
And also I am trying to use the same string to set the dialog's title.
But here the problem is,on the button, text is displayed correctly, but dialog's title displayed as
"?p???? ??t?p?t?"
I am using (both for Case-1 and Case-2)
>LoadStringW to load the string
>SetWindowTextW to display
While debugging, I found that strings are loaded properly in both the cases.
I have also tried by changing code pages using setlocale API.
But I couldn't solve this issue.
Please provide me some tips so that I can move forward.
Thanks in advance
msr
|
|
|
|
|
The difference is on the font used for the two items: are you sure that the font used for window titles supports greek characters?
|
|
|
|
|
I have seen the dialog properties, the font is Microsoft Sans Serif.
I think this font supports Greek also. Check
Regards
msr
|
|
|
|
|
I have just used your Greek phrase to set my dialog title and it appears correctly (font is MS Sans serif), so I cannot see what is different between your code and mine. Maybe you could show a bit more of your code as there may be a clue that you have missed.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Hi, thanks for the reply. Here is my code.
WCHAR* chr = L"Επιλογή Εκτυπωτή";
HWND hWnd = ::GetDlgItem(m_hWnd, IDC_BUTTON);
::SetWindowTextW(m_hWnd, chr);
::SetWindowTextW(hWnd, chr);
>> Where m_hWnd is handle to the Dialog and hWnd is handle to the Button.
>> Output
>> Button - "Επιλογή Εκτυπωτή"
>> Dialog's Title - "?p????? ??t?p?t?"
Regards
msr
|
|
|
|
|
That is basically what I did and it worked fine. It would appear that the system is trying to translate the characters to a different font in the title of the dialog bar. I can only suggest rechecking your dialog settings, including verifying that the system is not sending a WM_SETFONT message which is changing it from your original font selection. Other than that I'm a bit lost I'm afraid.
I am often reminded of a sentence in "Programming Windows 3.1" by Charles Petzold where he says (if I remember correctly): "No-one said it has to be to be easy".
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Same happen to me when i tried to load "Chinese" string, But changing locale works for me..
|
|
|
|
|
Hi,
Even I have tried by changing local, but it didn't work for me.
Can you just brief me how did you change your locale. Give me some steps.
Thanks in advance...
Regards
msr
modified on Thursday, October 21, 2010 4:47 AM
|
|
|
|
|
I understand the FILETIME structure and how data is stored.
However I called a Filename's attributes and retrieved the time/date attributed to it.
Then calling FileTimeToLocalFileTime function converts from UTC to LocalTime.
However I'm seeing a weird anomaly, it appeared to occur on the 24 hour conversion.
Time during the day (AM) was missing an hour, but on special folders by located for Windows.
Even files located in the root I created during the day were correctly timed?
|
|
|
|
|
if you have FILETIME structure, then
use this function FileTimeToSystemTime();
in this function pass the SYSTEMTIME as sencond argument.
like this:
FileTimeToSystemTime(&fileTime,&systemTime);
szString.Format (_TEXT("%02d-%02d-%d"),systemTime.wMonth,systemTime.wDay,systemTime.wYear);
Regards,
Srinivas
|
|
|
|
|
You haven't read my problem, maybe took a good look than a glimpse at it!
FileDetails is Structure used in FindFile function.
FILETIME UTCTime = FileDetails.ftCreationTime;
FILETIME LocalTime;
FileTimeToLocalFileTime( &UTCTime, &LocalTime);
SYSTEMTIME HumanReadableForm;
FileTimeToSystemTime(&LocalTime, &HumanReadableForm);
|
|
|
|
|
Fareed Rizkalla wrote: Time during the day (AM) was missing an hour...
This makes no sense. Please explain.
Fareed Rizkalla wrote: Even files located in the root I created during the day were correctly timed?
Are you asking or telling?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
I'm telling my problem, and asking for a possible cause!
If you don't have AM/PM in a time format you assumed it's using the 24 hour format.
I was mapping files on my drive, when I suddenly found a deviation between the time listed in Explorer and my output. It seemed to occur randomly and it was related to time during AM and only files related to the OS, not the files which I had created which were also during the same period AM.
Is this clearer?
|
|
|
|
|
Hi all,
I have made a edit control in my application, in that i have selected multiple line option. My problem is if i copy paste some data in that edit control it takes only 1108 lines or approx 28000 characters. Is there any kind of upper limit for edit box.
Thanks in advance
|
|
|
|
|
|
Here is a snippet from the documentation of EM_SETLIMITTEXT.
Before EM_SETLIMITTEXT is called, the default limit for the amount of text a user can enter in an edit control is 32,767 characters.
|
|
|
|
|
With same code and same AVI file, the intensity value read are different on different machine.
On some machine black area is read as 0 and on some machine it is read as non zero value (viz. 4, 5, 7 etc)
Both the machines uses Main Concept MJPEG codec for reading of AVI files.
Below is code snippet used to open the AVI file
HRESULT hResult = 0;
AVIFileInit() ;
hResult = AVIFileOpen( &m_AviFile, m_strAVIFileName, OF_READ, NULL ) ;
if(hResult != 0)
{
TRACE( _T("AVIFileOpen() Error!!\n") ) ;
}
hResult = AVIFileGetStream(m_AviFile, &m_Stream, streamtypeVIDEO, 0);
if(hResult != 0)
{
TRACE( _T("AVIFileGetStream() Error!!\n"));
}
AVIStreamAddRef(m_Stream );
hResult = AVIStreamInfo(m_Stream, &m_StreamInfo, sizeof(AVISTREAMINFO));
if(hResult != 0)
{
TRACE( _T("AVIStreamInfo() Error!!\n") ) ;
}
m_nEndFrame = (short)((AVIStreamEnd( m_Stream )) - 1) ;
long nLength = AVIStreamLength(m_Stream);
long lSize;
hResult = AVIStreamReadFormat(m_Stream, 0, NULL, &lSize);
m_pBitmapInfoHeader = (BITMAPINFOHEADER*)GlobalAllocPtr(GHND, lSize);
hResult = AVIStreamReadFormat(m_Stream, 0, (LPVOID)m_pBitmapInfoHeader, &lSize);
if(m_pBitmapInfoHeader->biBitCount == 16)
{
m_pBitmapInfoHeader->biBitCount = 24;
}
m_pBitmapInfoHeader->biCompression = BI_RGB;
m_pBitmapInfoHeader->biSizeImage = (DWORD)m_StreamInfo.dwSampleSize;
m_pBitmapInfoHeader->biSize = sizeof(BITMAPINFOHEADER);
m_GetFrame = AVIStreamGetFrameOpen( m_Stream,m_pBitmapInfoHeader);
Below function is used to retrieve the starting address for particular Frame
BYTE* GetFrameAVI(UINT nFrameNumber)
{
return (BYTE*)AVIStreamGetFrame(m_GetFrame,nFrameNumber);
}
Starting address of bit data is calculated as follows
BYTE* GetBitAddress( BYTE* pDIB )
{
TRY
{
if ( pDIB == NULL )
{
return NULL ;
}
WORD wBitCount = ((BITMAPINFOHEADER*)pDIB)->biBitCount ;
DWORD dwNumColors = 0 ;
if ( wBitCount != 24 )
{
dwNumColors = ((BITMAPINFOHEADER*)pDIB)->biClrUsed ;
if ( dwNumColors == 0 )
{
switch ( wBitCount )
{
case 1 :
dwNumColors = 2 ;
break;
case 4 :
dwNumColors = 16 ;
break;
case 8 :
dwNumColors = 256 ;
break;
default:
dwNumColors = 0;
break;
}
}
}
DWORD dwColorTableSize = (dwNumColors * sizeof( RGBQUAD )) ;
DWORD dSize = 0;
dSize = ((BITMAPINFOHEADER*)pDIB)->biSize ;
return ((BYTE*)pDIB + dSize + dwColorTableSize) ;
}
CATCH (CException, pEx)
{
return NULL;
}
END_CATCH
}
What is the possible reasons for intensity being read differently?
(Does it had something to do with the Luminance from HSL?)
In case you need sample application, do let me know, so that I can mail the same.
|
|
|
|
|
Hi,
while using the function LPtoDP i am getting the error "Arithmetic result exceeded 32 bits".
I am not able the find the root cause of the problem. I am using x = 1000 in SetViewportExt and
x = 500 * (some dynamic value) in SetWindowExt. Is it Ok if i reduce x = 100 in SetViewportExt and x = 50 * (some dynamic value) in SetWindowExt.
|
|
|
|
|
ashtwin wrote: Is it Ok if i reduce x = 100 in SetViewportExt and x = 50 * (some dynamic value) in SetWindowExt.
Certainly it is, but that does not necessarily solve your problem; in my own experience LPtoDP works fine.
The first thing you should be doing is to use your debugger to find out why the overflow is occurring and fix that problem. Then you can decide whether you need to reduce or possibly increase some of your parameter values.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Thanks for replying.
Actually this error occured only twice and i am not able to reproduce it.
I have the following traces
Conversion from LPtoDP failed.
>::LPtoDP(dc.GetSafeHdc(), points, noPoints);
noPoints = 2.
ViewportExt.cx: 1000
ViewportExt.cy: 616
ViewportOrg.x: 0
ViewportOrg.y: 0
WindowExt.cx: 500
WindowExt.cy: 1000
WindowOrg.x: 68207250
WindowOrg.y: 0
points[0]: x = 68207250 y = 0
points[1]: x = 68207742 y = 1000.
But i am not able to find out which parameter value is exceeding.
|
|
|
|
|
Your x values do indeed seem rather large, and it may be that when converting to the device co-ordinates you have exceeded the limit of 27 bits. For example if your mapping is 2 device points to 1 logical, then your x value in device co-ordinates will immediately overflow into 28 bits.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|