|
Could you tell what's the missing parameter? I am totally clueless about this. I'm once thinking that I have to specify the DialogProcedure, but I saw the example from other resource (if using pure windows API way) that it doesn't need to specify the third and fourth parameter. Then I tried to provide the DialogProcedure and it still got error.
|
|
|
|
|
rudyono wrote: Could you tell what's the missing parameter?
The link I gave you clearly shows what parameters this function requires.
rudyono wrote: I am totally clueless about this.
I suggest you try something simpler; the code you posted above appears somewhat complicated. I am not sure what it is you are trying to achieve here or why you want to use a modeless dialog instead of a normal main window for your program.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
rudyono wrote: I want to create a modeless dialog as main window.
In what way are they different:
a modal dialog as main window and
a modeless dialog as main window ? Check your definition of Irrationality[ ^]
1 - Avicenna
5 - Hubbard
3 - Own definition
|
|
|
|
|
The distinction between modal and modeless dialogs is important and significant, but in your particular case of the main app window, I have to agree with Eugen Podsypalnikov that it seems to be a moot point.
I notice as well that you have written your own message loop and included it in App::InitInstance, bypassing the one provided as a part of MFC. I see no reason for you to be doing this.
I am puzzled by what you are trying to do here. It seems to me that you are writing an MFC app, but specifically bypassing MFC in it, instead nesting a win32 api application inside of it. This makes me nervous about how the various pieces of code in your app will interact.
Writing an MFC app is fine.
Writing a win32 app is fine.
I don't get what you are doing here. Perhaps you could try and clarify things for at least one of us? Please do not read this signature.
|
|
|
|
|
Here is the story, I want to make an MFC application with a splash screen. The problem is my app is a modal dialog and a modal dialog cannot startup as invisible, so that's why I was looking for modeless dialog as main window way. I was succeeded (to make modeless dialog as main window as said in my first post. It's just a curiousity that I replace the 2 line of MFC code to create a modeless dialog with win32 API code to do same thing, and it failed to create a modeless dialog. So I just want to know why the win32 API code is failed?
Btw, I already know how to solve my initial problem pertaining relationship between modal dialog and splash screen, so I had switched back to modal dialog.
|
|
|
|
|
Hi all,
i want to convert a CString value to DWORD. My problem is i am having hex value in my CString variable for ex.
CString str = 0x002C036D;
now i want to convert this value to DWORD.
How can i do this??????
Thanks in advance...
|
|
|
|
|
you can covert it to char * first,then use atoi.
Good Luck !
|
|
|
|
|
The statement
CString str = 0x002C036D; does not make much sense to me. Maybe you meant to say
CString str = _T("0x002C036D"); A simple function will do the conversion. You probably need to take a look at the function sscanf .
|
|
|
|
|
|
Hi all,
Im trying to write MJPEG frames into AVI container.
AVIStreamWrite function is getting failed.It returns the error code -2147205014.
Im not able to proceed further.
Could any one help me?
Thanks
|
|
|
|
|
|
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
|
|
|
|