|
What i do is have a bin directory where a copy all exe's lib's and dll's get copied when they are created. I also separate my binaries, from my build files, from my source files ... after much trial and error i have found this the most flexible setup.
For the common dll's or static lib's :
e:\lib32\bin\lib\[Release & Debug] - bin\lib gets copy of all static .lib
e:\lib32\bin\dll\[Release & Debug] - bin\dll gets copy of all .dll & .lib files
e:\lib32\bld\mod_1\dll - mod_1 being compiled as a dll, creates .dll & .lib
e:\lib32\bld\mod_1\lib - mod_1 being compiled as a static lib, creates .lib
e:\lib32\src\mod_1 - source for mod_1, #pragma's take care of lib/dll build diffs
As mentioned in previous post i then add e:\lib32\src to Tools-Options-Directories-Include Files and then use #include <mod_1/...> syntax.
I then add e:\lib32\bin\dll\Debug to my system PATH.
You could probably use it for Project-Settings-Debug-Working Directory instead.
Or maybe, Tools-Options-Directories-Executable Files.
For the project specific exe's dll's and static lib's :
e:\prj\prj_1\bin\[Release & Debug] - bin gets copy of all prj_1 .dll, .lib, .exe files
e:\prj\prj_1\bld\mod_2\dll
e:\prj\prj_1\bld\mod_2\lib
e:\prj\prj_1\bld\exe_1
e:\prj\prj_1\src\mod_2
e:\prj\prj_1\src\exe_1
Although it makes more sense to use e:\prj\src\prj_1, i wanted all project files together - up to you.
As for the common libraries, i have added e:\prj\prj_1\src to Tools-Options-Directories-Include Files and then use #include <exe_1/...> syntax.
Now becuase e:\lib32\bin\dll\Debug is in the path i can go into e:\prj\prj_1\bin\Debug and run my program and it finds both project specific dll's (with exe) and common dll's (through PATH).
For my common dll's or lib's i add to Project-Settings-Post-build Step (last page) the following for All Configurations :
copy .\$(OutDir)\$(TargetName).dll ..\..\..\bin\dll\$(OutDir)
copy .\$(OutDir)\$(TargetName).lib ..\..\..\bin\dll\$(OutDir)
or,
copy .\$(OutDir)\$(TargetName).lib ..\..\..\bin\lib\$(OutDir)
For my project specific exe/dll/lib settings it's similar.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
that was a great explanation, thank you very much! now i think i get away with this stuff
|
|
|
|
|
Well I've read several articles about timers and I still don't quite get how to use them. What I'm trying to do is hide(<-I can do this part) a dialog box for X minutes(<-I can't do this part). I don't understand what I need to do to get it to work. Thank you to any who helps and to those who have helped.
|
|
|
|
|
while using the timers after the particular time (ie in millisecends specifed in the triggering function ) Timer Function will be triggered.
In the OnInitDialog() function add the following ,
OnInitDialog()
{
CDialog::OnInitDialog();
.........
SetTimer(1000,5000,NULL);
ShowWindow(SW_HIDE);
return TRUE;
}
Implement the WM_TIMER using classWizard and add the following code
OnTimer(...)
{
ShowWindow(SW_SHOW);
KillTimer(1000); // 1000 is the Timer ID given in the SetTimer function
}
Here the OnTimer will be called after 5 seconds.
|
|
|
|
|
Hi Friends,
I want to know how to stretch the Icons like we do for the BItmap by using StretchBlt(...) function in MFC. and I also want to know how to Display the mouse cursor. and stretch the mouse cursor.
Salman
Live and Let live
|
|
|
|
|
For icons you can use ::DrawIconEx()
Roger Allen - Sonork 100.10016
Strong Sad:
Clever I am? Next to no one.
Undiscovered and soggy.
Look up. Look down. They're around.
Probably laughing. Still, bright, watery.
Listed among the top. Ten.
Nine. Late night. Early morn.
Early mourn. Now I sleep.
|
|
|
|
|
The DrawIcon(Ex) functions can also be used to draw cursors. If you want to stretch/scale them, then I recommend that you create a Memory DC, draw the icon/cursor onto the memdc, get the bitmap from the memdc and use StretchBlt to scale it onto the real DC.
onwards and upwards...
|
|
|
|
|
please have a look at my programm below:
BOOL CMy06aDialog::OnInitDialog()
{
CBrush m_redBrush(RGB(255,0,0));
CBrush m_yellowBrush(RGB(255,255,0));
.........
}
HBRUSH CMy06aDialog::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{ if(nCtlColor==CTLCOLOR_DLG )
{pDC->SetBkColor(RGB(255,0,0));
return m_redBrush;
}
if(nCtlColor==CTLCOLOR_EDIT)
{pDC->SetBkColor(RGB(255,255,0));
return m_yellowBrush;
}
return CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
}
but the result is :only the edit control ,their background color is yellw as i expected,but dialog background color is still gray,why?
|
|
|
|
|
Try it this way:
HBRUSH CMy06aDialog::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if(nCtlColor==CTLCOLOR_DLG )
hbr = m_redBrush;
if(nCtlColor==CTLCOLOR_EDIT)
hbr = m_yellowBrush;
return hbr;
}
Steve
|
|
|
|
|
hi:Steve,thank you,i try first according your advice,but dialog control have no color as i set
|
|
|
|
|
Hi,
Good morning, everyone here
I meet a trbouble, a client quited withour sending message to my server, when checking the connection, I remove the socket from the list and delete the memory, but here the trouble appered, the server quited immediately. I know it is because the delete operation, but i have no idea what should I do?
Any advice is appreciated ,
thank you!
|
|
|
|
|
is your serveur mono-client?
don't understand well where's your probleme...
TOXCCT >>> GEII power
|
|
|
|
|
My server is muti-client.
problem: When a client quits without notifying the server, now server fails to send message to client and fails to delete the socket too.
Thank you!
|
|
|
|
|
do you check errors ?
send() and recv() return -1 if they coould not have sent what they had to...
recv() also return 0 if the other side of the connection has closed the connection.
normally, you might be crash-free...!
TOXCCT >>> GEII power
|
|
|
|
|
I want to put together a small program which will go
to a server can check to see if an update exists and
if so, to go get that update and replace the current
file.
I can do a WebGrab and get txt information, but I
don't know how to get the executable file from the
server and make it replace the current file. By chance,
does a sample project exist somewhere that shows how
to do this online update?
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
I'm certainly no expert, but it may be simpler to download a DLL, which you can then load dynamically and retrieve the addresses for your components from. Have a look at the documentation for:
FreeLibrary
LoadLibrary
GetProcAddress
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
If I've a CListBox derived class (say CListBoxEx ) that handles its own custom drawing messages, i.e. WM_MEASUREITEM and WM_DRAWITEM , is it possible for me to change the parent window of this window (using SetParent ) without the fear of not receiving the above specified messages? Actually, I need to change the parent window more than once.
I'm using VC++ 6.0 SP5 and MFC
Thanks in advance
Gurmeet S. Kochar If you believe in God, it's because of the Devil
My CodeProject Articles: HTML Reader C++ Class Library, Numeric Edit Control
|
|
|
|
|
I can only think that it may be possible to attach to a hidden window as a parent and therefore not get these messages. Though I am not 100% sure on this.
Ant.
|
|
|
|
|
How can i design application, can toggle like vc dialog?
|
|
|
|
|
I doubt anyone who reads this will have any idea what you mean. Do you mean a dialog box that has a section that can be shown or hidden ? The trick is just to use ::SetWindowPos to resize the dialog to hide/show the section you want to toggle, and set the text on the button you use to reflect the current state. If that's not what you mean, try to explain a bit better.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Like christian said. i am confused..
Which VC dialog ??
|
|
|
|
|
I was design a typeset software, so i want my user can auto change layout like "vc dialog layout"
|
|
|
|
|
Hello,
Does anyone knows how to interpret Standard Test Data Format(STDF) file using VC++ program?
Thanks,
Mar
Mar Solero Jr.
|
|
|
|
|
Sorry about a non MFC question, but I thought we should have some good C++ Programmers here.
I have a base class and a inherited class.
class base<br />
{<br />
base()<br />
Initialise();<br />
};<br />
class derived : public base<br />
{<br />
derived();<br />
Initialise();<br />
}<br />
base *root;
Within my view class I want to initialise root as either the base or derived class. I do this with the following code.
switch(version)<br />
{<br />
case 0 : root = new base; break;<br />
case 1 : root = new derived; break;<br />
}<br />
root->Initialise();
This howerver always calls base::Initialise instead of the derived even for case 1.
What can I do to call derived::Initialise ?
Of course I could create a pointer to derived and typecast chamber_root, but I dont want to do that. Also I could derive another class from base and use that instead of base.
---
|
|
|
|
|
Coremn wrote:
What can I do to call derived::Initialise
Declare Initialise() as virtual in the base class:
virtual Initialise(); BTW, it's always a good idea to specify a return type for the method, even if it returns nothing. Not specifying it is non-portable and susceptible for misinterpretation by others.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|