Hi Tyler, Thanks for your reply to my question. I thought I had found the problem when I discovered that the function had not been declared in the same way that it had been implemented (different return type and different parameter types). But when I corrected that, the error message was exactly the same. There's some problem hidden somewhere, and I'm going to have to spend a while trying to find it. Does anyone know whether or not the rich edit window must be a child of the program's primary window, or could it in be the primary window. Thanks again! Ian Ian D. Nichols, Toronto, Canada ----- Original Message ----- From: Tyler Littlefield To: programmingblind@xxxxxxxxxxxxx Sent: Saturday, August 29, 2009 12:28 PM Subject: Re: Problem with C++ function this has worked for me in the past. what is your proc defined as? should just be able to give it the address of the proc (if the procedure is already defined). ----- Original Message ----- From: Ian D. Nichols To: programmingblind@xxxxxxxxxxxxx Sent: Saturday, August 29, 2009 10:13 AM Subject: Problem with C++ function Hi Listers, I am trying to superimpose a RichEdit control onto the main program window and cannot get a call to the SetWindowLong function to compile properly. I am following an assembler example that assembles and works flawlessly, but keep getting an error with the C++ version of it. This assembles without error: invoke SetWindowLong, hRichEd, GWL_WNDPROC, hEditProc This is the C++ version: SetWindowLong (hRichEd, GWL_WNDPROC, hEditProc); According to a reference of Windows APIs, the 3rd parameter is of type long and is the procedure that handles keystrokes sent to the rich edit control. If I don't cast it the compiler complains that it cannot convert void to int. If I cast it to (long), the compiler complains that it cannot convert long to long (__stdcall *)(HWND__ *,unsigned int, unsigned int,long) I don't understand the meaning of the parameter list in this error message. Could this be a bug in the Borland compiler version 5.4, or am I just not spotting something that's wrong. Thanks in advance. Ian Ian D. Nichols, Toronto, Canada