|
Hi all!
Setting up a multi-developer Visual C++ project, which non-code files (i.e. not h- or cpp-files) would You include for source control?
Obviously, all h- and cpp-files dhould be included, but then what? There has been some debate going on at the office on whether for instance the dsp and dsw files should be configured.
A concrete example: we have suffered problems with what files/classes show up in a clients view after a sync to head following the check-in of new files/classes by another developer.
By the way, we are using Perforce. Your input will be much appreciated!
------------------------------------------------------------
"Pooollyyy!! ...Polly Parrot! Wakey-wakey!"
|
|
|
|
|
Less than a minute after posting my question I googled out the following page:
http://www.perforce.com/perforce/doc.031/manuals/p4plugins/02_visualcpp.html
Scroll down to the second last heading; "which files do I put in the depot?".
Any additional thoughts and input on the subject from You guys out there are still much appreciated!
------------------------------------------------------------
"Pooollyyy!! ...Polly Parrot! Wakey-wakey!"
|
|
|
|
|
DSP's yes, DSW's no.
If you are relying on your DSW to build the project correctly (via project dependencies), that's not a good thing. DSW's are intended for per-developer settings, DSP's for project settings.
Lets be honest, isn't it amazing how many truly stupid people you meet during the course of the day. Carry around a pad and pencil, you'll have twenty or thirty names by the end of the day - George Carlin
Awasu 2.1.1 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
its output is 47, why?
#include "stdafx.h"
#include <iostream.h>
class base
{
int i;
public:
base(base&){}
base(int I=0):i(I){}
virtual int sum(){return i;}
};
class derived:public base
{
int j;
public:
derived(derived&){}
derived(int I=0, int J=0):base(I),j(J){}
int sum(){return base::sum()+j;}
};
void call(base b)
{
cout<
|
|
|
|
|
ur base class callz both the constructorz(when u mention one parameter)(i mean it callz the base(base&)thatz why.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
Hello,
You wonder why the output is the same as the value j from your d
Well the problem is this: You have a very huge error in your classes that messes up the stack pretty badly.
Let me elaborate.
You have 2 errors: first your copy constructors, second your function call.
The first error is that your copy constructors do not return a class object. This alone doesn't cause the bug alone.
The second error is that your functions call accepts a non reference object argument. This isn't a direct error (sometimes even no error), but in your program it is. This is because it takes more time to pass an object and most of the time, you don't want you object to be copied like that.
These two errors lead to the following: when call() is invoked, the copy constructor of b is invoked. This constructor does not create a object and therefore the stack gets messed up. In the function call the variable b points to the wrong object on the stack (which is d ).
You can easy test this behaviour by changing the value of d.j , by removing the empty copy constructor or by passing b as a reference to call() .
Hope this helps you to understand the problem.
I also got the blogging virus..[^]
|
|
|
|
|
It's because call() takes the paramater by value and not by reference. Because you've declared it to take the parameter by value, the passed object gets *sliced*. So even if you pass an instance of derived, it gets sliced and only the base part of the objects is passed to call. The sum function call then executes on the sliced base instance and so you get 47 and not 57
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi All,
I am using MS FlexGrid with VC++ 6.0(MFC).
How to merge 4 adjacent cells( they form a square) to a single one in the flexgrid.
All the 4-cells contain the same text or picture.
TIA,
Regards,
Jahfer V P
|
|
|
|
|
i have some problem in designing the multithreaded tcp server using CAsyncSocket class.the problem is my server can accept only one connection at a time,even though i have used AfxBeginThread logic.so how can i make my server to aceept multiple clients.please help me.i dont want console program.i am using MFC.
|
|
|
|
|
You don't need a multithreaded app to handle multiple connections!
CAsyncSocket has overrideable notification functions, e.g. OnAccept, which informs the app about an incoming connection.
The whole notification works via windows messages (WSAAsyncSelect), so you only need one single thread for the message loop (which is done by MFC) and you will be able to handle many connections.
Using multithreading just makes sense when the CAsyncSocket::OnReceive has to do operations that take much time because it would block the message loop.
Don't try it, just do it!
|
|
|
|
|
I Have been doing things similar to this for ages but all of a sudden it doesn't seem to work.
I am testing the contents of a CEdit control on the EN_CHANGE message and then ebabling/disabling the OK button depending on the result. the only trouble is that the EN_CHANGE message seems to trigger before the InitDialog routine and therefore doesn't recognize and of the controls i have set up in the InitDialog.
What am I doing, or what can i do?
|
|
|
|
|
could you give us a piece of code about what you are doing ?
i.e, how you declare your CEdit, how you initializes it (in the constructor on OnInitDialog() ), how you use it then...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
(aaah.....i didnt quite follow ur question(i am assuming that u need to verfiy the string entered before enabling a button!!!!!).....
the EN_CHANGE message is called whenever there is a change in the Edit control.....but i beleive u want the final data.....but the en_change only tellz u only when there is a change in the data....and gives u no clue if the data entered is over!!!!!(as u dont have a button that updatez the dadta in the edit control).....so herez what u can do(assuming that u press enter key once u have made the changez in the Edit control.....override the function PreTranslateMessage().....
BOOL CXyzDlg::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message==WM_KEYDOWN)
{
if(pMsg->wParam==VK_RETURN)
pMsg->wParam=VK_TAB;
}
return CDialog::PreTranslateMessage(pMsg);
}
so what we have done here is that,we have made the edit control to loose focus when the enter key is pressed(actually the tab key does that,but we have changed it using the above code)(u can give any key u ant to i just stuck with the enter key).....
now add thiz code to the messahe that is passed when the control is lost ( EN_KILLFOCUS).....
void CXyzDlg::OnKillfocusEdit0()
{
UpdateData(TRUE);
}
by doing thiz we get the final output on th edit control .....hope thiz helpz.....
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
When you call SetWindowText() from within OnInitDialog() , an EN_CHANGE notification will eventually get generated. What you simply need to do is differentiate between the control's contents changing during initialization vs. the user changing it. The simplest way is to add a m_bInitialized variable to the dialog. Set the variable to false in the dialog's constructor, and then set it to true at the very end of OnInitDialog() . Now in each of the EN_CHANGE handlers, only alter the OK button if m_bInitialized is true. Make sense?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
DavidCrow wrote:
When you call SetWindowText() from within OnInitDialog(), an EN_CHANGE notification will eventually get generated.
I thought EN_CHANGE notifications are only sent in response to a user (vs. programmatic) action that changes the contents of an edit control.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
I thought EN_CHANGE notifications are only sent in response to a user (vs. programmatic) action that changes the contents of an edit control.
But now you know otherwise.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello,
I am working with MS FlexGrid and VC++ 6.0(MFC). I need to load a picture(bmp) to the cell of the flexgrid.
How can I do this?
TIA,
Regards,
Jahfer V P
|
|
|
|
|
|
Dear Suhredayan,
Thank You for your great help.
The sample you pointed out helped me to reach the destination.
Here is the way that I implemented it. It is very simple.
/******************************/
CPictureHolder picHdr;
picHdr.CreateFromBitmap(IDB_BITMAP1);
m_FlexGrid.SetCol(2);
m_FlexGrid.SetRow(1);
m_FlexGrid.SetRefCellPicture(picHdr.GetPictureDispatch());
/******************************/
Thanks & Regards,
Jahfer V P
|
|
|
|
|
|
Thats all, i need to get the line index where the cursor is placed in a CRchEditCtrl.
Thanks
|
|
|
|
|
check for EM_EXLINEFROMCHAR message in msdn.
suhredayan There is no spoon.
|
|
|
|
|
hi all
i used API function hWndApp=FindWindowEx(0,0,"Notepad",0),and then i want to send WM_MBUTTONDBLCLK message to hWndApp but it didn't work as i think...
i send WM_MBUTTONDBLCLK message to hWndApp,and then send WM_COPY message to hWndApp so that i want to copy word what is highlighted (when call WM_MBUTTONDBLCLK message) to Clipboard (so call WM_COPY message)>>>but i didn't know how to code correctly///
please help me...
thanks...
Here we go!!!
|
|
|
|
|
|
i have read your code>>>that's very useful>>>and thank you so much
but 1 more question for you///please
after enumming all childwindows of mainwindows that can get HWND easily>>>but how to get HWND of edit childwindows that always are used in a typing program.Because we really don't know contents of edit childwindows if we use GetWindowText() in EnumChildProc() function to get HWND hic hic///
i really understand all that you code...
thanks...waiting for you hic hic
Here we go!!!
|
|
|
|