|
Michael Mogensen wrote:
As it turned out an update-ev. came over and over again if I did the work on EN_UPDATE
Oops. I forgot to mention that by setting the text formatting, you cause another EN_UPDATE message to be sent, which becomes an endless recursion. You would need to set a static/class-member variable inside the handler and check it when the handler is entered to see if you're already processing the message, and return immediately if you are.
Glad to be of help
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
I need a cross-platform C++ GUI library for a new project I'm working on. Am not particularly thrilled with the current cross-platform library options I've run across. Would like to find a GUI library that works similar to and as easily as a browser, where you can input text and various controls to display on the screen using a hypertext language like HTML or embed instructions for screen layout in the code. Are there any cross-platform C++ GUI library projects in the works that sound similar to this and/or might need another developer
to help out? Are there any new cross-platform C++ GUI projects starting up that might need developers? It would be nice to get involved with a group to work on this rather than my trying to code a new GUI library all by myself. Suggestions appreciated.
Thanks.
Laura
http://www.distasis.com/cpp/
|
|
|
|
|
Have you looked at what the Mozilla team are doing with their XUL stuff.
http://www.mozilla.org/xpfe/[^]
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
I checked out the page you mentioned and wrote to the contact e-mail address there. Was told the information on the page is very old and hasn't been kept up-to-date.
Anyone have any other ideas?
Thanks.
Laura
http://www.distasis.com/cpp/
|
|
|
|
|
This is the most up-to-date link I have,
http://www.xulplanet.com/tutorials/xultu/intro.html[^]
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
i try to create a mfc dialog based xxx application.
i add the one line of code in xxxDlg.h
-------------------------------------
#endif // _MSC_VER > 1000
// newly added code
typedef CList<int,int> CPersonList;
/////////////////////////////////////////////////////////////////////////////
// CXxxxxDlg dialog
class CXxxxxDlg : public CDialog
{
-------------------------------------
however, i get the following compilation error:
d:\documents and settings\lim ming wee's
pc\desktop\xxxxx\xxxxxdlg.h(11) : error C2143: syntax error : missing
';' before '<'
d:\documents and settings\lim ming wee's
pc\desktop\xxxxx\xxxxxdlg.h(11) : error C2143: syntax error : missing
';' before '<'
can anyone tell me how can i solve this problem?
thank you.
regards
yccheok
|
|
|
|
|
#include "afxtempl.h" before. (-:
Regards,
BB
|
|
|
|
|
Hello,
how can I determine if the current build is a Unicode build? Is there any flag defined that tells me that?
For example I have this function:
{
unsigned long uStringLength = string.GetLength();
LPTSTR lp = string.GetBuffer(uStringLength);
DoBinaryWork(lp, uStringLength);
string.ReleaseBuffer();
} But if building a Unicode build this code will not work because Unicode takes 16 bits per character, therefor only the half of the string is passed to the DoBinaryWork function.
How can I check if building Unicode? I assume there is a flag that can be checked with #ifdef, but what is it?
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
the UNICODE macro is defined if UNICODE is enabled. Alternatively you could overload DoBinaryWork to take a wstring (basic_string<wchar_t>) or a string (basic_string<char>) which may be possible
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
I'm a little confused by this.
CString::GetLength() returns the length in characters - so it still returns the correct string length, and if the DoBinaryWork() function takes a LPTSTR, then it also should work correctly.
This code should work unchanged under both ANSI and UNICODE builds.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
CString::GetLength() returns the length of the string in characters (as you said), but I need it as bytes. A CString character can be 8 or 16 bits long, therefor number of bytes != number of characters.
The DoBinaryWork function takes an unsigned char * as parameter. I forgot to place a cast to the unsigned char * in the code example, sorry.
Any idea how to check for Unicode?
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
|
Thanks!
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Hi ... can any1 tell me what is wrong with the following code? i'm sure its some silly mistake that i made ... I am trying to create a Richedit control in a window. I have included richedit.h and my code compiles successfully. but _hWnd remains NULL after this call ... i am using Microsoft VC++ 6 with the Platform SDK 2003 installed. please help me out. thankx in advance.
_hWnd = CreateWindowEx(WS_EX_CLIENTEDGE,
RICHEDIT_CLASS,
TEXT("AA"),
WS_CHILD | WS_VISIBLE | ES_MULTILINE,
10, 10,
100, 100,
_parent,
0,
(HINSTANCE)::GetModuleHandle(0),
0);
-Tareq
|
|
|
|
|
|
After using the following code from MSDN to retrieve the last error right after CreateWindowEx, i get "Invalid Window Handle".
LPVOID lpMsgBuf;
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0,
NULL );
MessageBox( NULL, (LPCTSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION );
LocalFree( lpMsgBuf );
-Tareq
|
|
|
|
|
This seems to suggest that the parent window has not been created yet. Where are you calling the function from?
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Here is the code ...
#define WIN32_LEAN_AND_MEAN
#include < windows.h >
#include < stdlib.h >
#include < richedit.h >
#include < commctrl.h >
HWND _rich;
HMODULE _hRich;
char className[14];
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_CREATE:
_rich = CreateWindowEx(WS_EX_CLIENTEDGE,
className,
"Sample Text",
WS_CHILD | WS_VISIBLE | ES_MULTILINE | WS_BORDER | WS_VSCROLL,
10, 10,
200, 200,
hWnd,
0,
GetModuleHandle(0),
0);
LPVOID lpMsgBuf;
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0,
NULL );
MessageBox(
NULL,
(LPCTSTR)lpMsgBuf,
"Error",
MB_OK | MB_ICONINFORMATION
);
LocalFree( lpMsgBuf );
break;
case WM_CLOSE:
DestroyWindow(hWnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
}
return DefWindowProc(hWnd, msg, wParam, lParam);
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
WNDCLASSEX wc;
HWND _hWnd;
ZeroMemory(className, 14);
InitCommonControls();
_hRich = LoadLibrary("RICHED20.DLL");
if (!_hRich)
{
_hRich = LoadLibrary("RICHED32.DLL");
if (!_hRich)
{
MessageBox(0, "Richedit control not loaded!", "Error", MB_ICONERROR);
exit(0);
}
else
{
strcpy(className, "RichEdit");
}
}
else
{
strcpy(className, "RICHEDIT_CLASS");
}
wc.cbClsExtra = 0;
wc.cbSize = sizeof(WNDCLASSEX);
wc.cbWndExtra = 0;
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW);
wc.hCursor = 0;
wc.hIcon = 0;
wc.hIconSm = 0;
wc.hInstance = hInstance;
wc.lpfnWndProc = (WNDPROC)WndProc;
wc.lpszClassName = "MainWindowClass";
wc.lpszMenuName = 0;
wc.style = 0;
if (!RegisterClassEx(&wc))
{
MessageBox(0, "Error", "", MB_ICONERROR);
exit(0);
}
_hWnd = CreateWindowEx(WS_EX_WINDOWEDGE,
"MainWindowClass",
"",
WS_OVERLAPPEDWINDOW,
0, 0,
300, 300,
0, 0,
hInstance, 0);
ShowWindow(_hWnd, SW_SHOW);
UpdateWindow(_hWnd);
MSG msg;
while (GetMessage(&msg, 0, 0, 0) > 0)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
-Tareq
|
|
|
|
|
This code won't work. You'll get an error message saying that you're using an unknown class. You need to change
strcpy(className, "RICHEDIT_CLASS");
to
strcpy(className, RICHEDIT_CLASS);
I tried this and it worked fine.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
thankx a lot man ... i knew it was a silly mistake!!!
-Tareq
|
|
|
|
|
Did you init richedit control??
if you use MFC, please try to call AfxInitRichedit() in App::InitInstance().
maybe that's the point.
|
|
|
|
|
No MFC. Just Win32.
-Tareq
|
|
|
|
|
try to use "InitCommonControlsEx();" in your InitInstance() function.
|
|
|
|
|
nope its the same.
-Tareq
|
|
|
|
|
try
::LoadLibrary("Riched20.dll");
For win95 the rich edit control lib is "Riched32.dll",
for win98 win2k&winxp, the lib is "Riched20.dll"
|
|
|
|
|