|
The first thing to check is that all you modules use same CRT model (lets say /MDd) "Project settings->C/C++->Code Generation->Runtime Library" page.
The second is to debug. When stack gets corrupted it is easy to see in debug right the way (assuming you know the approximate location.
|
|
|
|
|
|
Tell me please, how can i read mail from Yahoo's (or from the same web mail systems) by my own desktop application (without direct loggin-ing into the WEB-page)?
Thank You !
regards.
|
|
|
|
|
What will happen if the following case happen:
I started an timer-driven event like this, if A_long_call() can't return within TIMESLICE==1 millisecond, what will happen? The following is what I understand, is it correct?
*** below is My understanding*****
Time axis(in millisecond):
1--------------2------------3-------------4-----------5----------
controller()_______ controller()________
***above is My understanding****
timeSetEvent(TIMESLICE, wTimerRes, (LPTIMECALLBACK) TimerFunc, 0, TIME_PERIODIC);
//here is the functions
void CALLBACK TimerFunc(UINT timer_id, UINT msg, DWORD dwUser, DWORD dw1, DWORD dw2)
{
if (timer_id == 0)
return;
controller();
}
controller()
{
A_long_call();
}
|
|
|
|
|
What will happen if the following case happen:
I started an timer-driven event like this, if A_long_call() can't return within TIMESLICE==1 millisecond, what will happen? The following is what I understand, is it correct?
*** below is My understanding*****
Time axis(in millisecond):
1--------------2------------3-------------4-----------5----------
controller()_______ controller()________
***above is My understanding****
timeSetEvent(TIMESLICE, wTimerRes, (LPTIMECALLBACK) TimerFunc, 0, TIME_PERIODIC);
//here is the functions
void CALLBACK TimerFunc(UINT timer_id, UINT msg, DWORD dwUser, DWORD dw1, DWORD dw2)
{
if (timer_id == 0)
return;
controller();
}
controller()
{
A_long_call();
}
|
|
|
|
|
Hello i am wondering about the following things because i'd like to get an idea about a source code is related to the final EXE
Let's say we have a class (i am working with VC7, assuming no optimizations at all)
class CMyDlg : public CDialog
{
// Construction
public:
CMyDlg(CWnd* pParent = NULL); // standard constructor
... // data
int d1, d2, d3;
CString s1, s2, s3;
...
... //methods
void method1 (int v1);
void method2 (int v2);
...
};
// Implementation for the CMyDlg Class
...
CMyDlg::CMyDlg(CWnd* pParent /* = NULL*/)
: CDialog(CMyDlg::IDD, pParent)
{
d1=100;
d2=200;
d3=300;
s1="default";
s2="";
s3="hello";
}
void CMyDlg::method1( int v1)
{
// do something
...
}
void CMyDlg::method2( int v2)
{
// do something
...
}
well, imagine to compile and get the EXE.
Some questions:
1) If, for refactoring purposes i decide to rename the class into something like CMyOtherDlg, and leave everything else unchanged (data and methods), the resulting compiled code inside the EXE will be exactly the same?
2) What about changing also the members and methods names?
3) If i change (just for example) the declaration order and/or the inizialization order for the variables, will this 'matter' something or will have completely no influence on the final EXE?
4) Do the names used inside the source code mean 'something special' in the final EXE? Why, for example, if i examine the resulting EXE code, with an HEX editor i am able to find some MFC or API functions names and not the names of my functions/classes (at least it seems so to me)?
Any info about the above will be greatly appreciated, as well as any web links helpful to understand (even from a general point of view, let's say an overview) about how the VC compiler 'translates' the source code, links it and finally produces the EXE.
thanks in advance!
best regards
|
|
|
|
|
1) In release mode, seems the name does not appear in the final .EXE.
2) Same answer
3) It affects the layout of the objects, and hence the final .EXE.
4) This is due to the fact that those names are used to dynamically link the appropriate methods at startup.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
1) No, there generally shouldn't be any change to the exe (if you build in debug mode then you may see a few name changes, but thats all)
2) Same as above. The names of classes and functions are just symbolic - they all get stripped out when compiled (also again dependant on debug/release)
3) It can matter, depending on the byte alignment. For example, if you have:
char m_MyChar;
int m_MyInt;
char m_MyChar2;
And
int m_MyInt;
char m_MyChar;
char m_MyChar2;
The second version will be slightly more space efficient. The first m_MyChar will be byte aligned and so take up 4/8 bytes (I cant remember the exact value), of which only 1 byte is used. Then the int, then a 4/8 byte for the second char. Total is 12 (using 4 byte align, and 4 byte int). The second has 4 bytes for the int, and 2 bytes for the char... aligned as 4 bytes, so total is 8
|
|
|
|
|
to 3)
Another thing: If you try to save this class by serialisation the order will also be changed, so the files produced by the different .exe would be different.
|
|
|
|
|
Hy everybody!
I Have an CRichEditCtrl, and I'm using CHARFORMAT to add String s on it. Whem I run the program in Win2K, no problems, the SetSelectionCharFormat works fine, but when I run over Win9x the RichEdit doesn't work good.
I need some help folks
thanks all for your attention!
cheers!
Ricky
|
|
|
|
|
for 95 watch for "Requires Rich Edit 2.0 or later on Windows 95" in MSDN
|
|
|
|
|
Anyone knows how to calculate or retrieve the "Commit Peak" value as shown in the TaskManager?
On WindowsXP I can get the value with GetPerformanceInfo() but what about W2k and NT4 ??
Holy Sh*t! I'm speechless. (hey, that's a first) Marc Clifton, The Lounge
|
|
|
|
|
hello,
I would like detect when the key "Ctrl" is down and show a dialog box at this time, and hide the dialog box when the key is up.
You know how can i do this?
Thx
|
|
|
|
|
Without knowing the specifics of your environment, here's what you basically need to do:
Handle the WM_KEYDOWN and WM_KEYUP messages and check for the VK_CONTROL character. Create the dialog box modelessly.
Regards,
Alvaro
All you need in this life is ignorance and confidence, and then success is sure. -- Mark Twain
|
|
|
|
|
My MFC project has this:
void CSTrainView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
ResizeParentToFit();
}
But it doesnt indicate where I should add my code: Before or after the call to the base class. How do I decide? How crucial is its position?
Appreciate your help,
ns
|
|
|
|
|
i think you can write your code after this code
|
|
|
|
|
Well if you want the default thing to happen before your code,
add it at the end. If you want your code to be first, add it at the start.
Usually just adding it to the end is fine
|
|
|
|
|
The approach I usually take to decipher these issues is to debug it. In other words, you don't have a clue what these two lines do or whether they should be called before or after your code, so before you do anything, run your program in the debugger and step into the code to see what's happening. This will (hopefully) shed light on the issue.
Regards,
Alvaro
All you need in this life is ignorance and confidence, and then success is sure. -- Mark Twain
|
|
|
|
|
Good ide about stepping in....thanks.
Appreciate your help,
ns
|
|
|
|
|
You can also look at the MFC source code, which has got to be better than spending time in the debugger.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Huh? Reading through dozens of MFC source files full of..., well, all kinds of stuff, is better than debugging the code and stepping into just the functions that he's not sure about?
Regards,
Alvaro
All you need in this life is ignorance and confidence, and then success is sure. -- Mark Twain
|
|
|
|
|
I meant I think it would be quicker to look at the source for CFormView::OnInitialUpdate() and its base classes versions than deciphering what is going on in the debugger. That's what I would do, at least to begin with.
In ED (see sig) I have all of the VC++ CRT and MFC source code included as a project in my workspace, so a simple right click on a function, gets me to the relevant source code, instantly.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
hi everyone,
I'm sending a buffer of data between two programs using sockets and the error i get is:
"A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram into was smaller than the datagram itself"
I have verified that the latter is not true, so is there any way of increasing the internal message buffer? If not can anyone recommend something?
Thanks alot
|
|
|
|
|
You can also split your buffer and send them step by step.
A. Riazi
|
|
|
|
|
Hi,
If u are using TCP connection the size is limited to 1480 bytes and similarly UDP buff size is fixed (don't remember exactly). So, it is always better to split buffer and send them.
|
|
|
|