|
Hi,
I have a dialog based appliaction, Which was working fine. All of a sudden it started crashing at DoModal(). When i call DoModal() it send WM_DESTROY message. Could anyone please tell me what is wrong?
Regards
Neha
|
|
|
|
|
Please specify in detail , whether it is a Modal or Modeless dialog ,
and what do u mean by When u DoModal it sends WM_DESTROY message.
Abhishek Srivastava
Software Engg (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
It is a Modal dialog.
What i mean is when i call DoModal(), it comes to OnDestroy() member function of the dialog window.
|
|
|
|
|
Press F9 on destroy, press F5 and then open the callstack and check what's happening
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
It crashes at:
hWnd = ::CreateDialogIndirect(hInst, lpDialogTemplate,
pParentWnd->GetSafeHwnd(), AfxDlgProc);
in DLGCORE.CPP
hInst,lpDialogTemplate has the proper values.
pParentWnd=NULL;
AfxDlgProc has some value.
After this it will go to OnDestroy() instead of OnInitDialog()
|
|
|
|
|
Can you call GetLastError and see the error string?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi,
case 1
CDialog oCDialog;
if(oCDialog.DoModal()==IDOK)
{
}
case 2
CDialog *pCDialog;
pCDialog = new pCDialog;
|
|
|
|
|
|
Did u change the resource file just before it started crashing?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
You are right. I had fixed the problem...
Thanks ......
|
|
|
|
|
what i meant by enumerting the cases was that if you do not create the dialog box within if condition then the WM_DESTROY will get generated and it will destroy you dialog box.
if you don't wanna use if condition to create a dialog box then you will have to allocate memory to the dialog box pointer with new opeator.
i hope this solves your prob.
|
|
|
|
|
What kind of controls do you have embedded in this dialog?
I seem to remember the need to initialize support for RichEdit Controls prior to their use in a dialog.
Best Regards,
Bill
|
|
|
|
|
Hi, everybody
I meet a problem
First
DWORD WINAPI CA::ThreadFuncSound(LPVOID lpParam)
{
DWORD dwResult=0;
Beep(800, 1000000);
return 0;
}
ThenCreat a thread to sound which is suspended
m_hThreadSound = CreateThread(
NULL, // no security attributes
0, // use default stack size
ThreadFuncSound, // thread function
(PVOID)this, // argument to thread function
CREATE_SUSPENDED|THREAD_ALL_ACCESS, // Start the thread with a suspend count of one
&dwThreadId);
And then Start the sound thread
ResumeThread(m_hThreadSound);
Sleep(100);
Now I want to stop the speaker to sound. I ever used SuspendThread(m_hThreadSound) or TerminateThread(m_hThreadSound,0), but they can't work well.
How can I solve this problem?
Appreciate for any suggestions!
|
|
|
|
|
Hi there
to terminate a thread
first call GetExitCodeThread() method passing the Thread Handle to it and DWORD reference.
DWORD exitcode
GetExitCodeThread(m_hThreadSound, &exitcode) ;
Now call TerminateThread(m_hThreadSound, exitcode);
actually u were commiting mistake by passing 0 as thread exit code in ur TerminateThread line.
Tell me if i solved ur prob
Abhishek Srivastava
Software Engg (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
Thanks
But it does not work well yet.
It seems that this operation can not stop the speaker's sounding.
Have any other way?
|
|
|
|
|
Sir , u have passed 1000000 as a second param in Beep method , which means u have played a sound for almost 16 mins and this will block ur thread .
so instead of issuing a command for 16 mins,do it in a While loop
like this
while (true)
{
Beep(800,100);
}
return ;
Abhishek Srivastava
Software Engg (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
it is not very good
for the soud souds off and on, interrupted
Is it better if uninterrupted ?
|
|
|
|
|
Could somebody help me? Any information on ID3v2 of the MP3 files and any information of ID3v1 of the WAV, OGG, WMA files is appreciated.
|
|
|
|
|
You should try googling for it first!
Anyway, ID3V2[^]
ID3V1[^]
and there's an article on this subject on CP .
Hope this helps
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
Thanks! Those files I have read but haven't found the info I need. Have you some info on how to read the ID3v2 of the MP3 file? Or the structure of the ID3v2?
|
|
|
|
|
|
If he didn't even follow those links, I ask myself: Do people even look for the info they need nowdays?
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
Some people do; he may not be one of them. Personally, I have google and CP in my taskbar shortcuts...
Steve S
|
|
|
|
|
In my app I want to create some tool windows, which can be auto-hide and docking like that tool windows of VS.net, with VC++.net. But I looked the MSDN and some samples, the tool window is like only to be created as addin to be used by other app. Please tell me how to do, thank you very much.
If you have some samples , could you send to me?
|
|
|
|
|
I want to use following method, but it doesn't work.
HBITMAP hBitmap; // Here hBitmap is already available;
CBitmap *pBitmap;
pBitmap->Attach(hBitmap);
BITMAP bm;
GetObject(hBitmap, sizeof(BITMAP), &bm);
I don't know the function of "LVOID bmBits" in BITMAP structure.
According to MSDN, "LVOID bmBits" is the pointer to the pixel value area,
so I think I can get pixel value (R,G,B) using loop (bm.bmBits)+ +,
unfortunately it cann't work. Maybe it is a pointer to the whole structure,
including BITMAPFILEHEADER, BITMAPINFO ??
Thanks in advance.
Nianming
|
|
|
|