|
Simply copy, ie assuming your CString object is cstringObject...
ASSERT(cstringObject.GetLength() < 40);
if (cstringObject.GetLength() < 40)
lstrcpy(array, cstringObject);
Regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan, and open for day job or programming contract anywhere!
|
|
|
|
|
How to known when CStatusBar Text change by Internal OS RedrawWindow or UpdateWindow
I don't know the message for this.
I know ON_WM_PAINT when statusbar is painting but afx_msg void OnPaint( ); block the internal RedrawWindow
|
|
|
|
|
I Think its
WM_SETMESSAGESTRING or WM_SETTEXT
good luck
|
|
|
|
|
Hi expert,
I have a problem with the CList class. Microsoft does not provide a copy constructor for CList. Is there any way or alternatives that i can use beside than CList. I have tried to return a CList from a function but the compiler told me that there is no constructor to copy the list. I dont want to develop my own list because i dont have time for that. STL list is tedious to use and compatibility errors often pop up.
So please help.
thank you.
leonwoo
|
|
|
|
|
Create a CList in the fn that calls this fn, then
pass the CList by ref or by a pointer to the fn,
then fill the list in the fn. You can return the
number of items added to the list as a success/
failure check.
Regards,
Daniel
|
|
|
|
|
hi,
Thanks for your solution Daniel but i don't understand what it means by fn. Can you please give me an example code so that i can get the whole picture.
Thank you
leonwoo
|
|
|
|
|
Any more Suggestion??
Please........
leonwoo
|
|
|
|
|
I was wondoring, how do i implant Music in a dialog??
I try to do it with "PlaySound"
It worked, but i could control the Dialog right, when the Wav file played,
it was like it locked up. Is the a way to avoid this??
Thank you.
|
|
|
|
|
Hi,
if you want to have access to the window/dialog while playing a sound you have to play the sound asynchron. That causes the function to return just after the sound has started. If you want to lock the window while playing use the synchron-playing feature.
Hope it helps - Mario
--------------------
www.klangwerker.de
rocknix@lycos.de
--------------------
|
|
|
|
|
Ok, how do i implant that, i didnt find any info on MSDN.
??
Thank you.
|
|
|
|
|
Ok, the implementation is easy :
#include <mmsystem.h> // dont forget to link winmm.lib
// play from file synchron
sndPlaySound( "file.wav", SND_SYNCH);
// play from file asynchron
sndPlaySound( "file.wav", SND_ASYNCH);
// to play from memory or whatever use
sndPlaySound( "file", SND_MEMORY|SND_ASYNCH);
-> there are some other flags - look @ msdn
Greatings Mario ///
--------------------
www.klangwerker.de
rocknix@lycos.de
--------------------
|
|
|
|
|
I implanted the code:
sndPlaySound( "file.wav", SND_SYNCH);
in my butten.
and #include <mmsystem.h>
and linked winmm.lib
but i get this error.
error C2065: 'SND_ASYNCH' : undeclared identifier
Thank you.
|
|
|
|
|
Sorry,
the right flag is called SND_ASYNC and not SND_ASYNCH.
You can read about all in MSDN.
Greatings Mario ///
----------------------
www.klangwerker.de
rocknix@lycos.de
mario@klangwerker.de
----------------------
|
|
|
|
|
... and the same for synchron playing:
SND_SYNC and not SND_SYNCH
---------------
P.S.: If you got problems with unknown flags take a look at the header-file. All flags are declared there.
Greatings Mario ///
--------------------
www.klangwerker.de
rocknix@lycos.de
--------------------
|
|
|
|
|
Hello,
I'd like to write a Program that
can be executed in pure DOS.
Is there a way to write DOS-Programs with Visual C++6?
thanks in advance,
FoxHunter
|
|
|
|
|
File -> New
Projects tab
choose 'Win32 Console Application'
Regards,
Daniel
|
|
|
|
|
Yes, but this will actually create a program that requires Win32 -> You want be able to run this program only in DOS;P
|
|
|
|
|
Yes...only DOS!
I'd like to program a little Password-protection that starts before the Desktop ist being loaded.
I'd like to start the program from the
autoexec.bat
I have written that program in quickbasic, but i'd like to program it in c++
|
|
|
|
|
Oh dear,
someone takes a simple bootdisk, removes the entry from your autoexec.bat and runs windows as usual -
and what about your password than ??? Why don`t you use the bios-password protection ??
Greatings Mario ///
--------------------
www.klangwerker.de
rocknix@lycos.de
--------------------
|
|
|
|
|
Yes, you're right...but i want to program more dos programs than just that crappy password protection.
I could do that in qbasic, but i don't like the programming environment of qbasic.
So how can i do that now?
thanks
|
|
|
|
|
I dont really know if you can write real dos-code with vc. I have never tried.
Maybe use an older DOS-Compiler from Borland or something else.
Sorry - Mario ///
--------------------
www.klangwerker.de
rocknix@lycos.de
--------------------
|
|
|
|
|
You need VC 1.52 I think.
This is the last version that you can compile and make dos app.
Good luck,
Dror
|
|
|
|
|
Hi,
I think you could try (and I know its not VC++) downloading Turbo C++ from the Borland museum - a bit naff but it still works for DOS stuff.
cheers,
Andrew.
|
|
|
|
|
Hello,
I have a question regarding the way that the ComboBox control looks in MFC. - When I put the ComboBox on my dialog, and add some items in it, when I press the controlling button(the one that shows the list) it shows just a single item with two scrollbar buttons -> how to fix that so I can view my items in a normal list - like this
ComboBox
-----item----|
-----item----|
-----item----|
-----item----|
-----item----|
Thanks - Deian
|
|
|
|
|
in the dialog editor, click on the combo drop-arrow button. then resize the rectangle that appears. this controls the size of the drop down list.
-c
|
|
|
|