|
I want to use the CHtmlEditView in my vc 6.0 project.
so i added the header file 'afxhtml.h' and then added the following line.
CHtmlEditView htmleditview_object;
then i compile the project and its giving the error like
error C2501: 'CHtmlEditView' : missing storage-class or type specifiers.
what should i do?
How do i solve this problem?sunnyram
|
|
|
|
|
ftp and gopher have related finder classes of CFtpFileFind and CGopherFileFind respectively.
but how to find files with http protocol?
is it impossible?
|
|
|
|
|
I might be talking complete rubbish, but I don't think HTTP servers support searching. I've certainly never come across a program that lets you do it, and I've come across plenty of FTP ones.
|
|
|
|
|
The HTTP protocol does not offer this. Perhaps the web server provides a search or directory service you can use.
Cheers, M
PS: If it was another user posting this question, I would not be very surprised about a followup-post describing what you want to achive and we could start a communication to discuss alternatives and find a technical a solution. But since it is includeh10 we will never know. Hope I could help anyway, see you next time.
|
|
|
|
|
Hi all,
i m working on Dialog based application,
here diffreant types of controls placed over the dialog box like,Edit box,static box,button,list elc.
some dialog boxes popup on button clicked.
after some time using of application its becomes so slow,even if i restore it from minimize state its take some time to display the controls of dialog box.
and the memory usage of application increase and increase.
please tell me how can i reduce the memory usage of application,and make it stable wheather its use or long time,
please tell me how can i resolve the problem of slow responding or not responding.
thanks in advance.
|
|
|
|
|
Try Googling "memory leaks". Steve
|
|
|
|
|
As Steve suggested, your application probably doesn't perform well the necessary cleanup, i.e. keeps allocating new objects without calling delete on the 'dead' ones.
Correct handling of dynamic memory is one of the major duties of the C/C++ developer.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Try to analyze debuggers output lines after the applications exit Check your definition of Irrationality[ ^]
1 - Avicenna
5 - Hubbard
3 - Own definition
|
|
|
|
|
Eugen Podsypalnikov wrote: Try to analyze debuggers output lines after the applications exit
i dont know how to use this?
please tell me how can i do this.
|
|
|
|
|
Build a debug version, start its debugging (F5),
then close the app and observe the output window in VS.
Usually you can even jump to the source, like ... = new ... ,
just by a double click at a "memory leak" line there Check your definition of Irrationality[ ^]
1 - Avicenna
5 - Hubbard
3 - Own definition
|
|
|
|
|
Its looks like this.
'Test.exe': Loaded 'C:\Windows\System32\ntdll.dll'
'Test.exe': Loaded 'C:\Windows\System32\kernel32.dll'
'Test.exe': Loaded 'C:\Windows\System32\user32.dll'
'Test.exe': Loaded 'C:\Windows\System32\gdi32.dll'
'Test.exe': Loaded 'C:\Windows\System32\advapi32.dll'
'Test.exe': Loaded 'C:\Windows\System32\rpcrt4.dll'
'Test.exe': Loaded 'C:\Windows\System32\msimg32.dll'
'Test.exe': Loaded 'C:\Windows\System32\comdlg32.dll'
'Test.exe': Loaded 'C:\Windows\System32\msvcrt.dll'
'Test.exe': Loaded 'C:\Windows\System32\shlwapi.dll'
'Test.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.6002.18005_none_5cb72f96088b0de0\comctl32.dll'
'Test.exe': Loaded 'C:\Windows\System32\shell32.dll'
'Test.exe': Loaded 'C:\Windows\System32\winspool.drv'
'Test.exe': Loaded 'C:\Windows\System32\oledlg.dll'
'Test.exe': Loaded 'C:\Windows\System32\ole32.dll'
'Test.exe': Loaded 'C:\Windows\System32\oleaut32.dll'
'Test.exe': Loaded 'C:\Windows\System32\winmm.dll'
'Test.exe': Loaded 'C:\Windows\System32\oleacc.dll'
'Test.exe': Loaded 'C:\Windows\System32\imm32.dll'
'Test.exe': Loaded 'C:\Windows\System32\msctf.dll'
'Test.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.0.6002.18005_none_9e50b396ca17ae07\GdiPlus.dll'
'Test.exe': Loaded 'C:\Windows\System32\lpk.dll'
'Test.exe': Loaded 'C:\Windows\System32\usp10.dll'
'Test.exe': Loaded 'C:\Windows\System32\uxtheme.dll'
'Test.exe': Loaded 'C:\Windows\System32\dwmapi.dll'
'Test.exe': Loaded 'C:\Windows\System32\clbcatq.dll'
'Test.exe': Loaded 'C:\Windows\System32\wbem\wbemprox.dll'
'Test.exe': Loaded 'C:\Windows\System32\wbemcomn.dll'
'Test.exe': Loaded 'C:\Windows\System32\ws2_32.dll'
'Test.exe': Loaded 'C:\Windows\System32\nsi.dll'
'Test.exe': Loaded 'C:\Windows\System32\rsaenh.dll'
'Test.exe': Loaded 'C:\Windows\System32\wbem\wbemsvc.dll'
'Test.exe': Loaded 'C:\Windows\System32\wbem\fastprox.dll'
'Test.exe': Loaded 'C:\Windows\System32\ntdsapi.dll'
'Test.exe': Loaded 'C:\Windows\System32\dnsapi.dll'
'Test.exe': Loaded 'C:\Windows\System32\Wldap32.dll'
'Test.exe': Loaded 'C:\Windows\System32\psapi.dll'
'Test.exe': Loaded 'C:\Windows\System32\netapi32.dll'
'Test.exe': Loaded 'C:\Windows\System32\secur32.dll'
The thread 'Win32 Thread' (0xaac) has exited with code 0 (0x0).
'Test.exe': Unloaded 'C:\Windows\System32\dwmapi.dll'
The thread 'Win32 Thread' (0xeb4) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x3a8) has exited with code 0 (0x0).
The program '[3476] Test.exe: Native' has exited with code 0 (0x0).
|
|
|
|
|
OK Was it an output of the Debug vesrsion (configuration) of your application ?
When yes - there are no direct references to the classical memory leaks (by new).
However it would be possible (for example),
that you do not release other kinds of the resources,
such as HPEN, HFILE, HXXX... ,
or you initialize something twice without releasing...
You could try to analyze the code (subject: symmetry of allocation/deallocation),
or use the special tools (when your code is to big for you to analyze)... Check your definition of Irrationality[ ^]
1 - Avicenna
5 - Hubbard
3 - Own definition
|
|
|
|
|
Output window is like this
‘Test.exe’: Loaded 'C:\Windows\System32\ntdll.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\kernel32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\user32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\gdi32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\advapi32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\rpcrt4.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\msimg32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\comdlg32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\msvcrt.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\shlwapi.dll'
‘Test.exe’: Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.6002.18005_none_5cb72f96088b0de0\comctl32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\shell32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\winspool.drv'
‘Test.exe’: Loaded 'C:\Windows\System32\oledlg.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\ole32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\oleaut32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\winmm.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\oleacc.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\imm32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\msctf.dll'
‘Test.exe’: Loaded 'C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.0.6002.18005_none_9e50b396ca17ae07\GdiPlus.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\lpk.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\usp10.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\uxtheme.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\dwmapi.dll'
Detected memory leaks!
here i found Detected memory leaks!,but i dont know how can get the location of this memory leak,
how can get at which porint or on wich function memory leaks.
please help me for this.
thanks.
|
|
|
|
|
Usually the line "Detected memory leaks!" is not last... Check your definition of Irrationality[ ^]
1 - Avicenna
5 - Hubbard
3 - Own definition
|
|
|
|
|
like this.
‘Test.exe’: Loaded 'C:\Windows\System32\ntdll.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\kernel32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\user32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\gdi32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\advapi32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\rpcrt4.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\msimg32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\comdlg32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\msvcrt.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\shlwapi.dll'
‘Test.exe’: Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.6002.18005_none_5cb72f96088b0de0\comctl32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\shell32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\winspool.drv'
‘Test.exe’: Loaded 'C:\Windows\System32\oledlg.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\ole32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\oleaut32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\winmm.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\oleacc.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\imm32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\msctf.dll'
‘Test.exe’: Loaded 'C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.0.6002.18005_none_9e50b396ca17ae07\GdiPlus.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\lpk.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\usp10.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\uxtheme.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\dwmapi.dll'
‘Test.exe’: Unloaded 'C:\Windows\System32\dwmapi.dll'
The thread 'Win32 Thread' (0x16fc) has exited with code 1 (0x1).
Detected memory leaks!
Dumping objects ->
{235} normal block at 0x00F66728, 145 bytes long.
Data: < d > C0 15 9D 01 64 00 00 00 80 00 00 00 01 00 00 00
{227} normal block at 0x00F666D8, 20 bytes long.
Data: < > C0 15 9D 01 03 00 00 00 03 00 00 00 01 00 00 00
{226} normal block at 0x00F66640, 85 bytes long.
Data: < D D > C0 15 9D 01 44 00 00 00 44 00 00 00 01 00 00 00
{225} normal block at 0x00F66598, 103 bytes long.
Data: < V V > C0 15 9D 01 56 00 00 00 56 00 00 00 01 00 00 00
Object dump complete.
The program '[4540] Test.exe: Native' has exited with code 0 (0x0).
|
|
|
|
|
Just double click at {XXX} Check your definition of Irrationality[ ^]
1 - Avicenna
5 - Hubbard
3 - Own definition
|
|
|
|
|
you mean double click on {235},
nothing happen when i double click on this.
|
|
|
|
|
Please include:
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
at the beginning of each *.cpp in you project, after their "iclude section" Check your definition of Irrationality[ ^]
1 - Avicenna
5 - Hubbard
3 - Own definition
|
|
|
|
|
|
The sources will be presented in the output window (to double click)
only if it (see above) is included
Please check other sources Check your definition of Irrationality[ ^]
1 - Avicenna
5 - Hubbard
3 - Own definition
|
|
|
|
|
Hi Experts.
I'm new in Mfc.
In c# I cloud easily add new form to my application and show it.
At first step in Mfc I need to add some dialog to my application and then from some menu or button command display it.
But I mixed to how do it?
Thanks for your kinds.sepel
|
|
|
|
|
From 'View' Menu Choose to see Resource 'View Panel' in your IDE
In the Resource View Panel Expand Items and right click the Dialog Branch and Choose 'Add Resource' and press New Button of add Resource Dialog.
After your dialog has created you can see it in Resource Designer when ever you want by Double Clicking on it in Resource View Panel.
After You do all these Right Click on your Dialog in Resource Designed and choose 'Add Class'
fill the class field with a name (e.g. "CTemp1Dlg")and before Finishing the wizard attention the names of .Cpp File and .h file which is created for you through wizard (here : Temp1Dlg.h and Temp1Dlg.cpp)
now include the Temp1Dlg.h File created in previous step in your Code which you want to Modal your Dialog.
in the method you want to Modal your Dialog write the below code:
CTemp1Dlg dlgMyDialog(this);
dlgMyDialog.DoModal();
|
|
|
|
|
It works !.
Thanks Amir.
Dear Amir,I have some expert in C# and now I migrate to mfc for some interesting and some works !.
Can I ask you guide me to some books or another resource to help me learn mfc better( and quick)?
Best Regardssepel
|
|
|
|
|
Ok Please Don't hesitate to ask any question ,But I could not promise if I could answer them all.
Here is a list of update books you may like to use, How ever mostl of MFC guide books found in the net are old ones but they could be useful too because the bases are the same:
http://msdn.microsoft.com/en-us/visualc/dd721903.aspx[^]
By the way for those who are new to MFC, How Do I? Video Series[^] would be interesting.
|
|
|
|
|
So Helpful.
Thanks again.sepel
|
|
|
|