CE problem: Cannot use DrawText() or SetWindowText()
CE problem: Cannot use DrawText() or SetWindowText()
I am using the latest CE release and am having this strange problem where DrawText() in general, and SetWindowText() on static controls will not work. I can see my menu entries, dialog box text controls and even listbox entries that I create.
For example, this simple piece of code will not work:
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
GetClientRect(hWnd, &r);
SetBkMode(hdc, OPAQUE);
SetBkColor(hdc, RGB(255, 255, 255));
SetTextColor(hdc, RGB(0, 0, 0));
DrawText(hdc, TEXT("Hello"), -1, &r, DT_CENTER);
EndPaint(hWnd, &ps);
break;
Am I doing something wrong in building the BSP? Or has anyone run into this same problem?
For example, this simple piece of code will not work:
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
GetClientRect(hWnd, &r);
SetBkMode(hdc, OPAQUE);
SetBkColor(hdc, RGB(255, 255, 255));
SetTextColor(hdc, RGB(0, 0, 0));
DrawText(hdc, TEXT("Hello"), -1, &r, DT_CENTER);
EndPaint(hWnd, &ps);
break;
Am I doing something wrong in building the BSP? Or has anyone run into this same problem?
Re: CE problem: Cannot use DrawText() or SetWindowText()
Store/Display the return values for the function calls that you are having problems with.
What are the return values?
What are the return values?
Re: CE problem: Cannot use DrawText() or SetWindowText()
DrawText() returns 14, which is the height of the text. The function behaves as if it is working, but no output! I also tried ExtTextOut() with no success. It also returns with no errors. I am using the latest CE update, with the only change to use English as the language. This is driving me crazy.
Re: CE problem: Cannot use DrawText() or SetWindowText()
CE update to PB or the latest CE image or the latest CE BSP.
Does it work with older images ?
Has it worked for you before ?
Does it work with older images ?
Has it worked for you before ?
Re: CE problem: Cannot use DrawText() or SetWindowText()
I am using the latest CE BSP release (20090817). This is my first attempt at running CE on this board. I did expect some problems, but not this simple text drawing code! Everything else works, touch screen, serial ports, etc. Can someone verify that this works for them? A simple Hello app with one window and the WM_PAINT message as follows:
hdc = BeginPaint(hWnd, &ps);
GetClientRect(hWnd, &r);
DrawText(hdc, TEXT("Hello"), -1, &r, DT_CENTER);
Thanks in advance.
hdc = BeginPaint(hWnd, &ps);
GetClientRect(hWnd, &r);
DrawText(hdc, TEXT("Hello"), -1, &r, DT_CENTER);
Thanks in advance.
Re: CE problem: Cannot use DrawText() or SetWindowText()
I would try some of the older CE images.
I have noticed some subtle differences to the newer CE Images and the BSP that have affected some of my code. I also noticed on the newer BSP and thus images, the MFC library has been removed, possibly others too.
Mind you if a library was missing, youd get a crash or error.
Check that your CE contains the files gx.dll and cegl.dll in windows folder. (read they were needed. They are the CE Draw Library)
Also try running it on the pc device emulator, that be the quickest way to tell if the issue is the CE image or the code.
I have noticed some subtle differences to the newer CE Images and the BSP that have affected some of my code. I also noticed on the newer BSP and thus images, the MFC library has been removed, possibly others too.
Mind you if a library was missing, youd get a crash or error.
Check that your CE contains the files gx.dll and cegl.dll in windows folder. (read they were needed. They are the CE Draw Library)
Also try running it on the pc device emulator, that be the quickest way to tell if the issue is the CE image or the code.
Re: CE problem: Cannot use DrawText() or SetWindowText()
cegl.dll and gx.dll are 2 libraries used by CE Draw, ahigh-speed graphics library in Windows CE. I don't think that they are standard libraries.
Re: CE problem: Cannot use DrawText() or SetWindowText()
I have resolved the problem. It was an operator error in the usage of DrawText().
Who is online
Users browsing this forum: No registered users and 7 guests