|
hi khan,
thanks for ur reply.
I ran the project using activex test container.In that test container ,I can able to play the video.but if i move the player or reposition the player,I am geting error message "Debug Assertion failed".Also it leads to assembly code and asking SBheap.c file.
How to proceed further.Plz help me.
cheers
sangeet
-- modified at 1:15 Saturday 25th February, 2006
|
|
|
|
|
If you get to the source, then in one of the debug windows, there is a combo-box which shows the current context. It shows the current file or function where the assertion failed. You should see down in that combobox, where your file is. Then select your file from that list, the topmost one. That will show you the exact line which caused the assertion failure. I cannot say much about it because I do not have Visual Studio right now. But look in that combobox, you will find the file, the function, and the exact line where the assertion failed.
this is this.
|
|
|
|
|
Hi all,
I need to create a child window with some childs (edit, etc.) inside it. When the user clicks somewhere else (outside this window), it should be disappeared.
Could anybody help me, please?
Thank you.
- NS -
|
|
|
|
|
You need to handle WM_ACTIVATEAPP or WM_ACTIVATE
Nibu thomas
Software Developer
|
|
|
|
|
I think you could:
1- Create an array of HWND 's, that is enough to accomodate all the children.
2- In OnInitDialog() function, take the HWND 's associated with all the children into that array using GetDlgItem(...) etc.
3- Now start the timer at about 100ms etc. SetTimer(2,100,NULL);
4- In the timer function, check if any of the HWND 's in the array has focus. GetFocus() . It will return BOOL to let you know that somebody in that array has the focus. If nobody in that list has the focus, then hide the dialog using ShowWindow(SW_HIDE) etc. or close it, whatever you want.
5- Create this dialog as Modeless.
6- Now you are good to go.
And about KillFocus() etc, those functions don't work, because if there is even one child (except statics etc) on the window, that child will keep the focus, and the parent will never get the focus.
Hope that helps.
this is this.
|
|
|
|
|
khan++ wrote: 3- Now start the timer at about 100ms etc. SetTimer(2,100,NULL);4- In the timer function, check if any of the HWND's in the array has focus. GetFocus(). It will return BOOL to let you know that somebody in that array has the focus. If nobody in that list has the focus, then hide the dialog using ShowWindow(SW_HIDE) etc. or close it, whatever you want.
Hi Khan,
Sorry to trouble you again... Isn't that very Memory/CPU cosuming operation of checking focus every 100 MS.. as I believe you very well versed that timer is very scared resource and should be used properly.
Secondly, you are right that Kill Focus will not work in case of Model Dialog.. as Dialog should be closed to give focus back to parent. but what about ModelLess Dialog... you can easily close it down on receiveing KillFocus message
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi Alok.
About the CPU consumption, I don't think it will make much difference. There may be like 20 children on the dialog, so it will check GetFocus() 20 times, which does not make much difference, but you can always make the timer longer, like 250ms etc.
And this technique will work for modeless dialogs only. Quite opposite to what it sounds, the modeless dialog will not get a KillFocus message if there is even one child (non-static based) on the dialog. The child always likes to keep the focus, and the parent will never receive the KillFocus message. Hence, I use this technique.
this is this.
|
|
|
|
|
khan++ wrote: I don't think it will make much difference. There may be like 20 children on the dialog, so it will check GetFocus() 20 times, which does not make much difference, but you can always make the timer longer, like 250ms etc.
Hai Brother! what about making seperate thread for same ?.. anyways Parents will receive kill focus message when user click or take keyboard focus outside of the parent reach ...
any way i agree with you solution, Bro!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
NS17 wrote: Could anybody help me, please?
handle WM_KILLFOCUS message
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Thank you...
But this is not a complete solution.
The focus will be in some other control in the main dialog. I can't change that. So killfocus will not work.
Typical examples of my need is the dropdown list of the combobox control, context menu, etc. I need the same behaviour. But in my case there will be some controls like scrollbar, buttons etc.
- NS -
|
|
|
|
|
Hello,
Ive got a Visual C++ Forms project and within it Im trying to get the device context for the whole screen. I used both:
<br />
using namespace System;<br />
using namespace System::ComponentModel;<br />
using namespace System::Drawing;<br />
using namespace System::Windows::Forms;<br />
<br />
hDC = ::GetDC(NULL);<br />
<br />
<br />
hDC = ::CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL);<br />
Both statements returned an error code of 5 when using GetLastError, which is Access Denied. I have no idea what this really means. Any ideas how I can get either of these statements to work?
Regards,
Mark
-- modified at 6:29 Friday 24th February, 2006
|
|
|
|
|
GetLastError returns the error-code of the *last* error to occur, not the result of the last API to be called (which could have been successful).
If GetDC / CreateDC return a non-NULL HDC then the calls succeed and GetLastError is meaningless.
James
http://www.catch22.net
|
|
|
|
|
Thanks for your reply but GetDC and CreateDC to not return anything.
The variables they assign to remain NULL, thats why I used GetLastError to see what was the problem. I just dont understand the meaning of Access is Denied in this case??
Mark
|
|
|
|
|
I use SetBkColor and SetTextColor methods in
OnCtlColor to paint editboxes, listboxes and
comboboxes with my colors instead of with
default Windows colors.
I don't know to override colors for selected items
or selected text.
Can someone help me ??
Thanks a lot !!!!
|
|
|
|
|
|
Nibu..
Recently i too have come aroung with changing selection color in the edit box. But it is very hard. the edit dosen't get any paining message when we select a text. Also i didn't find a way to owner draw the edit control. Do u have any other idea?
nav
|
|
|
|
|
|
Dear every one;
I am addressing my question to those of you who have sufficient knowledge of IE programming. I am sorry if i am posting in the wrong place.
After implementing a IE web browser using the Microsoft WebBrowser Control. I am aiming to extract the size of text within a specific web page and compare it.
Do you think its possible to compare the size of different textual elements (headers, paragraphs, ...) ?
I am asking this because text size in html comes in different formats, fonts, weights ... "not standard"
A way to solve that would be getting the height of the lines. But I have no idea how to do that.
Please be generous with your suggestions
Thank you
llp00na
|
|
|
|
|
Hi,
I want to make a plugin for IE.
What it has to do is catch all the requests that are done while IE is loading a certain page and search through those requests for requests to video files.
What I have right now is that in Invoke() method I can catch IWebBrowserEvents and get the IWebBrowser2 url.
Here is the code that does it:
<br />
STDMETHODIMP CIEPlugin::Invoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags,<br />
DISPPARAMS* pDispParams, VARIANT* pvarResult,<br />
EXCEPINFO* pExcepInfo, UINT* puArgErr)<br />
{ <br />
switch (dispidMember)<br />
{<br />
case DISPID_BEFORENAVIGATE2:<br />
break;<br />
case DISPID_NAVIGATECOMPLETE2 : <br />
BSTR url;<br />
IWebBrowser2* m_spWebBrowser2;<br />
m_spWebBrowser2->get_LocationURL(&url);<br />
break;<br />
case DISPID_DOCUMENTCOMPLETE: <br />
break;<br />
default:<br />
break;<br />
}<br />
return S_OK;<br />
}<br />
Although I receive more DISPID_NAVIGATECOMPLETE2 events I cannot get their http headers and urls.
Can you please give me some hint how can I catch the HTTP headers that IE receive while accesing a page?
Thanks in advance.
|
|
|
|
|
Well, all u need to do is to add a NavigateComplete2Explorer1 event handler. This event handler will allow you to access the full url path along with the http headers
I hope this is usefull
llp00na
|
|
|
|
|
Where do I get this NavigateComplete2Explorer1 event ? I could not find any specification about it in msdn, can you give some more details ?
|
|
|
|
|
Are you using an activeX control for your web application ???
llp00na
|
|
|
|
|
I'm not sure what an activex is, but the plugin I'm writing is registering as COM component. What should my plugin do to be an activex and how after that I can access the NavigateComplete2Explorer1 event?
Can you forward me to some documentation or stuff?
Thank you.
|
|
|
|
|
Ah, i see. I thought you are using an MFC application to host your web browser "Which is off course much easier".
Are you trying to build a web browser ???
if you want your web pages to be rendered through a microsoft webbrowser activeX control, all you need to do is to go to your dialog box (or whatever u r using as a container) and insert an ActiveXControl (microsoft web browser).
However, if you not trying to render web pages then i have no clue how to do it.
llp00na
|
|
|
|
|
llp00na wrote: Are you trying to build a web browser ???
actually i believe he is trying his hand in BHO..
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|