Search Results

Search found 800 results on 32 pages for 'interop'.

Page 5/32 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • To what degree should I use Marshal.ReleaseComObject with Excel Interop objects?

    - by DanM
    I've seen several examples where Marshal.ReleaseComObject() is used with Excel Interop objects (i.e., objects from namespace Microsoft.Office.Interop.Excel), but I've seen it used to various degrees. I'm wondering if I can get away with something like this: var application = new ApplicationClass(); try { // do work with application, workbooks, worksheets, cells, etc. } finally { Marashal.ReleaseComObject(application) } Or if I need to release every single object created, as in this method: public void CreateExcelWorkbookWithSingleSheet() { var application = new ApplicationClass(); var workbook = application.Workbooks.Add(_missing); var worksheets = workbook.Worksheets; for (var worksheetIndex = 1; worksheetIndex < worksheets.Count; worksheetIndex++) { var worksheet = (WorksheetClass)worksheets[worksheetIndex]; worksheet.Delete(); Marshal.ReleaseComObject(worksheet); } workbook.SaveAs( WorkbookPath, _missing, _missing, _missing, _missing, _missing, XlSaveAsAccessMode.xlExclusive, _missing, _missing, _missing, _missing, _missing); workbook.Close(true, _missing, _missing); application.Quit(); Marshal.ReleaseComObject(worksheets); Marshal.ReleaseComObject(workbook); Marshal.ReleaseComObject(application); } What prompted me to ask this question is that, being the LINQ devotee I am, I really want to do something like this: var worksheetNames = worksheets.Cast<Worksheet>().Select(ws => ws.Name); ...but I'm concerned I'll end up with memory leaks or ghost processes if I don't release each worksheet (ws) object. Any insight on this would be appreciated.

    Read the article

  • Using Interop.Word, is there a way to do a replace (using Find.Execute) and keep the original text's

    - by AJ
    I'm attempting to write find/replace code for Word documents using Word Automation through Interop.Word (11.0). My documents all have various fields (that don't show up in Document.Fields) that are surrounded with brackets, eg., <DATE> needs to be replaced with DateTime.Now.Format("MM/dd/yyyy"). The find/replace works fine. However, some of the text being replaced is right-justified, and upon replacement, the text wraps to the next line. Is there any way that I can keep the justification when I perform the replace? Code is below: using Word = Microsoft.Office.Interop.Word; Word.Application wordApp = null; try { wordApp = new Word.Application {Visible = false}; //.... open the document .... object unitsStory = Word.WdUnits.wdStory; object moveType = Word.WdMovementType.wdMove; wordApp.Selection.HomeKey(ref unitsStory, ref moveType); wordApp.Selection.Find.ClearFormatting(); wordApp.Selection.Find.Replacement.ClearFormatting(); //tried removing this, no luck object replaceTextWith = DateTime.Now.ToString("MM/dd/yyyy"); object textToReplace = "<DATE>"; object replaceAll = Word.WdReplace.wdReplaceAll; object typeMissing = System.Reflection.Missing.Value; wordApp.Selection.Find.Execute(ref textToReplace, ref typeMissing, ref typeMissing, ref typeMissing, ref typeMissing, ref typeMissing, ref typeMissing, ref typeMissing, ref typeMissing, ref typeMissing, ref replaceTextWith, ref replaceAll, ref typeMissing, ref typeMissing, ref typeMissing, ref typeMissing); // ... save quit etc.... } finally { //clean up wordApp } TIA.

    Read the article

  • How to check whether a excel file is write protected or not in C#?

    - by Pavan Navali
    Hi, I'm developing a sample application in which I have to open an excel file and check whether the file is write protercteed or not. The code is using System.Windows.Forms; using Microsoft.Office.Core; private void button1_Click(object sender, EventArgs e) { string fileNameAndPath = @"D:\Sample\Sample1.xls"; // the above excel file is a write protected. Microsoft.Office.Interop.Excel.Application a = new Microsoft.Office.Interop.Excel.Application(); if (System.IO.File.Exists(fileNameAndPath)) { Microsoft.Office.Interop.Excel.ApplicationClass app = new Microsoft.Office.Interop.Excel.ApplicationClass(); // create the workbook object by opening the excel file. app.Workbooks.Open(fileNameAndPath,0,false,5,"","",true,Microsoft.Office.Interop.Excel.XlPlatform.xlWindows,"\t",false, true, 0,false,true,0); Microsoft.Office.Interop.Excel._Workbook w = app.Workbooks.Application.ActiveWorkbook; if (w.ReadOnly) MessageBox.Show("HI"); // the above condition is true. } } I would like know whether the file is write protected or not.

    Read the article

  • Which collection interface should I use in .NET for COM-interop?

    - by jhominal
    That is a followup from my previous question, but you don't need to read it to understand that one. I'm designing an interface in .NET that would be consumed from COM applications (mainly VB6, but Visual C++ 6 is also a possibility) and I would like to use Collection types as argument and return types for the methods in the interface. Questions: What happens to the VB6 built-in collection types (arrays, collections, dictionaries) when they go through interop? My current guess is that: arrays - System.Array collections - Microsoft.VisualBasic.Collection dictionaries - System.Collections.Hashtable Is that correct? Which interfaces should I use as return types? IEnumerable, ICollection, IList, IDictionary? Would I be able to do a For Each in VB6 to iterate over these interfaces? Should I use the generic or non-generic variants of the interfaces?

    Read the article

  • COM interop, Office 2010 x64 and Visual Studio 2010.

    - by Snake
    Hi, I just installed Offic 2010 x64 on my Windows 7 x64 laptop. It already had Visual Studio 2010 on it. Now I try to add Microsoft.Office.Interop.Excel or something to the project, but it just can't find the project. When I try to open a project from the website of Microsoft (a sample of Office development) Visual Studio says that that kind of project is not supported. How is this possible? Is it a problem that I installed x64 of Office? Or is the problem Visual Studio 2010? Thanks

    Read the article

  • .NET Excel Interop - Why aren't my Footers displaying in my printed output file?

    - by Ryan
    I'm working with C# and Office 2007's Excel Interop API. I'm opening an Excel file, applying some formatting and then sending it to the printer. I've got a problem, though. The Footer text doesn't appear to be printing. If I check the PageSetup.RightFooter property, I can see the expected Page Number in the Footer. That Page Number doesn't appear anywhere on the printed output sheet. When I print using Excel, though, they appear. Does anyone know why my Footer text is not appearing? Here's my code. Pastebin of my C# code

    Read the article

  • Delphi, What do I do about "no GetEnumerator present" error when using a for loop over Excel Interop

    - by Ryan
    Hello, I'm trying to write a Delphi program that will loop through each worksheet in an Excel file and format some cells. I'm receiving an error while trying to use the for-in loop over the Workbook.Worksheets collection, though. The error is specifically: [DCC Error] Office.pas(36): E2431 for-in statement cannot operate on collection type 'Sheets' because 'Sheets' does not contain a member for 'GetEnumerator', or it is inaccessible The line of code this occurs for is: for Worksheet in Workbook.Worksheets do The definition of Worksheet and Workbook is as follows: var ExcelApp: ExcelApplication; var Workbook: ExcelWorkbook; var Worksheet: ExcelWorksheet; I'm porting this code to Delphi from C#, in which it works. Does anyone know why I'd be getting this GetEnumerator error? I'm using the Office 2007 Excel Interop file and Embarcadero® Delphi® 2010 Version 14.0.3593.25826. Thanks in advance.

    Read the article

  • C# app that uses Excel Interop, easy switch between 2003 2007?

    - by user320781
    I have an app written that just does really basic I/O on a spreadsheet. Read in a bunch of cells, do some sorting, and dump the output back into another spreadsheet. Works great on my machine. I have Office 2003 installed. When it runs on someone elses machine with 2007, it bombs, presumably due to the different versions of the Interop assemblies. I was hoping someone knew a way to dynamically change which/where the assembly is loaded from depending on the office version (getting the office version is easy from the registry). Sifting thru the rest of the internet, i didnt see anything to indicate that was possible :( . I tried installing the 2007 PIAs, but when i try to add a reference, they dont show up and i have no idea where to browse for them (they arent in the c:\windows\assemblies\; maybe the install didnt work). Am I going to have to get a machine with 2007 installed to build on every time i need to make updates?

    Read the article

  • Excel Interop: Fastest way to change color of portions of text in a huge range of cells

    - by Kyopaxa
    There some articles about the fastest way to write data using Excel interop assigning directly an Array of data to the value of the range. Like: string[,] multidimensionalArrayData = new string[200, 3]; // (...) Fill multidimensionalArrayData with your data dataSheet.Range["A1:C200"].Value = multidimensionalArrayData; There are also some articles about how to change the Font color of a specific portion of text, for example (VB this time): With ActiveCell.Characters(Start:=3, Length:=3).Font .Name = "Arial" .FontStyle = "Regular" .Size = 10 .Color = "Red" .ThemeFont = xlThemeFontNone End With The question now is, what would be the fastest way to change the color of specific portions of text for thousands of cells? Currently, in my C# code, I have to do it cell by cell, with a horrible performance hit. Is there a way to fill an array of 'Characters' objects in C# and pass that array to a range in one go? Any other solutions?

    Read the article

  • How Does a COM Program Locate a .NET DLL Registered for COM Interop?

    - by Eric J.
    One customer wants to consume our .NET DLLs from VB6. They are designed to support reverse interop and all works fine... except: There are two separate VB6 programs in two different directories. It seems it's necessary to do one of: Copy the .NET DLL into both directories, or Install the .NET DLL in the GAC This is the customer's observation and also supported by the RegAsm documentation: After registering an assembly using Regasm.exe, you can install it in the global assembly cache so that it can be activated from any COM client. If the assembly is only going to be activated by a single application, you can place it in that application's directory. I'm confused on this point. First point of confusion: As far as I understand, the COM runtime locates the DLL using the Prog ID / Class ID. When I look in the registry at the Class ID entry, I see the full path to the .NET DLL in the CodeBase key. Why is it that a COM program using the Prog ID / Class ID doesn't locate the .NET DLL using the CodeBase? Second point of confusion: The GAC is specific to .NET. How is it involved in resolving COM references?

    Read the article

  • How to enumerate word document using office interop API?

    - by Shekhar
    Hello everyone, I want to traverse through all the elements of an word document one by one and according to type of element (header, sentence, table,image,textbox, shape, etc.) I want to process that element. I tried to search any enumerator or object which can represent elements of document in office interop API but failed to find any. API offers sentences, paragraphs, shapes collections but doesnt provide generic object which can point to next element. For example : <header of document> <plain text sentences> <table with many rows,columns> <text box> <image> <footer> (Please imagine it as a word document) So, now I want some enumerator which will first give me <header of document>, then on next iteration give me <plain text sentences>, then <table with many rows,columns> and so on. Does anyone knows how we can achieve this? Is it possible? I am using C#, visual studio 2005 and Word 2003. Thanks a lot

    Read the article

  • Microsoft.Office.Interop.Excel.ListObject vs Microsoft.Office.Tools.Excel.ListObject

    - by Kavita A
    I need to access the Selected Event of all the listobjects in all the worksheets of my workbook but when I access worksheet.listobject, that object apparently belongs to Microsoft.Office.Interop.Excel.ListObject and so doesn't have any events where as the table list object belongs to Microsoft.Office.Tools.Excel.ListObject. And I read that Microsoft.Office.Tools.Excel.ListObject.InnerObject = Microsoft.Office.Interop.Excel.ListObject but i don't know how to use it. Pls Help Thanks, Kavita

    Read the article

  • Interop type cannot be embedded

    - by Jan
    I am creating an web application on the .net 4.0 framework (beta2 ) in C#. When I try to use a assembly called "ActiveHomeScriptLib", I get the following error: Interop type 'ActiveHomeScriptLib.ActiveHomeClass' cannot be embedded. Use the applicable interface instead. When I change the framework to version 3.5, I don't have any errors. What is an Interop Type and why does this only occur when I use the 4.0 framework.

    Read the article

  • FileNotFoundException when running WiX CustomAction with COMAdmin interop

    - by dabcabc
    I am trying to create a WiX custom action which will allow me to shutdown and clear down a COM+ package as part of an upgrade installation, or create and configure a new COM+ package as part of the initial installation. I previously had this running as a CustomAction within a standard Visual Studio MSI but this only allows the custom action to be executed after the files have been copied - which will fail as the package will still be running. The COMAdmin.dll has been added as a reference to the CustomAction project and is set CopyLocal=true. In the bin folder for the custom action project the Interop.COMAdmin.dll is present. The answer to this question seems to suggest that it should work. I am getting the following exception within the MSI log when trying to install: MSI (s) (C4:04) [10:40:34:205]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSI119.tmp, Entrypoint: BeforeInstall SFXCA: Extracting custom action to temporary directory: C:\WINDOWS\Installer\MSI119.tmp-\ SFXCA: Binding to CLR version v2.0.50727 Calling custom action MyCustomAction!MyCustomAction.CustomActions.BeforeInstall Exception thrown by custom action: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Interop.COMAdmin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. File name: 'Interop.COMAdmin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' at MyCustomAction.CustomActions.BeforeInstall(Session session) WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value . --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture) at Microsoft.Deployment.WindowsInstaller.CustomActionProxy.InvokeCustomAction(Int32 sessionHandle, String entryPoint, IntPtr remotingDelegatePtr)

    Read the article

  • VB.Net plugin using Matlab COM Automation Server...Error: 'Could not load Interop.MLApp'

    - by Ben
    My Problem: I am using Matlab COM Automation Server to call and execute matlab .m files from a VB.Net plugin for a CAD program called Rhino 3D. The code works flawlessly when set up as a simple Windows Application in Visual Studio, but when I insert it (and make the requisite reference) into my .Net plugin and test it in the CAD program I get the following error: "Could not load file or assembly 'Interop.MLApp, Version 1.0.0.0, culture=neutral, PublicKeyToken=null' or one of its dependencies. the system cannot find the file specified." What I've Tried: I am baffled as to why this occurs, but I was able to contact the CAD program's technical support staff and they suggested that it has something to do with their DotNet SDK having trouble with references that are located far outside the CAD program directory. They didn't have any solutions so I tried playing around with copylocal and this made no difference. I tried using other COM libraries and the Open Office automation server works fine, although uses url's instead of requiring a reference. I also tested Excel, which does require a reference, and it returned the error: "retrieving the COM class factory for component with CLSID {...} failed due to the following error: 80040154." This may or may not be related to the issue with the Matlab COM reference, but I thought was worthwhile to share. Perhaps is there another way to reference Interop.MLApp? I would appreciate any suggestions or thoughts on how I might make the Matlab Interop.MLApp reference work. Best regards, Ben

    Read the article

  • How do I declare an IStream in idl so visual studio maps it to s.w.interop.comtypes?

    - by Grahame Grieve
    hi I have a COM object that takes needs to take a stream from a C# client and processes it. It would appear that I should use IStream. So I write my idl like below. Then I use MIDL to compile to a tlb, and compile up my solution, register it, and then add a reference to my library to a C# project. Visual Studio creates an IStream definition in my own library. How can I stop it from doing that, and get it to use the COMTypes IStream? It seems there would be one of 3 answers: add some import to the idl so it doesn't redeclare IStream (importing MSCOREE does that, but doesn't solve the C# problem) somehow alias the IStream in visual studio - but I don't see how to do this. All my thinking i s completely wrong and I shouldn't be using IStream at all help...thanks [ uuid(3AC11584-7F6A-493A-9C90-588560DF8769), version(1.0), ] library TestLibrary { importlib("stdole2.tlb"); [ uuid(09FF25EC-6A21-423B-A5FD-BCB691F93C0C), version(1.0), helpstring("Just for testing"), dual, nonextensible, oleautomation ] interface ITest: IDispatch { [id(0x00000006),helpstring("Testing stream")] HRESULT _stdcall LoadFromStream([in] IStream * stream, [out, retval] IMyTest ** ResultValue); }; [ uuid(CC2864E4-55BA-4057-8687-29153BE3E046), noncreatable, version(1.0) ] coclass HCTest { [default] interface ITest; }; };

    Read the article

  • Is it possible to interop with Thunderbird using C#?

    - by Jurily
    Here's the latest hurdle in my ongoing quest to automate my job: All email in the company goes through 4 different email adresses, switching randomly back and forth (with a note attached in the global share: please set "keep email on server") All logic related to email is contained in a nice big Thunderbird profile, which gets copied back and forth to new machines; this includes sorting invoices into 5 different "folders", the list of VIP adresses to send notifications, and the VIP level of those customers I only need the contents of those folders (the attachments, anyway) The question: is there a way to ask Thunderbird for those attachments and lists from C#? Alternatively, can Outlook be set up to synchronize with Thunderbird? Where do I start reading? Ditching Thunderbird is not an option right now, I need to keep up with changes to the VIP list. P.S. I will set up a real email server right after Monkey saves me enough time to convince people about it.

    Read the article

  • How to get Lotus Notes Password (on local machine) using "Interop.Domino.dll" (C#)?

    - by Preeti
    Hi, I am making one application where i am reading mails from Lotus Notes. I have made this application interdependent of Domino Server. But in this case.If user's Lotus Notes's is configured with Domino server.It shows pop-up for password. I don't want to show pop-up.And don't want to add text box into UI. Is there anyway to get NSF Password Programaticaly? Using Domino.dll. Regards, Preeti

    Read the article

  • Is it possible to do some interop with iWork?

    - by Alerty
    I know it is possible with the .NET framework of Microsoft to do some interoperability with Microsoft Office. Is there something that exist that resembles to it for iWork and the Cocoa framework? Edit: Here are more details. I would like to create an application that has a GUI and that can generate Pages/Keynote/Numbers documents.

    Read the article

  • Interop Structure: Should Unsigned Short be Mapped to byte[]?

    - by Ngu Soon Hui
    I have such a C++ structure: typedef struct _FILE_OP_BLOCK { unsigned short fid; // objective file ID unsigned short offset; // operating offset unsigned char len; // buffer length(update) // read length(read) unsigned char buff[MAX_BUFF_SIZE]; } FILE_OP_BLOCK; And now I want to map it in .Net. The tricky thing is that the I should pass a 2 byte array for fid, and integer for len, even though in C# fid is an unsigned short and len is an unsigned char I wonder whether my structure ( in C#) below is correct? public struct File_OP_Block { [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] fid; public ushort offset; public byte length; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 240)] public char[] buff; }

    Read the article

  • PowerPoint Printing Problem c# - Nothing gets printed.

    - by Zeeshan Ahmad
    Guys, i am trying to print powerpoint docs through my windows application in c#. I am using Microsoft.Office.Interop.PowerPoint for this functionality. Following is the code which I have used. It sends the request to printer but nothing gets printed. if you guys have any knowledge plz help. string filename = "C:\\test.ppt"; int copies = 1; Microsoft.Office.Interop.PowerPoint.Presentation work = null; Microsoft.Office.Interop.PowerPoint.Application app = new Microsoft.Office.Interop.PowerPoint.ApplicationClass(); Microsoft.Office.Interop.PowerPoint.Presentations presprint = app.Presentations; work = presprint.Open(filename, Microsoft.Office.Core.MsoTriState.msoCTrue, Microsoft.Office.Core.MsoTriState.msoCTrue, Microsoft.Office.Core.MsoTriState.msoFalse); //app.Visible = Microsoft.Office.Core.MsoTriState.msoTrue; work.PrintOptions.PrintInBackground = Microsoft.Office.Core.MsoTriState.msoFalse; //work.PrintOptions.PrintInBackground = Microsoft.Office.Core.MsoTriState.msoTrue; //work.PrintOptions.ActivePrinter = "HP LaserJet 5000 Series PCL6"; work.PrintOptions.ActivePrinter = app.ActivePrinter; work.PrintOut(1, work.Slides.Count, app.ActivePrinter, copies, Microsoft.Office.Core.MsoTriState.msoFalse); work.Close(); app.Quit();`

    Read the article

  • LDAP NTLM interop

    - by pihentagy
    Hi! Our company uses NTLM to authenticate users. But there are a bunch of softwares with LDAP authentication support. So, is there a way to setup an LDAP server (preferably under WinNT), which can authenticate users via NTLM?

    Read the article

  • LDAP NTLM interop [closed]

    - by pihentagy
    Hi! Our company uses NTLM to authenticate users. But there are a bunch of softwares with LDAP authentication support. So, is there a way to setup an LDAP server (preferably under WinNT), which can authenticate users via NTLM?

    Read the article

  • Interop.Outlook.UserProperties.Add causing problem during connection time

    - by aanataliya
    Hi All, I have created a plug-in for outlook. Plug-in has only below code. private void OnNewOutlookInspector(Outlook.Inspector OutlookInsptr) { Outlook.MailItem MlItem = (Outlook.MailItem)OutlookInsptr.CurrentItem; //if I remove below line. Everything is working fine. MlItem.UserProperties.Add("INSPINIT", Outlook.OlUserPropertyType.olText , true , true ).Value = "1"; } public void OnConnection(object application, Extensibility.ext_ConnectMode connectMode, object addInInst, ref System.Array custom) { applicationObject = application; addInInstance = addInInst; MessageBox.Show("in connection new 2"); OutlkApp = (Outlook.Application)application; OutlkInsptrs = OutlkApp.Inspectors; OutlkInsptrs.NewInspector += new Outlook.InspectorsEvents_NewInspectorEventHandler(OnNewOutlookInspector); } Problem I am facing is, When I send HTML mail while plug-in is enabled, receiving end it is being received as a plain text. Below is the mail content along with the header and body at recieving end. x-sender: [email protected] x-receiver: [email protected] Received: from blr-s-07.pointcrossblr.com ([192.168.1.107]) by blr-ws-134.pointcrossblr.com with Microsoft SMTPSVC(6.0.2600.5949); Wed, 22 Dec 2010 17:11:02 +0530 Received: from blrws134 ([192.168.1.175]) by blr-s-07.pointcrossblr.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 22 Dec 2010 17:11:02 +0530 From: "Ashif Nataliya" <[email protected]> To: <[email protected]> Cc: <[email protected]> Subject: RTF FRM blr to pc.com cc blr-ws-134 Date: Wed, 22 Dec 2010 17:11:02 +0530 Message-ID: <[email protected]> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_00F7_01CBA1FB.36115580" X-Mailer: Microsoft Outlook 14.0 Content-Language: en-us X-MS-TNEF-Correlator: 00000000DCB2344DE8F50F4FBC91085BB5C06D55A4172000 thread-index: AcuhzRuTOBkvHPUnS1aLi9+cHNAWhA== Return-Path: [email protected] X-OriginalArrivalTime: 22 Dec 2010 11:41:02.0822 (UTC) FILETIME=[1C788860:01CBA1CD] This is a multipart message in MIME format. ------=_NextPart_000_00F7_01CBA1FB.36115580 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit HTML Test Test Mail ------=_NextPart_000_00F7_01CBA1FB.36115580 Content-Type: application/ms-tnef; name="winmail.dat" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="winmail.dat" // and some other code..... Any help is appreciated. Thanks.

    Read the article

  • Activate a (COM Interop based) ActiveX contol using registration free com

    - by embnut
    I have a (COM Interop based) ActiveX contol that I am trying to use with registration free com. When the control loads the control is inactive (does not responds to events, control not fully rendered etc). After much search I discovered that COM objects using reg-free-com use the miscStatus attribute to set the initial state to get correctly activated. I know how to use it with a comClass which corresponds to a native COM Object. 1) What is the equivalent of the following for clrClass element which corresponds to a COM-interop object? <comClass clsid="{qqqqqqqq-wwww-eeee-rrrr-00C0F0283628}" tlbid="{xxxxxxxx-yyyy-zzzz-aaaa-0000F8754DA1}" threadingModel="Both" progid="SomeCompany.SomeOleControl" description="Some ActiveX Control" miscStatus="recomposeonresize,insideout,activatewhenvisible,nouiactivate" > 2) The COM client I am using is Visual FoxPro. If the (1) is not possible what can I do in VFP to activate the inactive ActiveX control. (I dont mind VB or C# input too if I can use it to find the equivalent foxpro) Currently I tried the following this.AddObject('OleControl1', 'oleControl', 'SomeCompany.SomeOleControl') this.OleControl1.AutoActivate = 3 this.OleControl1.Visible = .T. this.OleControl1.SetFocus But I the OleControl1 gets focus before passing events like mouse click to its subelements. So I have to click twice on it to do the necessary action, any time it does not have focus. I would like the control to act as if the "nouiactivate" of the miscStatus value is set. 3) Is there any other way of accomplishing what I want to do? Hans Passant, here is the listing of current Assembly.dll.manifest. The formatting in the comment made it unreadable. <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity name="Assembly" version="1.0.0.0" type="win32" publicKeyToken="wwwwwwwwwwwwwwww"/> <clrClass name="SomeCompany.SomeOleControl" clsid="{qqqqqqqq-wwww-eeee-rrrr-00C0F0283628}" progid="SomeCompany.SomeOleControl" threadingModel="Both"/> <file name="Assembly.tlb"> <typelib tlbid="{xxxxxxxx-yyyy-zzzz-aaaa-0000F8754DA1}" version="1.0" helpdir="" flags="hasdiskimage"/> </file> </assembly>

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >