I am trying to programmatically refresh a calc document (libreoffice) in C# and I get error
"unable to cast transparent proxy to type
unoidl.com.sun.star.util.XRefreshable"
Please see below the code I use
XRefreshable refreshable = (XRefreshable) document;
where document is of type XComponent
Related
I'm trying to use Quartz in a new Project with windows10 and .net4. I've added "Windows\system32\quartz.dll" to may Project and I can play audio files without a problem.
The problem arises when using the "Owner" property in order to show video, I get a conversión error in runtime. This is the sample code:
Panel panel = new Panel();
FilgraphManagerClass graphManager = new QuartzTypeLib.FilgraphManagerClass();
graphManager.Owner = panel.Handle.ToInt32();
graphManager.RenderFile(#"c:\temp\simple.mp4");
This is the error message:
System.InvalidCastException: Specified Cast is not valid
I have a problem with FilePicker in Windows Phone 8.1
I'm set up a FilePicker object like that:
FileOpenPicker filePicker = new FileOpenPicker();
filePicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
filePicker.ViewMode = PickerViewMode.List;
filePicker.FileTypeFilter.Add(".xml");
filePicker.FileTypeFilter.Add(".txt");
filePicker.PickSingleFileAndContinue();
view.Activated += View_Activated;
Before that I'm setting up a view object:
view = CoreApplication.GetCurrentView();
File Picker is invoked properly, I'm selecting a file, after that I got unhandled exception in App class.
"Error in line 1 position 229. Element 'http://schemas.microsoft.com/2003/10/Serialization/Arrays:anyType' contains data of the 'http://schemas.datacontract.org/2004/07/SQLite:Task' data contract. The deserializer has no knowledge of any type that maps to this contract. Add the type corresponding to 'Task' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer."
View_Activated method is never invoked.
What can be wrong?
You shouldn't be using the activated for the page. The activation process should start in the App.xaml.cs
Check this link for SilverLight: https://msdn.microsoft.com/en-us/library/windows/apps/dn642086(v=vs.105).aspx
Check this link for normal: https://www.jayway.com/2014/04/16/windows-phone-8-1-for-developers-contracts/
You are not showing the code that generates the error. Based on the error you should show us the code that handles the selected file. The error says that the XML could not be parsed. So the file is selected, just not parsed correctly
I think the timeline is: FilePicker => Parse => View
Since the error is in the Parsing, the view is never activated
If you need help with the parsing error you should ask a new question with the parsing code in it.
When trying to obtain the current item with focus in an outlook 2013 addin I get this exception: An exception of type 'System.MissingMemberException' occurred in System.Dynamic.dll but was not handled in user code
Additional information: Error while invoking [PROPERTYGET, DISPID(0)].
The code throwing the exception is this:
Inspector curObj = Globals.ThisAddIn.Application.ActiveInspector();
Object curItem = curObj.CurrentItem();
The second line throws the exception. The addin is launched from a button on the ribbon when in the create message window.
What is the proper way to access the current item as I think I'm doing it wrong which is causing the issue, since it's saying CurrentItem is not a member. The VBA code examples do it similar to this, but in C# CurrentItem doesn't seem to work the same.
CurrentItem is a property, not a method.
I am using POS tagger for a project and it works successfully when it reads the tagger file from my computer (project's folder).
But I need to upload the tagger file first and read the tagger file from a URL.
To do so, I have uploaded the POS tagger file and I am trying to read the tagger file by giving the URL to the constructor of the MaxentTagger method: (my code is in C# and I have overridden the MaxentTagger class so it's constructor looks like this:
public Tagger ()
{
java.io.ByteArrayInputStream inputStream = new java.io.ByteArrayInputStream(System.IO.File.ReadAllBytes(#"C:\models\english-left3words-distsim.tagger"));
base.readModelAndInit(null, new java.io.DataInputStream(inputStream), false);
}
However I get this error when I run my code:
"An unhandled exception of type 'java.lang.RuntimeException' occurred in stanford-postagger.dll
Additional information: java.io.FileNotFoundException: Could not find a part of the path 'C:\u\nlp\data\pos_tags_are_useless\egw4-reut.512.clusters'."
Does anybody know why this happens and how I can resolve this? I appreciate any sort of help very much!
This error comes from the program trying to load a file which gives the distributional similarity mapping from words to clusters. It's trying to get it from the location that is specified in the training properties file (and you naturally don't have a file at that location). This happened because you don't have a properly initialized TaggerConfig object at the time readModelAndInit() is called. The way it gets initialized is unintuitive (was badly architected), but you're only encountering this because you're trying to use a non-public API.
Why can't you just use the public API as follows?
MaxentTagger base = new MaxentTagger("http://my.url.com/models/english-left3words-distsim.tagger");
I have documentum developer edition 6.6. I want to get document content (read content into stream) using DFC in c#. I have used following C#.net code
IDfId id = collection.getId("r_object_id");
IDfDocument doc = (IDfDocument) session.getObject(id);
but it throws following exception.
Exception: Unable to cast COM object of type 'System.__ComObject' to
interface type 'DFCLib.IDfDocument'. This operation failed because the
QueryInterface call on the COM component for the interface with IID
'{EFAC2D68-175B-11D2-9927-006097C27C31}' failed due to the following
error: No such interface supported (Exception from HRESULT: 0x80004002
(E_NOINTERFACE)).
I also tried following method(it runs successfully) but i don't know how to read content into stream or memory stream.
IDfId id = collection.getId("r_object_id");
IDfSysObject sysObject = (IDfSysObject) session.getObject(id);
This will dump the file to a local filesystem path:
IDfId id = collection.getId("r_object_id");
IDfSysObject sysObject = (IDfSysObject) session.getObject(id);
sysObject.getFile(<path>)
Then you can open the file as a stream using standard .Net IO libraries, for example:
var stream = new System.IO.StreamReader(<path>)
I believe the DFC has some stream-based public methods (getContent?) but I have not seen them used successfully from .Net. However, I will suggest that you take a look at the DFS (Documentum Foundation Services) API instead of DFC. This is the supported API now and DFC is deprecated as a public API. DFS does have stream options when dealing with repository content.
You may also want to check http://developer.emc.com if this answer is not sufficient for your needs.
The exception says it cannot convert the COM Object to IDfDocument.
I would guess your target is not a document then.
It is weird for non-document sysobject to have a content, but it's still allowed.
The content could then be read with getFile as suggested in the other answer.