|
Check out the BCGControlBar library at BCGSoft (it used to be housed here at CP, but it's been taken down.)
--Mike--
http://home.inreach.com/mdunn/
This must be Thursday. I never could get the hang of Thursdays...
|
|
|
|
|
I visited the site, and the library seems very good, but what I need is not an EXACT copy of the visual c++ build window. I only need to know how to create a window with an edit control in it, that moves, docks and behaves similar to the one in visual c++.
|
|
|
|
|
I'm kind of new to MFC. I used to using Borland.
How can I convert a CString to a char array[40].
To be used as a filename I will open using old style ansi C fopen.
Additionally I noticed that in Microsoft VC++ you can not write a int long or double using fstream or iostream. This is pretty Lame. In Borlands compiler you write a double
somefile lessthan operator somedouble lessthan operator endl
Is there an easier way than using the old ansi style C fprintf to get your double written to a file.
Switching over to MFC is a pain when your used to using datatypes as other than characters.
JLS
Student/Part time programmer
Major Programming.
|
|
|
|
|
How about:
char *s = strdup(LPCTSTR(MyCString));
(don't forget to free s later...)
As far as I remember it should work...
- Anders
|
|
|
|
|
char array[40];
CString str = "whatever";
lstrcpy ( array, str );
But, if you're just passing the filename to a function - that is, the argument is a const char* - you can just pass the plain CString, since CString has a conversion operator to LPCTSTR.
--Mike--
http://home.inreach.com/mdunn/
This must be Thursday. I never could get the hang of Thursdays...
|
|
|
|
|
I don't understand your problem. fstreams with ints, doubles, and longs work fine.
It sounds like you're using the wrong operators. Please, don't make condescending comments when you don't even understand what you're doing.
#include <fstream>
int main(void)
{
std::ofstream s("myfile.txt");
int i = 1;
double d = 2.0;
long l = 3;
s << i << " " << d << " " << l << std::endl;
return 0;
}
|
|
|
|
|
I'm kind of new to MFC. I used to using Borland.
How can I convert a CString to a char array[40].
To be used as a filename I will open using old style ansi C fopen.
Additionally I noticed that in Microsoft VC++ you can not write a int long or double using fstream or iostream. This is pretty Lame. In Borlands compiler you write a double
somefile<
|
|
|
|
|
I'm kind of new to MFC. I used to using Borland.
How can I convert a CString to a char array[40].
To be used as a filename I will open using old style ansi C fopen.
Additionally I noticed that in Microsoft VC++ you can not write a int long or double using fstream or iostream. This is pretty Lame. In Borlands compiler you write a double
somefile<
|
|
|
|
|
I'm kind of new to MFC. I used to using Borland.
How can I convert a CString to a char array[40].
To be used as a filename I will open using old style ansi C fopen.
Additionally I noticed that in Microsoft VC++ you can not write a int long or double using fstream or iostream. This is pretty Lame. In Borlands compiler you write a double
somefile<
|
|
|
|
|
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
|
|
|
|