This code is expected to work only when the Dialog is forcely resize by using Minimize, Maximize, Drag Size etc. To resize the control in Initial state you have to put some similiar code in the OnInitDialog of the dialog class like
In OnInitDialog you do not have to check the Window handle because OnInitDialog is called after the creation of the Dialog Box and it's control. But you should check the Validity of m_edit window in OnSize because it is called by the framework when the DialogBox alone is created, before the edit is created.
So, you mean, even though it is virtual COM port, the DCB setting should also be set properly?
The reason I asked this question is that, someone actually told me that, if you are using virtual com port, you don't need to care about those settings. The only setting concerned is the COM port number.
This may or may not be true depending on the "virtual" COM port.
Sometimes USB devices register themselves as one or more COM ports and those could be called virtual. Different devices behave differently.
I've experienced USB devices used as COM ports that are "enabled" by setting the DTR line, which requires the use of DCB.
However, all COM devices should support the use of DCB, which means that it doesn't hurt to set up things properly. It would also make the code more portable between COM devices.
What you heard regarding not having to set the DCB for virtual COM ports may be true for some specific devices, but certainly not all.
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
Recently,I am writing a smtp server ,when I test it in the internet ,
I find that it can't send local email to other remote smtp server,
for example smtp.mail.yahoo.com etc.I don't know why?
Can anyone give me some advince?
I should know pointers by now but still struggle to get code working when dealing with them..
If anyone has any recommended articles I'd be very appreciative. But, the articles dealing with pointer basics don't seem to help me... not sure why. I can understand casting ints, etc. but when it gets to more complex data types, I get confused.
A good example of a tough pointer problem for me is seen below. Not sure why/where I'm reading/changing memory I shouldn't be and I also don't know how I would be able to get the value of the TextualSid in a format usable for strcmp, printf, etc.
I am trying to implement a chat application that communicates using sockets. The problem is, when i try create a dialog when the application receive a connection request, the DoModal function doesn't works at all.
//Function called from InitDialog of a class derived from CWinThread
Would anyone help me solving this problem?
Thanks in advance
Well, i didnt't say that CDialog doesn't work with threads... it was a question.
I really didn't say it, but i'm calling connect insitde InitInstance and it is not working.
I think that i have to syncronize the calls, but i don't know how. When i call DoModal, the application will immediatly go back to were i started the thread, not allowing the dialog to be shown.
If GetItem returns NULL for any of those items at any point in time, you will get an access violation. Also, if the types don't match up (that is, if the field is a double and you are checking the int value), you will get strange results that could blow up your stack in a weird place.
Additionally, the printf statement will blow up your stack the way it is written. When you have 2 arguments in the printf string, you should only have 2 variables to match them (you have 2 in the string and 4 trying to match them).
You didn't close the recordset, so at this point, the connection is being closed. Now, when the Recordset smart pointer goes out of scope, it will attempt to close, but it will no longer have a connection. Try adding a pRecordset->Close(); call prior to the connection's close call.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
I was handed down a big windows base project at work that requires some attention. We have been experiencing some random crashes and bugs in the field. I’m working on debugging this issues but I need a little help. We have limited time to debug all issues so I was wondering if there are any commercially available tools (I’m currently looking at SOFTICE) that I could use to monitor the executable and record system parameters when the system is in the field. I need to pin point the root cause of the problems. I’m trying to get a sense of what’s going on in the field that’s causing the random behavior of the executable.
Last Visit: 31-Dec-99 18:00 Last Update: 21-Sep-23 12:54