How to get IViewObjectPresentSite from web browser control or document - mshtml

IViewObjectPresentSite is part of MSHTML(IE9?) according to http://msdn.microsoft.com/en-us/library/jj206442(v=vs.85).aspx. I am trying to run QueryInterface for IID_IViewObjectPresentSite on webBrowser2 object (received by querying IID_IWebBrowser2) but it returns fails. I tried to query the same on htmlDoc2 object (received by querying IID_IHTMLDocument2) which also fails. I can successfully query for IID_IViewObject on both of these object and get IViewObject back.
Can someone show me how to get IID_IViewObjectPresentSite on the browser or document? I am using the latest Windows 8 SDK and VS2010 and running on Windows 8.
Thanks in advance.

I was able to get it from an ActiveX code,
in the implementation of the function SetClientSite.
Something like:
SetClientSite( IOleClientSite *pClientSite ) {
CComQIPtr<IViewObjectPresentSite, &IID_IViewObjectPresentSite> spIViewObjectPresentSite;
HRESULT hr;
hr = pClientSite->QueryInterface(IID_IViewObjectPresentSite, (void **) &spIViewObjectPresentSite);
}

Related

How to get result from QQuickWebEngineView::runJavaScript

I'm trying to execute javascript on QQuickWebEngineView object in c++ and get returned value. In QML it's easy
view.runJavaScript("document.documentElement.outerHTML", function(result){//do smth})
in c++ method signature for executing js is this:
void runJavaScript(const QString&, const QJSValue & = QJSValue());
and I believe I could use QJSValue to get returned data, but I'm not finding anything on how to use it... maybe someone has an example of how to use QJSValue here. Thanks.

Get CallerId (Username) from incoming call Linphone - Swift

I've just found a simple way to get the some CallLogs (CallerID, Username, To, From, Call duration, Date, Status, ...) from the new Linphone library for swift (SDK 5.0).
I just want to share it with you
Referring to Linphone's documentation, and some testings, I found at least 2 simple ways to retrieve the CallLog and read it:
1. Using CoreDelegateStub
CoreDelegateStub( onCallStateChanged: { (core: Core, call: Call, state: Call.State, message: String) in
So, you can use the call attribute to get the CallerID(Username) for example, like that:
call.callLog?.fromAddress?.username
Remember, the callLog object contains a ton of parameters that you can find in the documentation
2. Using Core from Linphone wrapper
var mCore: Core!
self.mCore.callLogs
In that way, you can retrieve all your call logs in an array, so you will need to choose an item and get the attributes from it like I've shown above.
self.mCore.callLogs[0].fromAddress?.username

Cast Exception When Using Foreach on Microsoft.SharePoint.Client.ListCollection

I have exhausted my resources on this issue. I'm hoping you all can assist me.
I have an agent polling Microsoft O365 for list collections in order to walk through all the lists in a given site. Here is the code:
Microsoft.SharePoint.Client = CSOM
ListCollection lists = CSOM.web.Lists;
clientContext.Load(lists);
clientContext.ExecuteQuery();
try
{
foreach(CSOM.List list in lists
{
do.stuff()
}
}
catch(Excetion ex)
{
// I get this excetpion in my log at CSOM.List after 'in lists' is read.
/*System.InvalidCastException: Unable to cast object of type
'System.Collections.Generic.Dictionary`2[System.String,System.Object]'
to type 'Microsoft.SharePoint.Client.List'.*/
}
When in debug and tracing through the code ex appears 'null', but I still get the excetion in my debug logs when I write ex.ToString() to a log file.
I am using .Net 4.6. This code has worked before, during dev tests, but wont work running in a service. I can't find any Namespace issues. The O365 account I amusing has 2FA disabled and has admin rights. Any thoughts would be very helpful. Thank you.

Obscure behavior with XmlMessageFormatter serializing System.Version

I am using MSMQ together with the XmlMessageFormatter serializer.
mq.Formatter = new XmlMessageFormatter(new Type[] { typeof(TransportEnvelop), typeof(System.Version) } );
msg = new TransportEnvelop(new Version(0, 1, 0, 1), DateTime.Now);
mq.Send(msg);
I am writing out the generated message to the console and the set version
is right there.
If I read back the message from the queue, the System.Verion values is
"0.0" [through Console.WriteLine].
If I look into the queue with the admin tool, I see:
<Version/>
If I replace the System.Version class with my own Version class,
everything is like I expect.
Has someone probably an idea, what I am doing wrong???
Thanks anyway and
best regards,
++mabra
This seems to be a duplicate:
System.Version not serialized
I'm running into a similar problem sending Version as an attribute of a WCF call ,but it's not working now and it used to be fine. I think it's related to an upgrade from VS2010 to VS2012. However, it works just fine locally, but not on the server. So that makes me theorize that it can be influenced by a system configuration or how IIS is set up. I'm not 100% sure where that might be though.

Issue with using polymorphic_path with FactoryGirl build object

I am using factory_girl and rspec2 for my testing. I have an issue with the following code:
let(:book) { build(:book, id: 1) }
book_path(book)
book_path statement is generating /books url instead of /books/1. I can use create, but any suggestions on how to fix this using build strategy?
I am using
rspec-rails (2.11.0)
factory_girl (3.5.0)
Try book.to_param (that's actually what book_path(book) is doing under the hood) and see what it returns. By default to_param returns id, but your book is not saved yet, so it can return nil.