|
i selected the particular file by using following code
POSITION currPos;
char strFilter[] = { "Mp3 files (*.mp3)|*.mp3|All Files (*.*)|*.*||" };
CFileDialog avi(TRUE, ".mp3",NULL,OFN_ALLOWMULTISELECT | OFN_HIDEREADONLY, strFilter);
char drive[_MAX_DRIVE], middle[_MAX_PATH], filename[_MAX_FNAME], ext[_MAX_EXT];
if(avi.DoModal() == IDOK)
{
currPos = avi.GetStartPosition();
while(currPos != NULL)
{
m_SongName = avi.GetNextPathName(currPos);
_splitpath (m_SongName, drive, middle, filename, ext);
m_list7.AddString(m_SongName);
here
m_list7 is memeber vaiable for ListBox
|
|
|
|
|
So what you want to do is set a specific directory for CFileDialog?
Check out this article[^]
|
|
|
|
|
no my problem is for example we have songs in one folder.and if go to menu and add songs then if we select the folder then it should automatically selece the all songs in the folder.but it's not getting.if i click that folder all the songs are coming to select only one.
please solve this,
sree
|
|
|
|
|
OK.
Then I would use SHBrowseForFolder.
When I got the folder name, I would use FindFirstFile/FindNextFile to find all the mp3's in that folder.
What about that apporach?
|
|
|
|
|
to do this in my project where should i change the code
|
|
|
|
|
|
can u show me examplefor this otherwise please edit my code and send me.
please it is little bit please,
make me from to
sree.
|
|
|
|
|
Sorry, I don't have the time, my employer want's me to do other stuff.
But you can find heaps of sources/samples, at CP and other places. Just Google for the function names.
|
|
|
|
|
when iam usE FindFirstFile.I GET one error FindFirstFile
,is undeclare identifier.
|
|
|
|
|
What do you need to insert your code?
whitesky
|
|
|
|
|
You can use SHBrowseForFolder function instead.
|
|
|
|
|
i ahve send my code.
where should i use this
please tell me,
sree.
|
|
|
|
|
Hi,
I would like to save a bitmap into BMP file in black and white mode. Plz help me!!
Regards
Praveen
|
|
|
|
|
|
hey all,,,
iam using VC++6.0
i have created an edit control button in my formview page.
i want to feed in the numbers from -10 to +10 in it .....i also want to feed in the numbers like 3.45 or 0.45 etc., with in this range. how do i do it?
I have creeated the member variable as double and specified the minimum and maximum range to be -10 and +10 respectively. when i build the program and type in 3.45, the value gets rounded to 3 aand if i type 3.6, it gets rounded to 4
but i want it as 3.45 only to do further operation/calculation in my code .
can anyone help pleaseeeee?
thanks in advance.
|
|
|
|
|
hey guys........
iam desperately in need of help guys......
am running short of time.
can anyone help me in this....?
|
|
|
|
|
better u create a control variable for the edit control. then usings GetWindowText function, get the text in edit control as string. then convert the string to double using sscanf or some other convertion functions..
nave
|
|
|
|
|
i need this value to be user-selectable so that I type in 3.45 on the Formview page.
If i get it as string then how do i select the values .....as they are randomly chosen values.
how do i do it?
|
|
|
|
|
sorry i didn't understand....
do u mean u want to limit the values in a range( say from 3-10 t0 4.45 )?
nave
|
|
|
|
|
thanks for ur response.
I want the range to be say -10 to +10 but i should be able to select values like for eg., 1.5, 4.6, etc.,
I have created member varaible as double for this and hence can limit the range from -10 to +10 but i cannot choose values like 1.5,7.8 .
if i do , the values get rounded to 2 and 8 repesctively.
these values are to be chosen at randon and during runtime ..
how do i do this?
|
|
|
|
|
there is some thing wrong with ur code...
I tried creating a double variable for the edit control. and its works fine.
in my code its not geting rounded..
if i give 1.5, it gives exactly 1.5 in the variable..
How did u examined the value in the variable u created?u debugged?
nave
|
|
|
|
|
I use VC++6.0
I created edit control on the formview page and then used class wizard to create the member variable for this edit control and chose it as double.
Now if I compile /build my program, then if i try to type in the edit button as 1.5 it rounds to 2 automatically. It is that I cannot type in values like 1.5 on the edit page.
I dont round it anywhere in my code.
How did u debug?
I am new to this programming n still in the learning curve.
|
|
|
|
|
1 .Put the following code in some place of the code.
UpdateData( TRUE );
double x = m_edit;
2. Put a break point in the line "double x = m_edit;" ( Break point can be inserted by pressing the f9 key )
3. Now press f5 to start debug
4. When the execution reaches the following code, it will break
5. Move the mouse cursor over to the m_edit variable. the value in that variable will be displayed as tool tip
nave
|
|
|
|
|
I have read that heavy using 'new' and 'delete' operators frequently could lead to memory fragmentation in the heap and hence whereever possible limit to using variables declared in the stack.....
So herez my question with regards to memory fragmentation in the heap:
Does this imply with CString as well???...
or does windows handle this using 'placement new' ??
|
|
|
|
|