|
Stack traces of what the application is doing when hung would be a big help. Also, what framework (if any) is being used?
Steve
|
|
|
|
|
Hi all,
I want to use OpenFileDialog Class to open a file in my VC++.NET win32 application. But I am getting this error.
error C2262: 'myFile' : cannot be destroyed
For the code
OpenFileDialog myFile;
Can I know what is wrong with my code I have added using namespace System::Windiws::Forms; in my file.
Thanks in advance,
Priyank
|
|
|
|
|
if you ask this in the right .NET forum you might get better answers.
If you think you can than you can, if you think you can't you are right.
|
|
|
|
|
Wrong forum
|
|
|
|
|
Hi all,
I'm facing the problem with the CoInitializeEx.
I have a COM dll, when the dll is built in the debug mode, and from the client if I debug "User break point called" message box pops up.
The important fact is, the message box pops in a very rare conditions.
I have tested several hundred times in the release mode, but never the problem is faced.
Problem comes only if the DLL is in debug mode.
My dll uses other two DLLS(win32) all(INCLUDING THE COM DLL) uses MFC.
Please let me know the root cause of the problem.
Thanks in advance,
Raja Pratap
|
|
|
|
|
1. The reason why the message box doesn't pop up when you're building for release is probably that it is generated from an ASSERT and the ASSERT macro is disabled when building for release.
2. If you mix a debug-built DLL with a release-built application and you allocate memory in one of them and deallocates it in the other, you will get into troubles. Not only because it is suspect design, but because the memory checking gets screwed up when it checks for boundaries and how much is allocated for each block.
3. Make sure you're linking with the debug-built libraries when building for debug.
4. If none of the above applies to your situation, post again and describe your problem some more. It would be of great help to know where your application crashes and what the call stack looks like at that point.
--
Roger
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998 "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above
|
|
|
|
|
Dear All,
I have multiple threads in my program. When i execute it, once the thread is started the memory size of program is growing high. The thread is now stopped. still memory that is used by thread is in alive ? I want to reduce that memory usage. How ?
Will susbend thread fn help me ? Kindly tell me what should i do to reduce memory that was occupied by existing thread ...
Thanks..
Nice things do nice works
|
|
|
|
|
I have similar thing with my multithreaded application. When I create for example 100 dialog windows (each on separate thread) and then I close all of them exept main dialog, memory usage falls down but is not equal to the usage before opening those 100 windows. Visual studio does not report any memory-leaks. I suppose that system is allocating memory for the application but is not freeing everything just in case the application would request again some memory. Maybe it's also your case??
Pat.
|
|
|
|
|
Did you allocate a lot of memory that you didn't release ? How is the memory increasing ? Little by little ? If yes, that probably means that you have a memory leak somewhere in your code.
|
|
|
|
|
Sakthiu wrote: still memory that is used by thread is in alive ? I want to reduce that memory usage. How ?
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
It's quite normal for the application to require more memory since another thread context must be created. Unless you explicitly allocate what you refer to as "high"; don't bother, you're wasting your time.
See here[^] for more info, especially the part about Task Manager.
--
Roger
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998 "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above
|
|
|
|
|
I want to play .wav file using waveform audio functions i.e WAVEFORMATEX and using the functions waveOutOpen, waveOutWrite etc..
I have tried it, but I could play only part of the file. And even I want to control the speed of that played file i.e. to increase the speed or decrease the speed of the .wav file. Please Help me out.
Thanks in Advance
CraZyToLearn
CraZyToLearn
|
|
|
|
|
Check if PlaySound() is of any use to you.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Hey Thanks to WhiteSky as well as Brahmma for your reply....
I have used playsound() as well as MCI controls to play wav file, but I don't want that way to play my wave files. I just want to play it through waveform audio functions.
Even I want to increase/decrease the speed of play.
CraZyToLearn
|
|
|
|
|
CraZyToLearn wrote: I want to increase/decrease the speed of play.
Take a look here Ey Media Player[^]
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
You can use also of MCI functions for play your file
|
|
|
|
|
I want to play .wav file using WAVEFORMATEX and using the functions waveOutOpen, waveOutWrite.
I have tried it, but I could play only part of the file. And even I want to control the speed of that played file. Please Help me out.
Thanks in Advance
CraZyToLearn
CraZyToLearn
|
|
|
|
|
Check if PlaySound() is of any use to you.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Hello
I've already posted those questions but it was Sunday night so probably nobody had seen it;)
I have a DLL which installs system wide hook using SetWindowsHookEx(WH_Mouse,...), can I use normal PostMessage(main_application_hwnd_handle,...) to inform my application about some event which happend inside this DLL?? I tried it, but it seems not working. PostThreadMessage(main_application_thread_id,...) works fine. In MSDN I couldn't find any information that HWND handle in PostMessage() should belong to the calling process/thread...?
My second question is, how to capture LVM_HITTEST messages, I mean which hook could I use to capture system wide LVM_HITTEST messages? I need also WM_LMOUSEDBLCLK messages which I capture using WH_MOUSE hook. Is it possible to capture those two messages using only one hook? I've partialy solved this problem by sending LVM_HITTEST message to the hooked window from the WH_MOUSE hook, but I don't think it's 'clean' and for sure it generates additional performance hit...
Last question - how to find (in a 'safe and compatible way') HWND to the desktop window "FolderView" of class "SysListView32"? It has a handle 0x10094 but I think I can't hardcode it to my application... Now I use:
HWND h1=::FindWindowEx(NULL,NULL,"Progman","Program Manager");
HWND h2=::FindWindowEx(h1,NULL,"SHELLDLL_DefView",NULL);
m_hwnd_desktop=::FindWindowEx(h2,NULL,"SysListView32",NULL);
is it safe? (single m_hwnd_desktop=::FindWindowEx(NULL,NULL,"SysListView32","FolderView") returns NULL..?!?)
Thanks for any help (and thanks to Naveen R for answering my previous question at 5 o'clock;)
Pat.
|
|
|
|
|
I have created a program in which I need to determine the availability
of a Shared folder path.
Here is the sample code
*********************************
#include <io.h>
m_sCopyToDrive = "t:\\test\\";
if( ::_access(m_sCopyToDrive.c_str(),0) == -1)
{
AfxMessageBox("Network is Down");
return FALSE;
}
else
{
AfxMessageBox("Network is UP");
}
*****************************************
To check if the network is up I ran the following test.
If Network connected.... result imediate Message box "Network is up"
Disconnect ethernet cable from network.
Program runs and after about 3 minutes "network is down" message box
appears. It takes about another minute for function to return.
Is there any other way to test if the network path is available or not
Thanks for the help,
|
|
|
|
|
I don't know if it's any quicker, but look at the ISensNetwork interface.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I have a dialog with two browse buttons on it. If i press the frist one, select a file than press the seccond one, my application crashes and i can't figure out why . Here's the code:
void CAddEquipDlg::OnBnClickedBrowsedb()
{
char szFilters[]=
"Access DB (*.mdb)|*.mdb|All Files (*.*)|*.*||";
CFileDialog fDlg(TRUE,
"mdb",
"*.mdb",
OFN_FILEMUSTEXIST| OFN_HIDEREADONLY,
szFilters,
NULL
);
if (fDlg.DoModal()==IDOK)
{
m_sDB = fDlg.GetPathName();
}
SetCurrentDirectory(m_sCurDir);
SetDlgItemText(IDC_DB,m_sDB);
AfxGetApp()->WriteProfileString("Connection", "Database",m_sDB);
}
void CAddEquipDlg::OnBnClickedBrowseequip()
{
char szFilters[]=
"CSV Files (*.csv)|*.csv|All Files (*.*)|*.*||";
CFileDialog fDlg(TRUE,
"csv",
"*.csv",
OFN_FILEMUSTEXIST| OFN_HIDEREADONLY,
szFilters,
NULL
);
if (fDlg.DoModal()==IDOK)
{
CString bla = fDlg.GetFileTitle();
m_sEQUIP = fDlg.GetPathName();
}
SetCurrentDirectory(m_sCurDir);
SetDlgItemText(IDC_EQUIP,m_sEQUIP);
}
It crashes two out of tree times (with a send/don't send error message in release) and this is the debug info
First-chance exception at 0x7ca5159e in AddEquip.exe: 0xC0000005: Access violation reading location 0x62883720.
Unhandled exception at 0x7ca5159e in AddEquip.exe: 0xC0000005: Access violation reading location 0x62883720.
|
|
|
|
|
At what line it takes you in the code ? if you try to debug crash .
|
|
|
|
|
It's difficult to see the problem. What you can do to narrow the problem is use your debugger (press F5) to see where in your code the crash occurs. Then you can watch for the different variables and check if everything is correct.
You can also set breakpoint (press F9) before the crash to see the evolution of the variables.
|
|
|
|
|
Did you try debugging? Where exactly is the app crashing?
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|