|
Hi again,
I discovered a new problem and I have to share this with you as I can't solve this on my own...
My Browser Helper Object creates a window (inherits from CDialogImpl). I've managed to position this window in the lower right corner of Internet Explorer but the problem is that whenever the user resizes or moves Internet Explorer, my window stays put. I would like to move my little window as the parent window (IE) moves.
How can my window react upon move/resize messages from the parent window (IE)?
BTW: My window steals the focus once it's displayed, how can I give the focus back to IE?
All help is grea... well, you know I love you guys!
/T
|
|
|
|
|
Tommy Svensson wrote: BTW: My window steals the focus once it's displayed, how can I give the focus back to IE?
I can answer this part of your qestion.
Get handle to browser, as stated in last reply. And use SendMessage.
i.e.
SendMessage(hWnd,WM_SETFOCUS,0,0);
|
|
|
|
|
Thx Prasad, the latter part now solved! Thx.
Still, this question remains unanswered:
My Browser Helper Object creates a window (inherits from CDialogImpl). I've managed to position this window in the lower right corner of Internet Explorer but the problem is that whenever the user resizes or moves Internet Explorer, my window stays put. I would like to move my little window as the parent window (IE) moves.
How can my window react upon move/resize messages from the parent window (IE)?
/Tommy
|
|
|
|
|
Tommy Svensson wrote: How can my window react upon move/resize messages from the parent window (IE)?
If you manage to get a handle to IE's main window (a HWND), then you have the alternative to subclass that window, and trap relevant messages.
Please have a look at CContainedWindowT<Tbase, TWinTraits>, ALT_MSG_MAP(), and Subclass().
Here's the pseudo code:
class YourControl {
...
CContainedWindow m_wndIE;
BEGIN_MSG_MAP(YourControl)
...
ALT_MSG_MAP(1)
MESSAGE_HANDLER(WM_SIZE, OnIESize)
END_MSG_MAP()
};
YourControl::YourControl() : m_wndIE(this, 1 Unless IE is doing something totally radical, this approach should work. I'm assuming that IEs message pump is the same thread as your control. If it's not, well, then I'm not so sure that it'll work.. Lycka till!
--
Verletzen zerfetzen zersetzen zerstören
Doch es darf nicht mir gehören
Ich muss zerstören
|
|
|
|
|
Hi all,
I have developed a Browser Helper Object (Internet Explorer) and I have smart pointers to my html document, my web browser and so on. Is there any way I can find out if the current document/webpage has any visible scrollbars (horz/vert)?
/Tommy
|
|
|
|
|
You can get handle to main window by using IWebBrowser2::get_HWND .
I could not find API to get visibilty of scrollbars.
But, see if using this handle , you can find the way out.
ie. By using API's like GetScrollInfo using handle you got.
|
|
|
|
|
I need to implement a GUI which has two panes with some draggable line between them that resizes both of them accordingly, like the one in windows explorer between the 'folders' and 'contents'.
It would be best if this would blend in with a dialog-resize class (something that accepts several resize rules and when the dialog resizes makes sure everything is resized like you want). I'm currently using WTL's CDialogResize for this, but it lacks the ability to define scale by percentages.
thanks for your time
|
|
|
|
|
|
System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction:
at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest()
at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request,HttpResponse response, Boolean& abortProcessing)
this code is written in VC++6.0 using the ATL COM
i am using the saop toolkit 2.0 and also have installed MS XML 4.0 and soap 3.0. soanyone can help me in this matter
thanks
|
|
|
|
|
what i understand from the error message is the web service is written using .NET framework.
if that's true,i used to get similar errors when i recompile web service and forget to update web references of the client.
if you already tried that,can you please pass the client code that is giving the error?i've not experienced c++ with web services before,but i think everyone'll want to see the code first
|
|
|
|
|
ISoapSerializerPtr Serializer;
ISoapReaderPtr Reader;
ISoapConnectorPtr Connector;
Connector.CreateInstance(__uuidof(HttpConnector));
Connector->Property["EndPointURL"] = "Address of the webservice";
Connector->Property["SoapAction"] = "WebServices name";
Connector->BeginMessage();
Serializer.CreateInstance(__uuidof(SoapSerializer));
Serializer->Init(_variant_t((IUnknown*)Connector->InputStream));
Serializer->startEnvelope("","http://schemas.xmlsoap.org/soap/encoding/","");
Serializer->startBody("");
Serializer->startElement("Get_Account_Status", "WebServices Name", "","SOAP");
so here is the code the XML Serivice is made in the ASP.net and i am accessing this in VC6.0
i have installed the MSXML4.0 and soap toolkit 2.0 and 3.0
i hope now you can help me thanks
regards salman
|
|
|
|
|
Hi everyone,
I have a project with a menu on it and it notifies me by WM_MENUCOMMAND message.I had to do so,because my menu is dynamically created with values read from registry.Anyway,what I'm doing is theorically easy.This is the code for the WM_MENUCOMMAND event handler:
HMENU menu = (HMENU)lParam;<br />
if (m_SystemVersionInfo.dwMajorVersion <= 4)
index = (int)(wParam >> 16);<br />
else<br />
index = (int)wParam;<br />
int nItems = GetMenuItemCount(menu);<br />
<br />
if (index == nItems - 1)
{<br />
}<br />
else<br />
{<br />
}
the code works fine on Win2K/XP but nItems shows -1 on Win98.the strange thing is GetLastError returns nothing.MSDN says you can not trust GetLastError on Win98 either,so I didn't bother to look up the eroor code (I am unable to debug on Win98).
What could make GetMenuItemCount return -1 only on Win98?
|
|
|
|
|
having tried the "excitinnnng" 'MessageBox Debugging' i've come to a conlcusion that the problem is lParam,which supposedly should carry the handle of the menu,does not carry the handle of the menu which it supposedly should carry...
to get it clear: win98 can't give the correct menu handle for the message WM_MENUCOMMAND.i am unable to find which handle it shows but certainly it is not the right one.
the problem should be that i am creating the menu at runtime,which changes the handle everytime the menu is opened,and dearest win98 can not update the handle.so any function that takes HMENU of the menu returns -1 with GetLastError 0.
but i still need to use GetMenuItemInfo to take the string of the menu item at the correct index,but function also requires the HMENU (which win98 can't give correctly).
any suggestions,anyone?
|
|
|
|
|
I made a ATL project , there was a event called "TestEvent(VARIANT v)" in my connection point interface , when I used the ActiveX in a Delphi7 program , the problem happened .
Delphi7 used COleVariant processed my return value , when I debugged the program , ColeVaraint v = unknown_type . I don't know why , I need help?
ALIC
Happy Christmas !
2006-12-25
|
|
|
|
|
Hi, all
I'm debugging a program which use lots of STL container such as vector, list, etc. in VS2003 and meeting a very boring problem:
I can not see the objects values, such as, all int values in a int vector, in VS debug watch window! I can only see the size of a container. I had to print all values one bye one. This is so inconvenient to make my work process slower.
Do you have any ideas? Thanks a lot!
Remy Zhu
|
|
|
|
|
If you look at std::vector , it has a member _Myfirst . This points at the data held by the vector . So, examining vector_var._Myfirst[0] is the same as evaluating vector_var[0] .
This definitely works in the Command Window and there's no reason why it shouldn't work in a Watch window.
Alternatively, upgrade to VS 2005, as that has debug data visualizers (no, I haven't upgraded either!)
|
|
|
|
|
VS2005 does a much better job with showing the contents of std::vector and std::[w]string . Apparently you can add your own custom visualizers, but I have yet to try this.
|
|
|
|
|
So I understand...
However, we're pretty much stuck with VS2003 (not that I mind too much - I did when we were stuck with VS6!), although I may well sneak a crafty VS2005 onto my PC here We only do native code development here, as I work for a large company, which has a tightly controlled standard Windows build, which doesn't yet include any version of .NET framework. Fortunately, I'm quite happy doing C++.
|
|
|
|
|
We have an ATL object with dual interface type.The interface definition fron the IDL file:
interface IEventSink : IDispatch{
[id(1), helpstring("method testmethod")] HRESULT testmethod(void);
[propput, id(2), helpstring("property ondataavailable")] HRESULT ondataavailable([in] IDispatch* newVal);
};
We invoke the object from javascript as follows:
var esink=new ActiveXObject("IEBrowserSink.EventSink");
esink.testmethod();
esink.ondataavailable=invokecallback;
It works fine;
Now i oveeride the Invoke method in the header file:
STDMETHOD(Invoke)(DISPID dispidMember,REFIID riid, LCID lcid, WORD wFlags,DISPPARAMS * pdispparams, VARIANT * pvarResult,EXCEPINFO * pexcepinfo, UINT * puArgErr)
{
......
return S_OK;
}
After this the calls to the 'testmethod' and 'ondataavilable' from javascript do not go through?
There are no exceptions but the scripts seems to skip these methods.What is wrong?
Are any changes requied in the idl?
|
|
|
|
|
I'm not sure though. Try increasing major/minor version(at all occurances in your project) of your object. I found similar problem with newly added function to interface. And changing minor version does trick.
|
|
|
|
|
Hi everyone!
I've got a dialog based app which contains a toolbar with a dropdown button (which displays a popup menu with a few options).
Now I'd like to add some icons to the toolbar's dropdown button. For that, I have created a CommandbarCtrl m_cmdBar member variable to be able to load images on it and then show them on dropdown's button.
Either the Compiler and the Linker go well but at Run-Time I got a crash at the constructor of the CommandbarCtrl. It says that it crashes when EnterCriticalSection(&m_sec) from the CComCriticalSection class at the atlcore.h file.
I don't know what is happening but I have tryed to create the commandbarctrl in different places (inside the member function I need it or as a global reference variable) thinking that it could be caused by an stack overflow but it always crashes at the constructor and gives the same error "entercriticalsection"
Do anyone konw what I'm doing wrong ??? Do I have to do any kinda initialization before using CCommandbarCtrls??
Cheers in advance
Dani.
|
|
|
|
|
I've got myself into a bit of a pickle.
Visual Studio 6, I have an ATL DLL that uses dialogs (ATL Dialog object). On one dialog, I have a combo box I'm trying to populate using AddString.
In InitDialog I attempt to get a pointer to the combo box:
CComboBox* pComboBox = (CComboBox*)(GetDlgItem(IDC_COMBO1));
This returns a valid pointer from what I can tell.
Then, calling pComboBox->AddString("Test"); throws a debug assertion failure, I beleive GetDlgItem is returning an invalid window handle (the assertion line failure is ASSERT(::IsWindow(m_hWnd));
I'm relatively new to ATL, so I'm sure it's my lack of understanding. Can anyone point me in the right direction please?
|
|
|
|
|
The cast to CComboBox* is MFC, that won't work in an ATL project. You can use WTL to get control wrappers that are similar to the MFC ones.
|
|
|
|
|
Thanks Mike...
So I need to upgrade to Visual Studio 2005??? I'm on 6.0 now and see no reference to WTL...
|
|
|
|
|