Does anyone know how VB translates extended keycodes (exspecialy on WinXP). When ALT+0176 is pressed, the keycode should be 0xB0 but we get 0xFFFFB0FF instead. Signed: John R. Shaw Blast: I must remember to find my password!
John Shaw
Posts
-
0xFFFFB0FF -
LoadLibrary(...) failed - Access is deniedI am working on a VB application that use a control that I wrote 2 months ago. When I tried to recreate the .exe, about 30-minutes ago, it informed me that it could not load a control. When I tried to close VB, it asked me if I wanted to save a source/module that has not been modified in 2-weeks. That module/form is the one that needed the control. I closed without saving, restarted the system, then brought up VC++ and tried to use the ActiveX Test Container and received the following: "Failed to create control: Unspecified error". I've tried rebuilding the control (VC++ says it registerd the control), but I still get the same message. I am the only one who has access to the control, and has it registed; even though it is on the server. (Heck! I am the only one who knows where it is at.) Does anyone know what the is going on here? Everything was fine an hour ago! Signed: John R. Shaw
-
Problem with CToolBar and XPI've have the same problem with dialogboxes; you erase the background your way and windows ignores that and does it its way. A solution I do not like, but works every time: Do your drawing in the OnDraw() or OnPaint(). The problem here is that you may (or may not) see it flicker, since the drawing is actualy being done twice. Good luck! Signed: John R. Shaw
-
WinXP strange character conversionNote: UNICODE uses same extended character codes as windows extended codes. The problem only happens in VB code. I think the problem only occurs on WinXP, if more than one language is installed. On Win2000; if you select Chinese (Taiwan): ALT+0176 translated to 162 = '¢'. ALT+0177 translated to 161 = 'í'. ALT+0178 translated to 50 = '2'.
-
WinXP strange character conversionPrivate Sub box_Keypress(KeyAscii As Integer) 'if you enter ALT+0176 'then KeyAscii = 176 normaly, but on some WinXP machines 'KeyAscii = -23583 (because character not in range [0,127]). 'Also note that if you try to convert this value to a character, 'you'll get a range error (of course). End Sub Does anyone know why we receive an invalid character code on some WinXP machines and not on others? Why are only characters in the range [0,127] being properly passed to Keypress? Signed: John R. Shaw
-
External mode problemSorry no code.:sigh: (USING TAPI) I have a program (I wrote) that makes a call via modem to download data. The program has been working on Wind9x/NT4.0 and above for a few years. Now we have an XP machine here that will download with the internal modem, but will cause the program to crash if you use an external modem.:confused: If anybody has any ideas! Please pass them on! Thank you! Signed John R. Shaw
-
RS-232 -
Convert RAW data to grayscale bitmapIt depends on format of the raw data. The simpilest solution would be to write a function that reads the RAW data, one pixel at a time converting the return value to RGB. Then create a bitmap of the same size, select it into a memory DC, and copy the data to it.
// Get pixel from your raw data class
COLORREF CRawData::GetPixel(int x, int y)
{
.....
}
// Convert to bitmap
BOOL CRawData::ConvertToBitmap()
{
if( !m_pData )
return FALSE;if( m\_Bitmap.GetSafeHandle() ) m\_Bitmap.DeleteObject(). .... // creaate bitmap .... // create memory DC .... // slecect bitmap into DC if( something went wrong ) .... // clean up and return FALSE // Copy data for( int y=0; y < m\_nHeight; ++y ) { for( int x=0; x < m\_nWidth ) dcMem.Set(x,y,GetPixel(x,y)); } .... // select oldbitmap into DC return TRUE;
}
The above would be slow, but it is the simpilist way to do it. Now if you want to save it to a disk file, you should look at using GDI+ or one of the articles at codeproject on working with DIBs (bitmaps). Gool luck! Signed John R. Shaw