|
Read the book : "Inside C++ Object Model", by Stanley Lippman, and you will get a clear picture about all the three questions of yours.
Maxwell Chen
|
|
|
|
|
Very often when enabling the flag OFN_ALLOWMULTISELECT allows one to multiple select a number of files in a current folder.
However there's a limit where one can select a number of files and thereafter... the dialog hangs on you. I would like to find out a more economical method of dynamically allocating memory for this kind of situation. I derived the CFileDialog to a new class and gave it a new variable TCHAR* m_varString;
I override the OnFolderChange() putting some code that shows below..
However it's not efficient and it seems to show rubbish every time I reopen the CFileDialog. After certain time a memory violation occurred. It all seemed strange to me. Perhaps I'm heading the wrong way. Can someone please advise me what I shoud correct? Thanks...
void CFileDialogEx::OnFolderChange()
{
// TODO: Add your specialized code here and/or call the base class
CString cstrFolderPath = GetFolderPath();
DWORD dwBufCount = cstrFolderPath.GetLength();
cstrFolderPath += _T("\\*.*");
CFileFind ff;
BOOL bFound = ff.FindFile( cstrFolderPath );
while ( bFound )
{
bFound = ff.FindNextFile();
if ( !ff.IsDirectory() )
dwBufCount += ( ff.GetFilePath().GetLength() );
}
dwBufCount += 1;
ff.Close();
delete m_pszVar;
m_pszVar = (TCHAR*) new TCHAR[dwBufCount];
m_pszVar[0] = _T('\0');
m_pOFN->lpstrFile = m_pszVar;
m_pOFN->nMaxFile = dwBufCount;
CFileDialog::OnFolderChange();
}
|
|
|
|
|
|
I have file that is raw PCM format,
what all things do i need to do convert the file to Wave format.
I mean what apis do i need to use?
Thanx.
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
If you can wade through the VB code here[^] you can probably bang out a nice, efficient C++ utility to convert PCM to .wav.
Will Build Nuclear Missile For Food - No Target Too Small
|
|
|
|
|
Thanx that link was very help full.
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
You can read up on the file format and do it yourself, find an existing library from Google or elsewhere, or investigate the 'Multimedia IO' functions such as 'mmioOpen' in MSDN. The DirectSound part of the DirectX development kit contains some C++ helper classes, such as 'CWaveFile' that wrap mmio functions helpfully and are probably the quickest approach to a correct result.
You will have to create a wav file, write the right sound format (bits, samples, channels, compressed/not etc) then, assuming that the samples are compatible, you can just write them out.
Paul
|
|
|
|
|
Thanx.
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
Hi,
Just wondering why If I have a CButton
then
CRect butt;
m_button.GetClientRect(&butt);
m_button.ClientToScreen(&butt);
m_button.MoveWindow(&butt);
does not move the window at all which is expected.
but if the m_button is a CStatic then This does move the window?
I thought I was not doing anything by taking the coords converting them back to screen coords and Calling MoveWindow. It is still just the same coords I got originally.
I have a list view inside a CStatic (group box) and I would like to resize the group box and the list view inside to the maxium width of the screen.
Is it not possible to resize a CStatic?
|
|
|
|
|
The reason I can think of is that 'GetClientRect' returns the area minus the non-client area. So perhaps your CButton has no non-client area while your CStatic does ?
You should be able to resize your static control with no problem.
You can do this :
<br />
CRect rc;<br />
control.GetWindowRect(rc);
ScreenToClient(rc);
<br />
rc.left = 400;<br />
<br />
control.MoveWindow/SetWindowPos(rc);<br />
|
|
|
|
|
In MSDN under DialogProc it tells you to return TRUE (1) if you process the message, but when you check out most of the messages, it tells you to return 0 (FALSE). So which one do I use?
wWw.KruncherInc.cOm - My programs
|
|
|
|
|
It's by design. Just follow the documents for every implementations you use.
For example, if you invoke a certain function defined by Maxwell:
int MaxwellCreateDialog(HWND* phSomeThing)
{
return 77;
}
Then in your code.....
HWND hWnd = NULL;
int iRetValue = MaxwellCreateDialog(&hWnd);
switch(iRetValue)
{
case 77:
AfxMessageBox("Congratulation! DialogBox is created.");
break;
default:
throw ErrorObj("Error creating a dialogbox", iRetValue);
}
Maxwell Chen
|
|
|
|
|
Hi,
The code I am writting: cout<<"Our start time is"<
|
|
|
|
|
int(floor(iDur/60)) and iDur%60 will give you what you want, won't it ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I know this isn't a question and this probably doesn't belong here but I figured what better place to put it. I'd like to say Thank you(yet again) to DavidCrow for the tremendous help he gave me when I needed it. And just have to say what a person you must be. To have the patience you have. I hope one day to be able to help others the way you've helped me thank you.
|
|
|
|
|
There are a number of very helpful people on this site, and David is definitely one of them. It's good of you to say "Thank you," as so many of us often fail to do.
Will Build Nuclear Missile For Food - No Target Too Small
|
|
|
|
|
After all he is MrNice.
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
Hello,
I downloaded a source code in sourceforge.net and rebuild it to learn what it does in system!
It requires too many: Service Pack 3 for Visual C 6.0, DirectX SDK, DDK, and Processor Pack for Visual C 6.0 too.
But after passing many error in compiling, building its dependencies, I come to the last component: the main program.
In the "stdafx.h" file, it includes many header, but the important is:
<br />
#include <vector><br />
#include <string><br />
<br />
using namespace std;<br />
<br />
and VC say error when compiling the first file stdafx.cpp:
<br />
<br />
--------------------Configuration: DScaler - Win32 Release--------------------<br />
Compiling...<br />
StdAfx.cpp<br />
D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream(557) : error C2059: syntax error : 'catch'<br />
D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream(557) : error C2143: syntax error : missing ';' before '{'<br />
D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream(559) : error C2712: Cannot use __try in functions that require object unwinding<br />
D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream(578) : error C2059: syntax error : 'catch'<br />
D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream(578) : error C2143: syntax error : missing ';' before '{'<br />
Error executing cl.exe.<br />
<br />
DScaler.exe - 5 error(s), 0 warning(s)<br />
<br />
If I comment #include <string>, I can pass this file (remember it is stdafx.cpp), but I will get many many other errors in next files.
So please help me to fix this error!
PS. I download DScaler from sourceforge.net. Thank you very much!
|
|
|
|
|
A DirectX program is clearly a fairly advanced thing to be pulling apart, especially if you don't have DX already ( i.e. are not into that sort of stuff ).
It's possible that there's a compliler setting you need to turn on for try.catch to work ( I'm going from memory here ). Otherwise, could you clarify what headers you're including ? You didn't check Do not treat <'s as HTML tags, nor did you use the buttons below to enter < for <, etc, so they got stripped as HTML.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Firstly, thank you very much for your reply, Chris! I'm very very happy when receive your reply...
This is the include code:
#include <vector>
#include <string>
using namespace std;
If I comment the sencond include code, I can pass the first compiling for stdafx.cpp, but I will get many many errors in next files.
I think that there are some wrong options in C/C++ tab of the property of project. But this project is original from its source. I've just re-compiled it only.
Please help me, Chris! Thank you very much!
|
|
|
|
|
The problme is probably due to namespace pollution. As your doing a using namespace std you may find you end up adding a lot of symbols/names which clash with some of the symbols/names in your projects. Try reducing the amount beinf incuded by using:
using std::string;
using std::vector;
Globally includint entire namespaces like this may be good in the short term, but can bite you on the a$$ later on. We had a similar problem here recently.
Roger Allen - Sonork 100.10016
Strong Sad:
Clever I am? Next to no one.
Undiscovered and soggy.
Look up. Look down. They're around.
Probably laughing. Still, bright, watery.
Listed among the top. Ten.
Nine. Late night. Early morn.
Early mourn. Now I sleep.
|
|
|
|
|
Can't resolve this problem....
|
|
|
|
|
Hi,
If I have an app with a dialog resource is there an easY way to export the dialog
from one app and import it into the other app? Or do I have to re add it and then move the code for it over to the new application.
Regards,
axe
|
|
|
|
|
Open the .rc file as text and copy and paste it over. Then make sure the resource ID's referred to in it are in the resource ID file of the new project.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I am working with Dialogbased application.I was created one Modalless Dialogbox part of the application.Now How to send the Message from Modalless Dialogbox window to MainDialog whenever modellessDialogbox closed?Pl Tell me How to implement the SendMessage function?
dadsadasd
|
|
|
|