|
Any files was modified will be rebuilt. Other files will not be compiled
There is one thing (happened to me before) you need to check the computer date and time setting is current or not. If not, the VS will build everything in the project every time you try to compile it.
modified on Friday, December 4, 2009 1:44 PM
|
|
|
|
|
My problem is not that everything in the project gets rebuilt. My problem is that everything in the WORKSPACE is being rebuilt. My main application does not depend on my two new DLLs or my test project. Nonetheless, the three new projects are being built, and I don't know why. Is it because I am using the F6 key to trigger the build, rather than right-clicking on my main project and clicking "Build"?
RobR
|
|
|
|
|
Are you modifying header files that are included in many files? Then the files that include the header must also be recompiled. You would get memory errors otherwise with MSVC++...
|
|
|
|
|
Interrobang wrote: I just downloaded code for the major application from source control, set the major application to be the startup project, and rebuilt it. The test application and the new DLLs got built along with everything else!
When you downloaded the files from source control, did any of the OBJ, EXE, or DLL files exist? If not, a rebuild would have been needed.
Consider:
CPP --[compile]--> OBJ --[link]--> DLL
or
CPP --[compile]--> OBJ --[link]--> EXE
If any file is newer than the file to its right, a rebuild will occur. The first time you pulled everything from source control, a rebuild would have been expected.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Allow me to emphasize: My problem is related to the WORKSPACE, not to the project. When a project is built, all projects it depends on will be checked first, according to the logic given in the last post. And any projects those projects depend on will be built before them. I understand all of that.
What I am seeing is files being compiled (and throwing errors) when those files are not included in the project I am building, or any projects that project depends on in any way, directly or indirectly. The files are included in the workspace that contains my target project, but they are not included in the target project. I do not understand why files not in or related to the project file are being built.
RobR
|
|
|
|
|
I have had problems like that after inconsistent timestamps. From my experience the whole process has many subtleties. For instance, if an Obj File gets Rebuilt successfully, it will not nescessarily replace the existing Obj File, if the Existing one has a later Date Stamp, and is the same, but 'May' do so, if it is different. The whole system tends to become totally confused when it finds that time mooved back.
I have seen this type of behaviour where the Source Control Time Stamps are effectively generated by the Local User's Computer.
The Good News is, that if left to it'sw own device, and, if ALL computers are synchronised, it normally resolves within a couple of weeks, all by itself.
Success.
Bram van Kampen
|
|
|
|
|
I what to draw a XOR box on a memory DIB,so:
HDC hdc = CreateCompatibleDC(0);// create a DC
HBITMAP hmap=CreateDIBSection(hdc,(BITMAPINFO*)(&bmih),DIB_RGB_COLORS,(void**)(&pBits),NULL,NULL);// create a DIB
SelectObject(hdc,hmap);// select DIB to DC
TextOut(hdc,l,t,"Test String",12);// Draw something
SetROP2(hdc,R2_XORPEN);// set mix mode
Rectangle(hdc,l,t,r,b);// draw box with xor pen,but it not work
and I also test this:
PatBlt(hdc,b,t,w,h,DSTINVERT);// it not work too
Can somebody tell me why?
|
|
|
|
|
How are you validating that it doesn't work?
|
|
|
|
|
Thank you for reply!
But I can't see result by the function SetROP2() with XOR mix mode.
I think it must not work well on a memory DC or DIB Section.
The color box I draw, covered rectangle with the pen color.
Thanks again
modified on Friday, December 4, 2009 11:42 AM
|
|
|
|
|
While it's not a complete answer for you, when debugging this sort of stuff, I cannot exagerate the usefulness of:
Image Viewer Utility[^]
It's an oldie but goldie article, regularly kept up to date by PJ Arends, an elder god of CP.
I would also look at R2_NOT for a real answer.
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Thank you reply me
I agree with you,the article is good,but I can't draw lessons from it.
I'm using GDI functions now.
Though MFC functions can resolve my doubts,but far away water can't quench thirst nearby
I think SetROP2 not work well on memory DIB DC,I have tested more time,but none successed,the box I draw just covered the map
modified on Sunday, December 6, 2009 8:03 PM
|
|
|
|
|
Iain Clarke, Warrior Programmer wrote: PJ Arends, an elder god of CP
Sometimes I really do wonder if anybody, other than me, is actually still using that app, or if it is just collecting dust on the CP servers.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
I don't use it *often*, but it's a godsend every couple of years.
I can formally express my appreciation for your efforts! And if you ever visit the scandinavian block, I might even buy you a .
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Different need makes different code,car may be faster,but bicycle is useful too,and it will not pollution of the environment,they are both existing to make sense,I think so.
Thank you for replay me.
|
|
|
|
|
Can't get the 'aha, this is the error in your code' but have some questions/remarks:
You use CreateDIBSection() but you could use CreateCompatibleBitmap() also. Did you try that?
It seems there's no pen selected in your DC..
Rozis
|
|
|
|
|
I'm sure have selected a pen,and the cover box's color is same with the pen's color.
CreateCompatibleBitmap() may be a good idea,but it seems that function is not simple to create bitmap in a memory dc.
Thanks Rozis,I'll try it later.
|
|
|
|
|
To help you with that one try something like this:
hMemDC:=CreateCompatibleDC(hdc)
hbitmap:=CreatecompatibleBitmap(hdc,w,h)
hold:=SelectObject(hMemDC,hBitmap)
...
hdc is the DC to your screen
w is width, h is height of the bitmap
And, could you try R2_NOT ??
Good luck
Rozis
|
|
|
|
|
Thank you Rozis, you are right,the code has succeed.
I have learned a lot from you, thank you!!!
|
|
|
|
|
I have an OSI model application that receives packets from datalink (via TCP sockets) examines it and send it to network layer to extract the socket information and packet type, etc. and sends to transport layer and then to application layer to send it to another application again via TCP socket for responses.
in my application when a socket goes down, I send a message from datalink to manager class that watches all 4 layers to notify the manager class for socket disconnection and manager class makes a message to send to application layer to notify it to stop receiving messages from 2nd application till the datalink socket is up again. sometimes the socket goes up and down very quickly like there is a glitch for 2-3 sec and in this case I don't want to report any socket disconnection to application layer. to summerize:
in datalink layer:
Socket 1 is down -> send socket status to manager class, Manager class should start a timer and if within 15 seconds the status of the socket remained the same, make the message for socket 1 and send it to application layer. (if the status changed to down and up within 15 seconds do not send any message to application layer)
the problem is my application is always sending and receiving messages and can't pause for a period of time.
How can I add this timer just for the socket down/up message that wouldn't trigger other application's process?
Thanks,
Chan
|
|
|
|
|
You can use a waitable timer to do this with calls like CreateWaitableTimer /SetWaitableTimer .
You can then wait on this timer using a wait function like WaitForSingleObject .
You will need to wait in a separate thread if you don't want to block your main thread.
Take a look at this sample - Using Waitable Timer Objects[^]
|
|
|
|
|
Thanks a lot, I'll see what I can do but I already have many threads and adding one more makes things very mess.
regards,
Chan
|
|
|
|
|
Sounds not like a coding problem but a design problem.
If I understood correctly... in some way you want to add a timer functionality to your application logic. There are many ways to achieve this and it depends on your current design/architecture. If your application is event based you can use timer events (e.g. WM_TIMER), if it is multi-threaded you can introduce a dedicated timer thread, if you use a 3rd party networking class it might offers some kind of timer.
In my applications I use a networking class that provides 1Hz timers and I use it for all kind of things, from timeouts to bandwidth limitations.
Hope it helps, M
|
|
|
|
|
hi friends,
i designed to get value from combobox like "com port, baudrate, party,time interval". after user selecting all parmeter and press button "connect" for example data =0x47,comport=com1, baudrate=9600,party=2 etc.. and sent to serial port then i should get 47
in the list box.
void CKeytestDlg::OpenPort( )
{
int i;
i = m_comport.GetCurSel();
m_Comm.SetCommPort(i+1);
for(i=0;i<4;i++)
if( i == m_bardrate.GetCurSel() )
{
m_bardrate.GetWindowText(baudrate);
}
if(baudrate == "2400" )
{
m_Comm.SetSettings ("2400,N,8,2");
}
if(baudrate == "4800")
{
m_Comm.SetSettings ("4800,N,8,2");
}
else
{
m_Comm.SetSettings ("9600,N,8,2");
}
m_Comm.SetInputMode (1); // Binary mode
m_Comm.SetPortOpen (TRUE); // Open it
}
void CKeytestDlg::OnButton1()
{
// TODO: Add your control notification handler code here
OpenPort();
CByteArray btArray;
BYTE bID;
bID = 0x47;
btArray.Add (bID); //Identifier byte
// btArray.Add (/*0x30);//*/bByte1); // DataByte 1
COleVariant var(btArray);
m_Comm.SetOutput(var); // Send the data.
m_Comm.SetPortOpen(FALSE);
}
plz kindly help me
|
|
|
|
|
shanmugarajaa wrote: plz kindly help me
With what?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I am making a dialog based application , i want to disable the maximize
button , when i disable the maximize button from resources check box for maximize button , gui window hides the task bar of windows , how can i disable maximize without hiding task bar .
|
|
|
|
|