I am using "WebBroswer" in my wpf application to render Google map. So I am calling Pan(x, y) JavaScript method with some parameters form my c# code. But I am getting this below error. > Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME)) My Window2.xaml File: <Window x:Class="Test.Window2" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window2" [...] read more
Based on this solution i tried to call a JavaScript function located in my WebBrowser - control. The .xaml looks like this <Grid> <WebBrowser x:Name="browser"/> </Grid> But neither this code public MainWindow() { InitializeComponent(); browser.NavigateToString("<html><script>function callMe() {alert('Hello');} document.myfunc = callMe;</script><body>Hello World</body></html>"); dynamic doc = browser.Document; doc.myfunc(); } Error > Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: [...] read more
There is a webpage I am trying to extract data from. By looking at the HTML in the page Source, I can find the data I am interested inside script tags. It looks like the following: <html> <script type="text/javascript"> window.gon = {}; gon.default_profile_mode = false; gon.user = null; gon.product = [...] read more
Iam trying to display somekind of help page in html within my wpf application and Ive loaded the html from my resourcers and it contains multiple javascript functions that i want to execute from c#. This is how it should be done: webBrowser1.InvokeScript("MyFunction"); This does not work at all, I [...] read more
I have run into a strange problem, and maybe someone can help me. I am attempting to retrieve the Terminal Services attributes from an Active Directory user using C# on a machine using Windows 10. I am doing this by running a PowerShell script inside my application like so: var [...] read more
In visual studio I am creating an addin, in the addin_startup I am setting an Outlook application to app = (Microsoft.Office.Interop.Outlook.ApplicationClass)(Marshal.GetActiveObject("Outlook.Application")); then I am calling a runMacro function which I got from msdn private void RunMacro(object oApp, object[] oRunArgs) { try { oApp.GetType().InvokeMember("Run", System.Reflection.BindingFlags.InvokeMethod, null, oApp, oRunArgs); } catch (Exception [...] read more
I've been trying to call an invokescript on WPF when the application just loaded. I passed in the parameter that I get from the database to invokescript after the WPF has been loaded. However, I keep getting Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME)) error. I loaded the webbrowser control [...] read more
I have an Internet Explorer BHO that can execute a script on the current website and then read variables that have been assigned in that script. Unfortunately, as of IE9 (I tested with the RC), reading the JS variable results in a HRESULT 0x80020006. The script sets assigns the JS [...] read more
As the title mentions I need a way to get all groups a group is member of in ActiveDirectory. To get all groups a user is member of I use public static DirectoryEntry[] GetGroupsUserIsMemberOf(DirectoryEntry directoryEntry) { ArrayList groupsUserIsMemberOf = new ArrayList(); object groups = null; DirectoryEntry[] userGroupEntries = null; if [...] read more
Okay, my problem right now is we're trying to write code that will add a user to a different group in our Active Directory. This is the solution we've written. Part of the main method: string newGroup = "TestDelete"; string userName = result.Properties["cn"][0].ToString(); string adduser = ad.AddToGroup(userName, newGroup); Console.WriteLine(String.Format("{0} : [...] read more
I have been using the following to set and get terminal server profiles through powershell for years: $user = [ADSI]"LDAP://$dn" $user.psbase.InvokeGet("terminalservicesprofilepath") $user.psbase.InvokeSet("terminalservicesprofilepath",'\\server\share\user') Since upgrading to windows 10 and thus Powershell 5 this no longer works and produces the following error: Exception calling "InvokeGet" with "1" argument(s): "Unknown name. (Exception from [...] read more
Is it practical to call a VBScript function, such as VBScript's Chr(charcode), from Ruby using win32ole? Background: While working out how to add some nicely formatted headers to an excel worksheet, I followed my standard operating procedure: record an excel macro and copy and paste the code. VBScript: ActiveWindow.View = [...] read more
Yes, I do know I need to wait for Navigation_Completed to fire. I have a Windows 8 Store application. In it is a page containing a WebView and a Button. When the Button is clicked, the user is navigated to a new screen. When they are done, they are navigated [...] read more
In order to allow compatibility with another project that is written in .Net 2.0, we have had to come up with a COM interop (the newer application is in .Net 4.0). This would work because the 2.0 process would be able to use SxS execution with .Net 4.0. In order [...] read more
I am trying to achieve the following wmic command using j-interop. wmic /NODE:192.168.0.195 /USER:Test /PASSWORD:password123 process call create "calc.exe" I have my code written like this in my method. I have two other methods that create a session and connect to the WMI service so that part is taken care [...] read more
Windows Phone 8 app, WebBrowser control. I load a chunk of HTML via NavigateToString (after setting IsScriptEnabled=true). Some time later (long after it's loaded), I'm invoking some JavaScript on the page with InvokeScript. When I invoke a JavaScript function that's defined inline inside a <script> element, it works as expected. [...] read more
When using Directory services in IIS7, I am unable to get the invoke(method) to work with the app pool. It consistently returns the unknown name exception. Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME)) I am able to use the InvokeGet command to get property data from the app pool, but [...] read more
I have a COM dll which I was using in my .net project through interop referance. Now I got a requirement to move this COM component to another remote machine and create instance there.(kind of out of machine similar to out of process, probably this is remoting, i don't know [...] read more
I implemented an installscript file of my own that will allow the installer to register dll's. I combined this with a custom action to actually run the function I created. I had to make this script because the dlls were failing to register with setting the property to self register. [...] read more
C# code > error--->>>Unknown name. (Exception from HRESULT: 0x80020006 > (DISP_E_UNKNOWNNAME)) and the code is this using (DirectoryEntry entry = new DirectoryEntry("LDAP://admin-jyt69gl7t.hello/CN=Users,DC=hello")) { entry.Username = username; entry.Password = strOldPassword; DirectorySearcher searcher = new DirectorySearcher(entry); try { searcher.FindOne(); entry.AuthenticationType = AuthenticationTypes.Secure; entry.Invoke("ChangePassword", new object[] { strOldPassword, strNewPassword }); // oDE.Invoke("SetPassword", new [...] read more
I've created a function "Query-ComDomElements.ps1" to query HTML objects. This works quite well when querying only one object and querying that again. When I try calling it in recursion it however fails and I don't understand why. The code/objects is/are the very same. Could anyone please enlighten me why the [...] read more
I making a simple news feed UWP app, using WebView to show the details of the news, for some reasons I need to use buttons to control it scroll up and down instead of using scrolling bar. But I have This error: Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME). the [...] read more
I am running ruby script via terminal on windows instance “Windows Server 2012 R2” but facing error I.e. “unknown property or method: `Wait' HRESULT error code:0x80020006 Unknown name. (NoMethodError) “ Where as the same script is working on my windows machine. Note: Ruby version, DevKit, Gems, Ruby code & mode [...] read more
I am calling javascript functions from C# using the WPF variant of the browser control via InvokeScript. I can call my function once without any problems. But when I call it a second time, it throws the following error : > Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME)) The Code [...] read more
This script works when running in PowerShell ISE (it sets the given user's Remote Desktop Services Profile settings in Active Directory): Get-ADUser FirstName.LastName | ForEach-Object { $User = [ADSI]"LDAP://$($_.DistinguishedName)" $User.psbase.invokeset("TerminalServicesProfilePath","\\Server\Share\HomeDir\Profile") $User.psbase.invokeset("TerminalServicesHomeDrive","H:") $User.psbase.invokeset("TerminalServicesHomeDirectory","\\Server\Share\HomeDir") $User.setinfo() } But when I try running it from a C# application I get an error for each [...] read more
3rd line returns COMException. oBooks.GetType().Invoke... Dim oBooks As Microsoft.Office.Interop.Excel.Workbook = Me.fOpenXlsFile(strXLSFile) Dim ci As System.Globalization.CultureInfo = New System.Globalization.CultureInfo("en-US") oBooks.GetType().InvokeMember("Add", Reflection.BindingFlags.InvokeMethod, Nothing, oBooks, Nothing, ci) For i As Int32 = 0 To objLv.Items.Count - 1 oBooks.Styles.Item(i + 1).Interior.Color = objLv.Items(i).BackColor Next oBooks.Save() read more
Is there a way to change who an email is from using win32ole? outlook = WIN32OLE.new('Outlook.Application') message = outlook.CreateItem(0) message.Subject = 'Test email' message.Body = 'This is the test body' message.To = 'test@test.test' message.From = ''me@me.me' #<= This doesn't work message.Save message.Send When you run message.From you get the following [...] read more
I have a new requirement to change the way we reference a COM+ object. Before it was fine to add it through the Add References and find the COM object from the list though the TypeLib name. This has now been changed and I am trying to figure out how [...] read more
I am having a problem when trying to CreateVideo from a PowerPoint using the NetOffice. My code is var app = new Application(); app.Visible = MsoTriState.msoTrue; var press = app.Presentations.Open(data.LocalFileName); //This is the error break: press.CreateVideo(data.VideoLocalFileName); I am getting Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME)) in the inner exception. [...] read more
The returned type of namespaceObjType is a System.__ComObject and it's impossible to call InvokeMember("OpenSharedItem", ...) on it. How do you need to call this method with the late binding technique? The only difference I see is that the returned object type of the Session property is only an interface instead [...] read more
$Credential = Get-Credential [System.DirectoryServices.DirectoryEntry]$dm = new-object System.DirectoryServices.DirectoryEntry( "LDAP://DC1/DC=MyDom,DC=COM", $($Credential.UserName), $($Credential.GetNetworkCredential().password ), [System.DirectoryServices.AuthenticationTypes]::Secure ) $dm::Exists("LDAP://OU=TestOU,DC=MyDom,DC=COM") I'm trying to use the static Exists method, but when I do like the above I receive: "Unable to cast object of type 'System.DirectoryServices.DirectoryEntry' to type 'System.Type'." If I change to: $dm.Exists("LDAP://OU=TestOU,DC=MyDom,DC=COM") I recieve: "Exception calling [...] read more
I have made a COM object with multiple dual interfaces. It worked in an earlier version of compiler, but not in the current version. My question: Does the COM spec say this should work (and therefore I should report a compiler bug), or is not meant to work? This page [...] read more
I am trying to change the password of a particular user you can find code below var directoryEntryObject = new DirectoryEntry("LDAP://<IP>","administraor", "password"); baseObject.directoryEntryObject.Invoke("SetPassword", new object[] { "test@123" }); baseObject.directoryEntryObject.Properties["LockOutTime"].Value = 0; baseObject.directoryEntryObject.Close(); Now i am getting below Error :: > Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME)) read more
I'm trying to read the terminal service profile path for a selected AD user using the following code snip. ... using System.DirectoryServices; using System.DirectoryServices.ActiveDirectory; ... try { Debug.WriteLine("Looking for: " + DisplayName); DirectoryEntry entry = new DirectoryEntry(strLDAP, strUserName, strPassword); DirectorySearcher Searcher = new DirectorySearcher(entry); Searcher.Filter = "(displayName="+ DisplayName +")"; SearchResult [...] read more
I am using jinterop as dcom bridge . Using CLASSID i am able to create com object. // Create a session JISession session = JISession.createSession("domain", "user", "password"); session.useSessionSecurity(true); // JISystem.setAutoRegisteration(true); JIComServer comServer = new JIComServer( JIClsid.valueOf("E4BE20dd4-9F1-4B05-9117-AFB4B295"), "ipaddress", session); // Instantiate the COM Server IJIComObject comObject = comServer.createInstance(); IJIDispatch ieObjectDispatch = [...] read more
I'm trying to create a virtual directory on a remote server using DirectoryServices by cloning the settings of another virtual directory, but I get a COMException: Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME)) when invoking AppCreate. This is the code I've written (simplified with most of tests removed): public bool [...] read more
Does anyone know why I am getting (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME)) when attempting to invoke a javascript function in a WPF application (.Net 4)? The browser control is hosted inside an application and is being used with local html files, e.g: C:\Users\XXXX\AppData\Roaming\XXXX\Books\XXXX_revision_1_1\html\1\med-9780198569244-chapter-4 This file has a javascript include - [...] read more
I have tried multiple times now to install jdk 8 in my windows 7 64-bit machine but have failed. I have downloaded the 8u111 setup file named "jdk-8u111-windows-x64.exe" and 8u112 setup file named "jdk-8u112-windows-x64.exe" from Oracle downloads page and have tried to install the jdk with both versions. I am [...] read more
I'm trying to create a custom Ribbon with a button that triggers a VBA Macro in Outlook 2010. Creation of the ribbon itself works fine but the button doesnt trigger the VBA. I've tried these solutions: 1) How-to: Run existing Word VBA Macros from C# Ribbon Addin but it throws [...] read more
I have an Excel document that is created using Excel Interop written in VB.net. Adapting information from this post, I am able to successfully create a workbook and write its CustomDocumentProperties using: Dim objNewApp As Excel.Application Dim objNewBook As Excel._Workbook Dim objNewBooks As Excel.Workbooks objNewApp = New Excel.Application With { [...] read more
I'm using Microsoft Toolkit Web View to embed Microsoft Edge in my WPF C# application. I can't find anyway to get document and innerHTML of webview and there's nothing in documentation. Here's XAML : <UserControl x:Class="webviewtest.MainControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:webv="clr-namespace:Microsoft.Toolkit.Wpf.UI.Controls;assembly=Microsoft.Toolkit.Wpf.UI.Controls.WebView" xmlns:local="clr-namespace:webviewtest" mc:Ignorable="d" Width="500" Height="500" > <Grid> <webv:WebView x:Name="webview_browser" Margin="0" [...] read more
I am newbie in COM. I am having a trouble on creating a plugin for an own software that would intercept traffic on a third party software by the clsid: All information by the third party owners --> *clsid: 0BBB797E-D6A8-40F9-B5D1-8E72F4729A03 *event to receive data - OnRecvData(NetworkData) //NetworkData type of string [...] read more
This Event handler returns: > System.Runtime.InteropServices.COMException: 'Unknown name. (Exception from > HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME))' Code: private void Browser_Loaded(object sender, NavigationEventArgs e) { browser.InvokeScript("Document.Body.Style =" + "zoom:80%"); } i have tried many solutions found online, but none seem to work for me please advise read more
I am using a webview to display a certain html file, However, when I call InvokeScriptAsync, I keep encountering the error. "Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME))". This occurs eventhough the script is called in NavigationComplete or DOMContentLoaded. I prepared a simple app to debug this problem and I [...] read more
I'm working Api call dll for Excel with VB.Net. (Robert Giesecke' s unmanaged exports) Standard types (numeric, strings) are working. But, when try with object type return error. Error message is: "Unknown name. (HRESULT exception returned: 0x80020006 (DISP_E_UNKNOWNNAME))" My function is (Error is IPictureDisp To Bitmap): Public Function GetTextQR_FromPicture(ByVal pictureDisp [...] read more
I have Outlook 2016 running. The following script runs without a problem from SciTE or the command line. However, the script fails when run from Task Scheduler. Why does it fail when run from Task Scheduler? What can I do to fix this? Script: #include <MsgBoxConstants.au3> $error = ObjEvent("AutoIt.Error", "ErrFunc") [...] read more
Because until know what people have been doing are just calling the Script that already exists in the actual webpage. private void LoadHtml() { WebViewControl.Source = new Uri("https://www.twitter.com"); } First I load a page whose style I would like to modify. I can do this by injecting the CSS file [...] read more
I have a problem with my C# code where I want to display all groups under one specific group, called L_P001xxx. What I want in the end is that beginning with the group L_P001xxx and I want to display all groups until level 3 and in level 3 I want [...] read more
I am trying to get the profile path from the Remote Desktop Services Profile tab in AD. I picked a few users to test with and each user has a path in that tab. (picture below) Each time I try and get this field through PowerShell I am disappointed to [...] read more
Hi I am trying to reset password of Active Directory User But I Am getting error,Following is my Code: public string ChangePassword(string Identity,string OldPassword, string Password) { string success = "Success"; try { DirectoryEntry UserEntry = null; DirectoryEntry entry = new DirectoryEntry("LDAP://.../DC=Domain,DC=COM", Identity, OldPassword); DirectorySearcher search = new DirectorySearcher(entry); SearchResult [...] read more
I'm trying to automate openoffice calc through ole automation from a c# application. I'm opening a document and saving it again. Code is mostly downloaded from Apache web site with few modifications. private void OpenSave(string FileAddress)//format: "file:///C:/Untitled1.ods" { Type t_OOo= Type.GetTypeFromProgID("com.sun.star.ServiceManager"); Object objServiceManager= System.Activator.CreateInstance(t_OOo); // arguments for IDispatch-call Object[] parameters [...] read more
The query for some AD users TS Home Directory below, leads to an DotNetException. What is wrong with my code? And what is this exception trying to tell me? $userObject = Get-ADUser someUser -Properties * $userObject.userParameters $adsiObject = [adsi]"LDAP://$($userObject.DistinguishedName)" $adsiObject.PSBase.InvokeGet("TerminalServicesHomeDirectory"); Output: PCtxCfgPresent㔵攱戰ぢCtxCfgFlags1〰て〲〹CtxCallback〰〰〰〰CtxShadow㌰〰〰〰(CtxMaxConnectionTime〰〰〰〰.CtxMaxDisconnectionTime〰〰〰〰CtxMaxIdleTime〰〰〰〰"CtxKeyboardLayout〰〰〰〰*CtxMinEncryptionLevel CtxWorkDirectory〰 CtxNWLogonServer〰CtxWFHomeDir〰"CtxWFHomeDirDrive〰 CtxWFProfilePath〰"CtxInitialProgram〰"CtxCallbackNumber〰 Exception calling "InvokeGet" with [...] read more
I have a VB6 project I need to migrate to VB.NET. I tryied with both the migrating tool of VB.NET express 2005 and 2008 with the same result. When I try to open a form in designer mode containing a videosoft's vsindextab component in the resulting project of the migration, [...] read more
I know this is ugly and I know I should have it in try blocks I've just been tinkering trying to get it to work. I'm missing something here and I would really appreciate some help figuring it out. All I'm trying to do is to create a page with [...] read more
I'm trying to retrieve a track object from its persistent ID using AutoHotkey (v1.1) and iTunes Windows 11. The script works well until I try to use the ItemByPersistentID method. objITunesunesApp := ComObjCreate("iTunes.Application") objITunesLibrary := objITunesunesApp.Sources.Item(1) objITunesPlaylist := objITunesLibrary.Playlists.Item(1) objITunesTrack := objITunesPlaylist.Tracks.Item(1) ; Test if objects are OK MsgBox, % [...] read more
I am trying to get Win32_SoundDevice and Win32_VideoControllerHardware id but getting Win32_SoundDevice instance throws Unknow Name Exception here is my code package com.az; import static org.jinterop.dcom.core.JIProgId.valueOf; import static org.jinterop.dcom.impls.JIObjectFactory.narrowObject; import static org.jinterop.dcom.impls.automation.IJIDispatch.IID; import java.awt.Label; import java.util.logging.Level; import javax.swing.JApplet; import javax.swing.JLabel; import javax.swing.SwingUtilities; import org.jinterop.dcom.common.JIException; import org.jinterop.dcom.common.JISystem; import org.jinterop.dcom.core.IJIComObject; import org.jinterop.dcom.core.JIArray; [...] read more
I am developing an excel addin and in this addin there are several AppDomains. I need to have access to some shared data across each AppDomain so I decided to use a cross-AppDomain singleton. I followed what was described in this thread : http://www.dolittle.com/blogs/einar/archive/2007/05/18/cross-appdomain-singleton.aspx Because this is an excel addin, [...] read more
I'm trying to delete AD users and groups with PowerShell, however I'm getting an "Unknown name" exception. Code: function RemoveADEntry($dn) { $entry = New-Object System.DirectoryServices.DirectoryEntry("LDAP://$dn") $entry.DeleteTree() } Result: Exception calling "DeleteTree" with "0" argument(s): "Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME))" At :line:9 char:18 + $entry.DeleteTree <<<< () Calling Get-Member [...] read more
In our WPF-application that is hosted in IE we are retrieving some context info from a COM-object which has the type of System.__ComObject (JScriptTypeInfo). We retrieve data from it using its type: Type type = obj.GetType(); object value = type.InvokeMember(name, BindingFlags.GetProperty | BindingFlags.IgnoreCase, null, obj, null); where name is the [...] read more
I'm trying to open Outlook NewMail with C# code (without COM) but unfortunately I obtain the following error code: 0x80020006 (DISP_E_UNKNOWNNAME) The c# code is just below. -------------------------------------------------------------------------------- using System; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Windows.Forms; using Erp.Adapters; using Erp.UI; using Ice.Lib; using Ice.Adapters; using Ice.Lib.Customization; using Ice.Lib.ExtendedProps; [...] read more
I'm writting a C# application which use one of the dll written in C++ as reference. I can use that dll namespace and my project compiles fine. However when I run it I keep getting error in one of the line where I assign a property its value. The exception [...] read more