|
Chris, I know you are really busy, did you consider offshoring this effort?
Sorry couldn't resist.
led mike
|
|
|
|
|
|
Trollslayer wrote: MVPD (Most Valued Prima Donna)?
Maxwell Chen
|
|
|
|
|
The problem is there's only a limited number they can take.
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
Did you perhaps mean VAIN -- Most Vain Prima Dona
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
I am working on a school project to find the volume of a wine goblet. Does anyone have c++ code for solids of revolution such as rotation of a curve around an axis? Something basic like a sin wave? I can then work on altering the code to find the rotated volume of my wine goblet.
Thanks in advance.
John
|
|
|
|
|
You can do this with a variant of integration. I remember doing it at uni but I forget the details. The idea is similar to integration where you find the area under a curve by subdividing it into n rectangles and adding the area of each then find the limit as n approaches infinity. With the volume of rotation of a 2D curve around the x-axis (which produces a 3D solid) you use a similar process except instead of rectangles you use discs (like coins) with the height of the curve at a given point being the radius and the thickness being the length of the interval divided by n.
Steve
|
|
|
|
|
I'm trying to add a custom build step to my project. I want to xcopy a directory structure to my output directory
e.g. something like
xcopy $(ProjectDir)\foo $(ProjectDir)\$(Outdir)\foo
It works, but it copies it on every build. I only want it copied if something under foo has changed (new file added, file changed, etc...).
Actually, I wouldn't really mind having it copied on every build, except that whenever I try to run my app from vc++, it complains that the project is out of date and asks me to rebuild.
The custom build step forces me to specify an output file, so it can check the timestamp to see if it needs to be updated - not really sure what to put here, since I'm copying a whole directory structure. I tried a few different things, but it made no difference.
Anyone know an easy way to do this?
|
|
|
|
|
If you use batch commands you can do what you want to do.
/M of "xcopy" copies only files with the archive attribute set, and turns off the archive attribute.
/A of "xcopy" copies only files with the archive attribute set, and doesn't change the attribute
You can set the archive attribute using "attrib".
-- modified at 23:23 Thursday 4th May, 2006
|
|
|
|
|
Thanks George... I got the copying working alright now. What I needed was the /D option (copies files where the src version is newer than the destination version).
However, I still have the problem that VC++ thinks my project is out of date each time I run my program... it only happens for the Debug configuration (whose Custom Build Step is identical to the Release configuration).
I have:
Command Line
xcopy /S /Y /I /D "$(ProjectDir)Template" "$(ProjectDir)$(Outdir)\Template"
Outputs:
"$(ProjectDir)$(Outdir)\Template"
What can I do to make it so that VC++ doesn't think my project is out of date?
|
|
|
|
|
I used the Build Events of the Project and only copied files that don't normally get copied:
XCOPY /D/Y "$(ProjectDir)Test.x*" "$(TargetDir)" && XCOPY /D/Y "$(ProjectDir)Test.txt" "$(TargetDir)"
There is no Outputs property by the way.
|
|
|
|
|
|
I'm trying to get information from a dialog box and writie it to a binary file. I can use the following code:
m_txtAirplane.GetWindowText(s);<br />
strcpy(airplane[15], (LPCTSTR)s);
This works fine when I'm using non-Unicode character set, but I loose the "look and feel" of Windows XP on my dialogs.
Is there a way of getting the CString, from a CEdit box, into a char array when I'm using a Unicode character set so that I can preserve the look of Windows XP?
Thanks.
|
|
|
|
|
masnu wrote: strcpy(airplane[15], (LPCTSTR)s);
You might want to look here[^]
led mike
|
|
|
|
|
For me the easiest way to convert Unicode character sets to ANSI is to use the ATL conversion macro W2A.
<br />
USES_CONVERSION;<br />
char* pszchar = W2A(strText);<br />
btw, What do you mean by the look and feel of Windows XP?
I Dream of Absolute Zero
|
|
|
|
|
Use WideCharToMultiByte for conversion from UNICODE to multibyte.
Regards
Amar.
|
|
|
|
|
I am writing an C# plugin which contains a subclassed CTreeCtrl( in c++ ).
I wrote my own OnKeyDown() function and I'm having a strange (may be
normal?) behavior: VK_UP, VK_DOWN, VK_LEFT and VK_RIGHT keys do not
enter this function, though other virtual keys do. I checked it out with
Spy++ and WM_KEYDOWN messages **are** being sent to my control''s window
for every VK. The problem is I wish my control to be navigated with keys
(as in Explorer, you now), and somewhat I'm loosing it... I don't know
where or how to catch those keys. Any clues?
NG
|
|
|
|
|
this is a bit off topic in this forum... but i was unable to find a better place, so...
i am planning to rewrite my entire C kernel into C++ kernel. i'll be using g++. What basic runtime support will i need? can i use the STL safely? What about exceptions and other advanced features?
[please forgive me. i know this topic does not belong in here. but u all are c++ gurus, so u know the c++ language better, that is why i am asjing here.]
|
|
|
|
|
Since you had written your kernel in C, you should have known the answer to your question.
Maxwell Chen
|
|
|
|
|
Hi,
I have written a CEdit derived control for displaying formatted float values. Now I want to implement a handler for WM_COPY and WM_PASTE.
The WM_COPY handler for e.g. must copy the unformatted(!) float value to the clipboard.
I have tried something like
BEGIN_MESSAGE_MAP(CMyNumberEdit, CEdit)
ON_MESSAGE(WM_COPY, OnCopy)
END_MESSAGE_MAP()
...
but OnCopy is never called.
Can anyone help me?
THX
|
|
|
|
|
madmax0001 wrote: ON_MESSAGE(WM_COPY, OnCopy)
Try:
ON_COMMAND(WM_COPY, OnCopy)
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
Hi,
I've tried but it is also never called.
|
|
|
|
|
Something else must be up. I used the following and both methods get called:
BEGIN_MESSAGE_MAP(CEditEx, CEdit)
ON_MESSAGE(WM_COPY, OnCopy)
END_MESSAGE_MAP()
...
LRESULT CEditEx::OnCopy( WPARAM wParam, LPARAM lParam )
{
return 0;
}
...
LRESULT CEditEx::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if (WM_COPY == message)
;
return CEdit::WindowProc(message, wParam, lParam);
}
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
Hi,
thank you very much. You're right. I have found my problem. I had implemented a handler for WM_CHAR where my editbox content is formatted. To process WM_COPY commands I must call the base class procedure for WM_CHAR for nonprintable characters like this:
void CMyEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if(isprint(nChar)==0){
CEdit::OnChar(nChar, nRepCnt, nFlags);
return;
}
// Further processing here
}
Now the OnCopy implementation is called !
|
|
|
|
|
can anyone tell me how to convert a std::string to float type?
|
|
|
|