|
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?
|
|
|
|
|
float MyFloat = atof(MyString.c_str());
|
|
|
|
|
float MyFloat=atoi(MyString.c_str());
That's correct!;P
|
|
|
|
|
Err, no, this will convert a string to an integer value, not to a float value. atof convert to a float value.
|
|
|
|
|
|
Michael Dunn wrote: From the C++ FAQ lite:
[39.2] How do I convert a std::string to a number?[^]
Please no stringstream solution. Just encapsulate strtod.
|
|
|
|
|
|
Michael Dunn wrote: OP's
means "Original Poster" ?
led mike
|
|
|
|
|
Gee Mike, what in the world were you thinking?
"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
|
|
|
|
|
Roland Pibinger wrote: Please no stringstream solution.
Out of interest, why not?
|
|
|
|