|
I am looking at a bug in a project I working on, which uses lots of dialogs attached to a tab control. All dialog classes a derived from one of two class in a framework for the the system. In just one the message map is not trapping the set focus message for a reason that is not obvious. It is very strange because out of some 200 tabs only one is giving trouble.
I thing I have checked all the obvious things - any other sugestions would be welcome.
Happy programming!!
|
|
|
|
|
hi,
I need help with this:
I made a dialog box, and in this dialog box there is a Rich edit field. Now, when I press 'enter' the dialog box closes. I've tried everything I could think of to stop it from doing that.I want it to just add a return in the rich edit field.
Can somebody help me with this?
|
|
|
|
|
The <return> key is mapped to the OK button, and the <escape> key to the Cancel. You may be able to change this by making your rich edit the default control, but I suspect you will need to over-ride OnOK, and in it check if the return key is down ( GetKeyState(VK_RETURN) from memory ) and, if so, return - that is, don't call CDialog::OnOK();.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Set the "want return" style for the edit control, then it'll do what you want.
--Mike--
http://home.inreach.com/mdunn/
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
-- Buffy
|
|
|
|
|
I agree with Michael and Erik, you need to find a better approach. You should consider using a grid control, or the listview control. It will make your life quite a bit easier.
D
|
|
|
|
|
If you're using that many checkboxes, there's something else wrong with your app. It won't run well under Windows 9x, since Win9x has much more limited resource pools for window handles (of which a control has).
Re-think your design. There has to be a better way to do this. If I were one of your users, I'd shoot myself (or you) if I had to use such an interface.
|
|
|
|
|
Egads. Well, if you really need that many checkboxes, use a CCheckListBox instead. Or a CListCtrl with the checkboxes style.
|
|
|
|
|
Hi All,
I have a small problem achieving something with a CRichEditCtrl (MFC). Basically the problem is that i would like to determine the height (in pixels) of the text contained within the control.
For example, setting the height of the control to this value would result in the text fitting perfectly within the control. (i am only interested in the vertical direction)
The control can contain varying sizes and fonts of text within it, as well as multiple lines.
I hope one of you has a clue on how to accomplish this.
Any suggestions would be most appreciated.
~Alex
|
|
|
|
|
yes thats right, i figured it out for myself
thanks anyways...
|
|
|
|
|
Hi how can i get the PID of a task, if i now the window-name?
I use FindWindow and become a CWnd* . How can I now get the PID of this Window?
Thank you
C U
|
|
|
|
|
Try something like:
::GetWindowThreadProcessId(theCWnd->m_hWnd, &dwProcessID);
|
|
|
|
|
When I write the server/client application with Winsock
using "CreateIoCompletionPort", in loop of "GetQueuedCompletionStatus" to check the sock communication, if clientside disconnect by call "closesock",
how to check or response in server side "GetQueuedCompletionStatus" code? If client call
"shutdown", how to check it in server "GetQueuedCompletionStatus"?
Can somebody give help and show some sample code?
Thanks a lots
|
|
|
|
|
I can't remeber but I'm sure i read somewhere that if the byt4es transferred were zero the client has called close scoket - in our code we have the following
BOOL bRet = GetQueuedCompletionStatus(_hIOCompletionPort, &dwBytesTransfered, &dwCompletionKey, &pOverlapped, INFINITE);
// If an error occured ensure that we flag the socket as closed so that the cleansweep thread destroys any
// system resources associated with the thread; If we receive zero bytes in length the socket is being closed
// on the client side - as we don't care for data loss (caused by a shutdown?)
if( !bRet || !pOverlapped || dwBytesTransfered == 0 ) {
pSocketInfo->State = SocketInfo::SocketState::Closed;
continue;
}
|
|
|
|
|
Having looked on MSDN at:
http://support.microsoft.com/support/kb/articles/Q105/6/75.asp
and
http://support.microsoft.com/support/kb/articles/Q250/5/63.ASP
I am still no clearer as to how I can disable the first-chance exception notifications in the Output Window of VC6. The articles above talk about the 'Encompass Monitor' service, but this is not running on my NT4 SP6 machine and neither encmonitor.exe or monitor.exe are present on my hard drive.
I noticed that neither of these articles specify NT4 in their 'information is this article applies to...' header.
I use a third-party ActiveX control that causes first-chance exceptions like no tomorrow and I would dearly like to prevent these from appearing in my output window.
Can someone please assist as it's driving me up the wall.
Thankyou
Mark Jones
Software Engineer
Hampshire
UK
|
|
|
|
|
How is it possible to retrieve the exact version
of the platform a program is running on?
Cheers.
--
Maxime Labelle
mailto:maxime.labelle@freesurf.fr
|
|
|
|
|
Maxime
Try this code:
OSVERSIONINFOEX osvi;
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
if( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi)) )
{
// If OSVERSIONINFOEX doesn't work, try OSVERSIONINFO.
osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
if (! GetVersionEx ( (OSVERSIONINFO *) &osvi) )
return UnSupported;
}
|
|
|
|
|
OSVERSIONINFOEX only works on Win 2K. If all you care about is the major/minor version, there's no need for an OSVERSIONINFOEX. The original OSVERSIONINFO will work fine.
--Mike--
http://home.inreach.com/mdunn/
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
-- Buffy
|
|
|
|
|
Hi,
I am new to developing a debugger......At present i am more interested in developing a GUI for my debugger, i want this similar to the VC++ debugger. In VC++ IDE, we see a red circle when a breakpoint is set, howz is this done? Drawing a circle in the View? If itz drawing then how can we do this in a CRichEditView or a simple CView??
Howz VC++ making the entire first column of its Editor in a different color??
If anyone has ideas, please reply.
Thanks & Regards,
Aruna.
|
|
|
|
|
Create a view window, then create a EDIT control child window for the program text at offset (16,16) in the client area.
Now you have 16 pixel area on the top and left to draw anything you want.
That's just a simple solution, you should implement your own EDIT control replacement to display program with keywords color.
For a debugger, read John Robbins' book.
|
|
|
|
|
I'm developing some extract tools, and i need the DLLs of Winzip, Winrar, CAB etc.
At the best, it includes ZIP, UNZIP, PASSWORD handling,
Multi Volumes etc.
Do you think you can help me? Thank you!
|
|
|
|
|
Hi,
I am trying to build a NT Service that uses CFileFind class in the main loop.
The service is working right, but the CFileFind ins't.
I wrote as below:
CFileFind finder;
finder.FindFile("\\\\MYSERVER\\D$\\SOMEDIR\\*.*");
It should work, but It doesn't.
I noticed that if I don't use UNC, like below, the function works fine.
CFileFind finder;
finder.FindFile("D:\\SOMEDIR\\*.*");
My problem is I'm not working locally. I need to find the files in another server on the network.
If I map a letter to access the other server, it also doesn't work.
I wrote a dialog based app in order to test the CFileFind class, and I worked very well, so I think the problem is the service.
Does anybody have some idea on how to solve it?
Thanks in advance,
Vinicius
|
|
|
|
|
You need to have your service log in to \\myserver first. The reason it's working with a dialog app is the app is running as you, and you are (I assume) logged in to that server and/or have a drive mapped to it.
If you need it working in a pinch, change the service to run as you.
--Mike--
http://home.inreach.com/mdunn/
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
-- Buffy
|
|
|
|
|
Thanks for your posting.
I understood what you sad, however, I am running locally. MYSERVER is the machine that I am testing the service and D is its shared folder.
Any way, could you tell me how to make the service log on to another server?
I am not an expert in NT Services, I am just trying to solve a problem in the company I work.
Thanks,
Vinícius
|
|
|
|
|
Hi,
Your problem is that a service, by default, is logging on as "System", that account does not have access to other machines.
When you run a dialog based app, the app. connects to the server with your username/password, where the service uses the "Local System Username/Password".
You need set a username that the service uses to log on to the system, when you try to access services across a network. You can do that in ControlPanel/services under NT4, or in the "Computer Management" MMC Console under Win2k.
- Anders
|
|
|
|
|