|
I've been there. It was a while ago, but I think it had to do with the message pump.
Make sure that you're handling your messages to the custom control correctly.
Hugo
|
|
|
|
|
Ok. Thanks very much for the reply and the help. I'll look at the messages and go from there.
- Jason
(SonorkID 100.611)
In the beginning, teachers taught the 5 W's: who, what, where, when, why. Now it's just a big damn G
|
|
|
|
|
Could you please perhaps report back if this was the correct solution later on?
I Would be delighted to know that I've helped someone.
|
|
|
|
|
Gladly.
I took another peek at the message handlers but couldn't find anything obviously wrong. I decided to take another crack at it from scratch, and this time the program loaded, and my custom control was visible. I *think* the problem I introduced originally was due to misreading Chris' article and trying to simultaneously implement the control as one you can add in with the resource editor, AND one that you manually Create(). I think for some reason this simply caused the program to not load.
Anyway, I continued to work on it and have made progress on this control (which I need for an app I'm working on--yes, it's supposed to be like the Task Manager grid control thingy). What a difference being able to see the program makes!
Thanks for the help,
- Jason
(SonorkID 100.611)
In the beginning, teachers taught the 5 W's: who, what, where, when, why. Now it's just a big damn G
|
|
|
|
|
Could anyone point me in the direction of an example or suggest a way to do an error log view in MFC?
I need something similar to Visual Studio's build output - a read only text output.
Should I derive a class from CEditView or CRichEditView or is it better to roll my own via CScrollView? I don't need anything too fancy (e.g. colours, fonts etc.) as it's just for an in-house tool that I'm writing.
Thanks for your help,
Marc
|
|
|
|
|
I did it without MFC, I just created an edit box and made it read only. It's one of the flags you can set for an edit box.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
Thanks Christian but it's not quite what I want.
I'm using the doc/view architecture so I want it to be a view not just an edit box.
I've changed the flags of the edit view before and it's ok but I was wondering if there was a better way without having a greyed background and a cursor (caret) on screen.
Any ideas?
Marc
|
|
|
|
|
You can hide the caret - I did. As for the rest, mine did not go grey, if yours is, try handling key presses yourself in the view and discarding them. This has the advantage that you could accept certain keys to, for example, clear the view.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
It's gone grey for me!
The method I'm using to set readonly is:
void CLogTextView::OnInitialUpdate()
{
CEditView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class
CEdit &edit_ctrl = GetEditCtrl();
edit_ctrl.SetReadOnly();
}
This makes the view go grey! Any ideas how not to leave it white?!
Also, do you know which methods hide the caret?
Thanks for your help,
Marc
|
|
|
|
|
As I recall, there was a hide caret function I called in set focus. I dunno why your view is grey, but as I said, if you leave that and instead catch WM_KEYDOWN, WM_KEYUP and WM_CHAR and don't call the base class, you'll get what you are after.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
Cheers Christian.
That works a treat.
Marc
|
|
|
|
|
Ah, but there is one problem.
Whenever I add text to the edit control it seems to notify the Document and hence asks me if I want to save my changes when I go to quit out. Any idea how to stop this?
Marc
|
|
|
|
|
I did not use Doc/View. The Document has a dirty flag - set it to false as you close and you won't get that prompt. I forget it's name though.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
Yes, I could do that but I won't know whether the rest of my code has properly modified the document or not.
Is there no way to stop the edit control from telling the document that it is being modified?
Marc
|
|
|
|
|
In the code that updates the edit control, check if the flag is set to dirty. If not, then reset it to not dirty after doing the update.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
Thanks Christian!
Again, you've sorted things out!
Marc
|
|
|
|
|
I want to Serialize a CBitmap Varable with some other information.
How Do I Searialize this CBitmap.
Abhishek Narula
"Learn to appreciate others ... World would appreciate you"
|
|
|
|
|
Read the FAQ, or my GDI+ articles.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
I am creating server based multi client chat application. In this regard i like to ask a question. I hope that "experienced" people will answer these easily. Remember that the application is very simple. A client just send text message of certain size to another via server. Server will run on Win2000 machine in StandAlone environment. Please answer the following question:
What do you think the maximum number of sockets my server create on accepting connection. Or in other words
considering the work load as i given in above paragraph, what do you adive me about the maximum number of sockets descriptors i create on my server.
FahadAliKhan
|
|
|
|
|
Ummm... If I'm understanding the architecture of your system, you don't need to create a predefined number of sockets in your server. Just create a single listening socket and (for instance) launch a separate thread to handle each incoming connection obtained with accept . If the workload is not huge, this will work like a charm. Under more sever working conditions, you might need to have a thread pool and some stress figures could have to be taken into account, but I guess this is not the case.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I'm working with a Win32 Console "simple application", using it for testing out certain concepts, but I'm getting couple LNK2001 errors, and after checking MSDN and "Project Settings" (etc.), I still can't figure out why it's happening. Here's the error messages:
=======================
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
========================
Any help is greatly appreciated.
William
|
|
|
|
|
Possibly you'll have to select a multithreaded version of the C run-time library in your project settings.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hello..
help me plase my auto attendant project . I can not call transfered. help me plase.or sample code adress...
|
|
|
|
|
What version of the Dialogic board are you using? Are you using their own API or their TAPI drivers?
Michael
"Eureka" is Greek for "This bath is too hot"
|
|
|
|
|
We have an application using a data acq card under Win NT. I compiled in Win98 (I did not have Nt available right now but it should work). Without calls to the functions provided by the vendor, the application will work except it does not get data that is.
When I run it in NT with calls to the card using the func provided, Dr Watson gives me an exception in privileged instruction (0xc0000096), Add 0x10002b9b
What I don't understand is why. I thought it might be using an address already used by the system. I tried changing the address of the calls to the card (and change its address) but it doesn't seem to work.
Anyone has any ideas, I would highly appreciate some suggestions.
Thanks in advance.
|
|
|
|