Search Results

Search found 57012 results on 2281 pages for 'com interop'.

Page 9/2281 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • C# Interop with dll

    - by Jim Jones
    Using VS2008 C# am attempting to interop a C++ dll. Have a C++ class constructor: make_summarizer(const char* rdir, const char* lic, const char* key); Need to retain a reference to the object that is created so I can use it in a follow-on function. When I did this in JNI the c code was: declare a static pointer to the object: static summarizer* summrzr; Then in one of the functions I called this constructor as follows: summrzr = make_summarizer(crdir, clic, ckey); Where the parameters all where the requisite const char* type; So in C# using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; using System.Configuration; namespace SummarizerApp { class SummApp { private IntPtr summarzr; public SummApp() { string resource_dir = ConfigurationManager.AppSettings["resource_dir"]; string license = ConfigurationManager.AppSettings["license"]; string key = ConfigurationManager.AppSettings["key"]; createSummarizer(resource_dir, license, key); } [System.Runtime.InteropServices.DllImportAttribute("lib\\summarizer37.dll", EntryPoint = "#1")] public static extern IntPtr make_summarizer( [InAttribute()][MarshalAsAttribute(UnmanagedType.LPTStr)] string rdir, [InAttribute()][MarshalAsAttribute(UnmanagedType.LPTStr)] string lic, [InAttribute()][MarshalAsAttribute(UnmanagedType.LPTStr)] string key); public void createSummarizer(string resource_dir, string license, string key) { try { this.summarzr = make_summarizer(resource_dir, license, key); } catch (AccessViolationException e) { Console.WriteLine(e.Message); Console.WriteLine(e.StackTrace); } } Have also tried using IntPtr created using Marshal.StringToHGlobalAnsi(string). Regardless I get a AccessViolationException on the line where I call the native constructor; So what am I doing wrong? Jim

    Read the article

  • MS Access Interop - How to set print filename?

    - by Ryan
    Hi all, I'm using Delphi 2009 and the MS Access Interop COM API. I'm trying to figure out two things, but one is more important than the other right now. I need to know how to set the file name when sending the print job to the spooler. Right now it's defaulting to the Access DB's name, which can be something different than the file's name. I need to just ensure that when this is printed it enters the print spool using the same filename as the actual file itself - not the DB's name. My printer spool is actually a virtual print driver that converts documents to an image. That's my main issue. The second issue is how to specify which printer to use. This is less important at the moment because I'm just using the default printer for now. It would be nice if I could specify the printer to use, though. Does anyone know either of these two issues? Thank you in advance. I'll go ahead and paste my code: unit Converter.Handlers.Office.Access; interface uses sysutils, variants, Converter.Printer, Office_TLB, Access_TLB, UDC_TLB; procedure ToTiff(p_Printer: PrinterDriver; p_InputFile, p_OutputFile: String); implementation procedure ToTiff(p_Printer: PrinterDriver; p_InputFile, p_OutputFile: String); var AccessApp : AccessApplication; begin AccessApp := CoAccessApplication.Create; AccessApp.Visible := False; try AccessApp.OpenCurrentDatabase(p_InputFile, True, ''); AccessApp.RunCommand(acCmdQuickPrint); AccessApp.CloseCurrentDatabase; finally AccessApp.Quit(acQuitSaveNone); end; end; end.

    Read the article

  • Outlook Interop: Password protected PST file headache

    - by Ed Manet
    Okay, I have no problem identifying the .PST file using the Outlook Interop assemblies in a C# app. But as soon as I hit a password protected file, I am prompted for a password. We are in the process of disabling the use of PSTs in our organization and one of the steps is to unload the PST files from the users' Outlook profile. I need to have this app run silently and not prompt the user. Any ideas? Is there a way to create the Outlook.Application object with no UI and then just try to catch an Exception on password protected files? // create the app and namespace Application olApp = new Application(); NameSpace olMAPI = olApp.GetNamespace("MAPI"); // get the storeID of the default inbox string rootStoreID = olMAPI.GetDefaultFolder(OlDefaultFolders.olFolderInbox).StoreID; // loop thru each of the folders foreach (MAPIFolder fo in olMAPI.Folders) { // compare the first 75 chars of the storeid // to prevent removing the Inbox folder. string s1 = rootStoreID.Substring(1, 75); string s2 = fo.StoreID.Substring(1, 75); if (s1 != s2) { // unload the folder olMAPI.RemoveStore(fo); } } olApp.Quit();

    Read the article

  • Some languages don't work when using Word 2007 Spellcheck from Interop

    - by Tridus
    I'm using the Word 2007 spellchecker via Interop in a VB.net desktop app. When using the default language (English), it works fine. If I set the language to French via LanguageId, it also works. But if I set it to French (Canadian) (Word.WdLanguageID.wdFrenchCanadian), it doesn't work. There's no error message, it simply runs and says the document contains no errors. I know it does, if I paste the exact same text into Word itself and run it with the French (Canadian) dictionary, it finds errors. Just why that dictionary doesn't work is kind of a mystery to me. Full code below: Public Shared Function SpellCheck(ByVal text As String, ByVal checkGrammar As Boolean) As String ' If there is no data to spell check, then exit sub here. If text.Length = 0 Then Return text End If Dim objWord As Word.Application Dim objTempDoc As Word.Document ' Declare an IDataObject to hold the data returned from the ' clipboard. Dim iData As IDataObject objWord = New Word.Application() objTempDoc = objWord.Documents.Add objWord.Visible = False ' Position Word off the screen...this keeps Word invisible ' throughout. objWord.WindowState = 0 objWord.Top = -3000 ' Copy the contents of the textbox to the clipboard Clipboard.SetDataObject(text) ' With the temporary document, perform either a spell check or a ' complete ' grammar check, based on user selection. With objTempDoc .Content.Paste() .Activate() .Content.LanguageID = Word.WdLanguageID.wdFrenchCanadian If checkGrammar Then .CheckGrammar() Else .CheckSpelling() End If ' After user has made changes, use the clipboard to ' transfer the contents back to the text box .Content.Copy() iData = Clipboard.GetDataObject If iData.GetDataPresent(DataFormats.Text) Then text = CType(iData.GetData(DataFormats.Text), _ String) End If .Saved = True .Close() End With objWord.Quit() Return text End Function

    Read the article

  • C# Interop.Word Adding an Image from project resource folder

    - by iamnobody
    Hi guys. Having some image problem with Interop.Word and C#. I want to add an image in the header of the document that I am going to generate. I have this code working perfectly section.Headers[Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Shapes.AddPicture(@"C:\Logo.jpg", ref x, ref x, ref x, ref x, ref x, ref x, ref x); Problem is that I can't have "C:\Logo.jpg" in the code since after publishing the project, there would most probably be no Logo.jpg in the C folder of the user. The image is already in my project's resource folder. I've used Image.FromFile("Logo.jpg") before but .AddPicture requires a string and not an image. Any ideas? Any help would be greatly appreciated. Thanks! -- edit -- Saw this over the net: string anyPath = @"C:\logo.jpg"; Properties.Resources.logo.Save(anyPath); section.Headers.[...].Shapes.AddPicture(anyPath, ... but then I still get a generic error in GDI+ or ExternalException was unhandled.

    Read the article

  • Silverlight file download for COM Interop

    - by rip
    Is the following possible in Silverlight when a button is clicked? An Excel template is downloaded from a remote server and saved to the local machine An instance of the template is then opened on the client A macro is then executed within the new Excel document I can do everything apart from saving the template to the local machine. I can save this in isolated storage but then I don’t know where this is when trying to open it from the Excel COM interop code. Has anyone any ideas or is this not possible?

    Read the article

  • Setting System.Drawing.Color through COM. Interop

    - by user58909
    I am trying to use Aspose.Words library through COM Interop. There is one critical problem: I cannot set color. It is supposed to work by assigning to DocumentBuilder.Font.Color, but when I try to do it I get OLE error 0x80131509. My problem is pretty much like this one: http://bit.ly/cuvWfc

    Read the article

  • Bullet indents in PowerPoint 2007 compatibility mode via .NET interop issue

    - by L. Shaydariv
    Hello. I've got a really difficult bug and I can't see the fix. The subject drives me insane for real for a long time. Let's consider the following scenario: 1) There is a PowerPoint 2003 presentation. It contains the only slide and the only shape, but the shape contains a text frame including a bulleted list with a random textual representation structure. 2) There is a requirement to get bullet indents for every bulletted paragraph using PowerPoint 2007. I can satisfy the requirement opening the presentation in the compatibility mode and applying the following VBA script: With ActivePresentation Dim sl As Slide: Set sl = .Slides(1) Dim sh As Shape: Set sh = sl.Shapes(1) Dim i As Integer For i = 1 To sh.TextFrame.TextRange.Paragraphs.Count Dim para As TextRange: Set para = sh.TextFrame.TextRange.Paragraphs(i, 1) Debug.Print para.Text; para.indentLevel, sh.TextFrame.Ruler.Levels(para.indentLevel).FirstMargin Next i End With that produces the following output: A 1 0 B 1 0 C 2 24 D 3 60 E 5 132 Obviously, everything is perfect indeed: it has shown the proper list item text, list item level and its bullet indent. But I can't see the way of how I can reach the same result using C#. Let's add a COM-reference to Microsoft.Office.Interop.PowerPoint 2.9.0.0 (taken from MSPPT.OLB, MS Office 12): // presentation = ...("presentation.ppt")... // a PowerPoint 2003 presentation Slide slide = presentation.Slides[1]; Shape shape = slide.Shapes[1]; for (int i = 1; i<=shape.TextFrame.TextRange.Paragraphs(-1, -1).Count; i++) { TextRange paragraph = shape.TextFrame.TextRange.Paragraphs(i, 1); Console.WriteLine("{0} {1} {2}", paragraph.Text, paragraph.IndentLevel, shape.TextFrame.Ruler.Levels[paragraph.IndentLevel].FirstMargin); } Oh, man... What's it? I've got problems here. First, the paragraph.Text value is trimmed until the '\r' character is found (however paragraph.Text[0] really returns the first character O_o). But it's ok, I can shut my eyes to this. But... But, second, I can't understand why the first margins are always zero and it does not matter which level they belong to. They are always zero in the compatibility mode... It's hard to believe it... :) So is there any way to fix it or just to find a workaround? I'd like to accept any help regarding to the solution of the subject. I can't even find any article related to the issue. :( Probably you have ever been face to face with it... Or is it just a bug with no fix and must it be reported to Microsoft? Thanks you.

    Read the article

  • Scala Actors with Java interop to underlying COM libraries

    - by wheaties
    I'm working on a JVM project which uses ESRI components (COM based, wrapped with JIntegra.) The client has requested the JAR files we produce work on the JVM and be accessible to Java code. I'd like to use Scala but I'm worried about how well the library will play with Scala's actors. Particularly I'm worried about the different mechanisms COM and Java employ to pass objects from one thread to another. Does anyone have any experience with this? Will they play nice? Edit: for clarification I noticed that when performing I/O on the ESRI DB that the CPU utilization is roughly 15%. I'd like to read each row and pass that row over to another actor for parsing. Then I could have several threads reading from the DB at once. The problem is that each row retrieved using ESRI's library is actually a Java wrapped COM object.

    Read the article

  • C# Class Library wont register for COM

    - by Jordan S
    Hello All, I am trying to gain access to a .NET class library in Microsoft Excel. To do this I know that the .NET class library must be registered with COM. So I tried going to my Assembly Info and Setting COM Visible to true. Then on the build tab I set Register for COM Interop for true also. I checked the AssemblyInfo.cs file and it does contain [assembly: ComVisible(true)]. But for some reason when I try to add a reference to the Class Lib in Excel the namespace does not show up in the list. I made a quick test Class library with nothing in it and did the same thing (set COM Vis = true , and Register For COM Interop = true) and that one does show up on the list of available references. I can't figure out what the difference is between the two classes. I am not sure if my class is actually being registered for COM interop or not. Does anyone know what I can do to fix this???

    Read the article

  • Does the COM server have to call SysFreeString() for an [out] parameter?

    - by sharptooth
    We have the following interface: [object, uuid("uuidhere"), dual ] interface IInterface : IDispatch { [id(1), propget] HRESULT CoolProperty( [out, retval] BSTR* result ); } Now there's a minor problem. On one hand the parameter is "out" and so any value can be passed as input, the parameter will become valid only upon the successful return. On the other hand, there's this MSDN article which is linked to from many pages that basically says (the last paragraph) that if any function is passed a BSTR* it must free the string before assigning a new string. That's horrifying. If that article is right it means that all the callers must surely pass valid BSTRs (maybe null BSTRs), otherwise BSTR passed can be leaked. If the caller passed a random value and the callee tries to call SysFreeString() it runs into undefined behavior, so the convention is critical. Then what's the point in the [out] attribute? What will be the difference between the [in, out] and [out] in this situation? Is that article right? Do I need to free the passed BSTR [out] parameter before assigning a new one?

    Read the article

  • www.domain.com and domain.com records in microsoft dns

    - by captainmish
    Hello Apologies if this is already answered, its a tricky one to search for! We are using split DNS for a domain used internally. For the outside nameservers, theres a simple zone with: @ IN A ip.ad.dr.ess www IN A ip.ad.re.ss This works fine externally. Internally its a windows server 2003 DNS server, so the www a record works fine, but I cant figure out how to add that primary record (using at symbol @ in bind). Can anyone help with how to get the same results from windows dns? I just want to be able to add a record for domain.com without being forced to use something.domain.com Thanks, Edit: This domain is not the "main" AD domain, and not used for logins etc.

    Read the article

  • COM Interop error, class not registered when using MSMQ Library

    - by mattmck
    I've referenced the MSMQ v3 Object Library in a VS2010 C# project only to get: System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {0188401C-247A-4FED-99C6-BF14119D7055} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). I've registered the library the reference points to: regsvr32 C:\windows\system32\mqoa.dll What am I missing? Assuming this works, what will I have to do at deployment to ensure the app will run on other machines with MSMQ installed?

    Read the article

  • IIS, Impersonation and COM Interop Premission Denied

    - by user315690
    Hello we are in the throws of integrating a Document Management System with Dynamic CRM 4, have done similar things previously but in this instance we are having to reference a COM dll. We've configured the asp.net page (we are bringing the info in via a i-Frame in CRM), setting Impersonation = True in the Webconfig and ensured that Windows authentication is the only method available within IIS. All works as we would expect when logged into the server itself and the page happily does off finds all the relevant documents for the CRM account and presents them to a user in a nice Infragistics CRM styled grid. However trying this from a client workstation we get the following: System.Runtime.InteropServices.COMException (0xC0042335): Permission denied. Impersonation appears to be passing over the correct details but nothing we've tried thus far has been able to make this work outside of logging into the server. Any thoughts as to what we are missing?

    Read the article

  • C++/CLI com-Interop: Exposing a reference type property to VBA

    - by Adam
    After long hours of investigation on exposing C# property that accepts a reference type to VBA, I concluded that it was not possible. In brief, a C# property that is of type double[] or even an object cannot be consumed in VBA like this: ' Compile Error: Function or interface marked as restricted, ' or the function uses an Automation type not supported in Visual Basic oComExposedEarlyBinding.ObjectArray = VBArray ' Run-time error 424: Object required oComExposedEarlyBinding.PlainObject = VBArray Or for more details: C# property exposed to VBA (COM) : Run-time error '424': Object required I would like to know if C++/CLI would support such an option? i.e. Allowing a reference-type property to be exposed to VBA so that a syntax like the above is valid. N.B. You can achieve this by using late binding, but losing the intellisense is not an option.

    Read the article

  • redirect from mysite.com to www.mysite.com

    - by jml
    hi there, i know that this has been answered many many times, so if someone wants to point me to another thread that answers my question specifically, that is fine... for right now, my searches aren't yielding many results. so i have a website like mysite.com that has a flash swf embedded in it and i go to www.mysite.com ... all of the sudden, things don't work properly. i would like to get to the bottom of this, because it's not like the page just "doesn't load" at all; it loads and i can only do certain things; as if certain functionality is disabled (might be url requests for specific urls etc). do i need to manage this in my control panel? i wouldn't assume so, because the site loads; just has a crippled functionality from within the swf. i was thinking it might have more to do with my crossdomain.xml file; could this be the case? thanks for any tips or suggestions.

    Read the article

  • Mapping an amazon server to a domain name registered with name.com

    - by S4M
    I have an amazon S3 web server and a domain name registered in name.com (the name is sam-experiments.com). I am trying to have a static page hosted on the amazon web server to be displayed on http://www.sam-experiments.com On the web server side, my bucket name is 'www.sam-experiments.com', and it links to here: http://www.sam-experiments.com.s3-website-eu-west-1.amazonaws.com/ On name.com, I added a new record with the followin characteristics: Record Type: CNAME Record Host: www.sam-experiments.com Record Answer: www.sam-experiments.com.s3.amazonaws.com. (as specified in the documentation here: http://docs.amazonwebservices.com/AmazonS3/latest/dev/VirtualHosting.html#VirtualHostingCustomURLs) TTL: 300 However, nothing gets displayed on www.sam-experiments.com, and I am not able to find what I am doing wrong. I really would appreciate some tip. Thanks! Note: I already posted this question in stackoverflow, but didnt get any answer, so I thought posting here may be more appropriate.

    Read the article

  • Why is "www.mysite.com" different from "mysite.com"?

    - by sapeish
    In any browser if I use www.mysite.com or just mysite.com the web page is correctly retrieved, but I am having trouble with Google Analytics and Facebook App. Facebook: To be able to get Likes, I create the Facebook App needed and set the site URL to http://mysite.com/. Using their tool http://developers.facebook.com/tools/debug/ when I test my page using http://mypage.com it works but using http://www.mypage.com fails with the message: Object at URL 'http://www.mysite.com/' of type 'website' is invalid because the domain 'www.mysite.com' is not allowed for the specified application id. Google Analytics: To be able to get traffic statistics, I created a Property and a Profile both with the URL http://www.mypage.com and no statistics were gathered in a week, when I changed the configured URL to http://mypage.com statistics where available a few hours later. What should I do to have statistics and likes for both www.mysite.com and mysite.com ??

    Read the article

  • htaccess redirect *.domain.com to www.domain.com/index.php

    - by decimal
    I want to redirect a user to www.domain.com/index.php if they type in either: domain.com or www.domain.com. I'm clueless about htaccess. Here's what I found but I don't know how to write an OR statement for the www. redirect RewriteEngine on RewriteCond %{HTTP_HOST} ^domain\.com RewriteRule (.*) http://www.domain.com/index.php$1 [R=301]

    Read the article

  • Email with extra '.com' behind sender email address

    - by CHT
    Currently I had a situation where I sent an email to xxx@abc.com.tw, but when I receive mail from xxx@abc.com.tw, it showed as xxx@abc.com.tw.com, with extra '.com' behind the email address, this just happen within this week. Before this, I didn't change any setting, currently I am using Outlook 2010. When I checked the email in webmail, it also showed it as xxx@abc.com.tw.com. It seem that it has nothing to do with Outlook. However, I also tried on Thunderbird 16.0.1, but still the problem is the same. Has anyone experienced this before? Is the problem caused by the sender or receiver? Header Message as below: Return-Path: Alice@pointsoft.com.tw.com Received: from colo4.roaringpenguin.com (not-assigned.privatedns.com [174.142.115.36] (may be forged)) by pioneerpos.com (8.12.11/8.12.11) with ESMTP id q9V6OsKU032650 for [email protected]; Wed, 31 Oct 2012 01:24:55 -0500 Received: from mail.pointsoft.com.tw (pointsoft.com.tw [59.124.242.126]) by colo4.roaringpenguin.com (8.14.3/8.14.3/Debian-9.4) with ESMTP id q9V6OmN0026374 for [email protected]; Wed, 31 Oct 2012 02:24:50 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01CDB730.6B3D5A51" Subject: =?big5?B?scTByrPmLblzpfM=?= Date: Wed, 31 Oct 2012 14:25:16 +0800 Message-ID: X-MS-Has-Attach: yes X-MS-TNEF-Correlator: thread-topic: =?big5?B?scTByrPmLblzpfM=?= thread-index: Ac23MH3YpZuLx2ejTYqR5PfoZ+IoBw== X-Priority: 1 Priority: Urgent Importance: high From: "Alice" Alice@pointsoft.com.tw.com To: "Bob" Bob@pioneerpos.com X-Spam-Score: undef - pointsoft.com.tw is whitelisted. X-CanIt-Geo: ip=59.124.242.126; country=TW; region=03; city=Taipei; latitude=25.0392; longitude=121.5250; http://maps.google.com/maps?q=25.0392,121.5250&z=6 X-CanItPRO-Stream: pioneerpos-com:default (inherits from rp-customers:default,base:default) X-Canit-Stats-ID: 02IhGoMJb - 2e7fa924443e - 20121031 X-CanIt-Archive-Cluster: irqpXI7aJGyo4Ewta7qVH399FOg X-Scanned-By: CanIt (www . roaringpenguin . com) on 174.142.115.36

    Read the article

  • Does .net calling COM which in turn calls other .net COM object works when using SxS and manifest fi

    - by Alex Shnayder
    I have a .net application calling to a COM component (C++) which in turn calls to another COM object implemented in .NET. This application is using Windows SxS capabilities and does not register any of it's COM components. Not the one written in C++, and not the one written in .net. This first call to the C++ COM component works fine. But when the C++ COM component calls to the .net one, it fails with class not registered. I have tried creating a small C++ app with a manifest file which calls the .net component and it works. It seems that when the flow is .net - COM NATIVE - .NET COM. Then SxS breaks and does not work. When looking at Fusion Logs (assembly loading logs) I see that no one is even attempting to resolve the .NET COM assembly. Is this SxS scenario even supposed to work (I think it does supposed to work)? If yes, then what can I be doing wrong ?

    Read the article

  • The difference between traditional DLL and COM DLL.

    - by smwikipedia
    I am currently studying COM. I found that COM DLL is kind of built upon the traditional DLL infrastructure. When we build COM DLLs, we still rely on the traditional DLL export methods to lead us to the internal COM co-classes. If COM is for component reusing at the binary level, I think the traditional DLL can achieve the same thing. They both expose functions, they are both binary, so what's the point of turning to COM approach? Currently, I have the feeling that the traditional DLL expose methods in a "flat" manner, while the COM DLL expose methods in an "OOP" hierarchy manner. And the OOP manner seems to be a better approach. Could this be the reason why COM prevails? Many thanks.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >