activex

ActiveX control without a form

假如想象 提交于 2019-11-28 08:20:13
We are required to use a 3rd party ActiveX control. The only issue is, the layer in our software is a business layer and has no access to a window or form. It also runs on separate threads (and should work from any thread) that are not STA. Rather than breaking our separation of UI from business logic, we used this workaround to make it work: Thread thread = new Thread((ThreadStart) delegate { _myActiveX = new MyActiveXType(); _myActiveX.CreateControl(); //more initialize work Application.Run(); }); thread.SetApartmentState(ApartmentState.STA); thread.IsBackground = true; thread.Start(); Then

How to list all ActiveX controls?

為{幸葍}努か 提交于 2019-11-28 08:12:25
问题 Is there a way to list/browse all ActiveX controls in the system or for particular application? Can this be done from some administration screen as well as in code? Thx for any help. 回答1: I usually use OLEview to inspect COM/ActiveX objects on my pc as it also allows me to inspect the interfaces exposed by the objects. A programmatic approach has been posted by Jeff Attwood on stackoverflow. 回答2: TRy this ActiveXHelper 回答3: //Initialise COM libraries CoInitialize (NULL); //The Component

InvalidCastException When using ActiveX in C# project

♀尐吖头ヾ 提交于 2019-11-28 06:17:36
问题 Dear all trader and API Gurus, Thank you in advance. Background: Visual Studio 2010, C# Language, ActiveX OCX API as reference of project. Successively to use the method provided by API like reqAccountUpdate and use the event to receive information about account update. Issue: Now I would like to require data about one specific financial instrument like a forex pair: AUD.USD . a. Step 1: Inherit the interface of class IContract from TWSLib my Code is here as a picture and the constructor is

How to use ActiveX component in ClassLibrary without Winforms

柔情痞子 提交于 2019-11-28 06:10:09
问题 How is it possible to use an ActiveX control in a ClassLibrary type project? I intend to call it later from WPF application but I don't want to place a control anywhere on the form, so I don't want to use WindowsFormsHost ; mainly because I would like to use this my library in Console App and Windows Service. In this case, the ActiveX control I want to use is a video analysis component. Additionally I want my component to register itself in deployed environment. 回答1: I think that the common

How to sign an ActiveX DLL with a Certificate

不想你离开。 提交于 2019-11-28 05:46:30
问题 I have created a DLL that I am exposing via COM that I need to sign with a certificate. I have created a Visual Studio 2008 project and it has a class library which contains the code for my ActiveX object. I then created an ASP.net page that is using it: <script type="text/javascript"> var x = new ActiveXObject("Foo.Bar"); x.SomeMethod(); </script> I ran the site and was getting a bunch of errors with security. I ran regasm /tlb /codebase foo.dll and installed it this way. I also changed a

Delphi COM对象

老子叫甜甜 提交于 2019-11-28 04:56:39
作者:巴哈姆特 http://www.cnpack.org(转载请注明出处并保持完整)  如果没有接触过COM对象的话,你会觉得接口真的很麻烦,也许会有:“还不如直接定义一个类更方便”的想法。 的确,没有经过COM封装的接口确实比较麻烦。在我看来,没有经过COM封装的接口似乎没有存在的意义。那么,什么是COM对象呢?它有什么优点呢?接下来开始对COM对象进行一个简单的介绍: COM是个二进制规范,它与实现的语言无关。这样,即使COM对象由不同的编程语言创建,运行在不同的进程空间和不同的操作系统平台,这些对象也能相互通信。COM既是规范,也是实现,它以COM库的形式提供了访问COM对象核心功能的标准接口以及一组API函数,这些API函数用于创建和管理COM对象。COM本质上仍然是客户服务器模式。客户(通常是应用程序)请求创建COM对象并通过COM对象的接口操纵COM对象。服务器根据客户的请求创建并管理COM对象。当然,客户和服务器这两种角色并不是绝对的。 记得我在刚刚接触COM对象的时候,我师傅曾经给我说过:“COM不是Dll,虽然它可能会以后缀名为dll文件呈现在你面前,但是它绝对不是我们传统意义上所说的dll(动态链接库)”。 其实在我看来,进程内的COM对象应该是一个以dll为载体而提供一些特殊服务的特殊的动态链接库。当然,也有进程外的COM。 现在

How to use IDispatch in plain C to call a COM object

泪湿孤枕 提交于 2019-11-28 04:35:24
I need to compile some code of mine using the gcc compiler included in the R tools (R the statistical program for windows), the problem is that I need to use IDispatch in my code to create an access the methods of a COM object, and the gcc compiler doesn't support much of the code that I'm using to do so, which is basically C++ code. So my question is how can I use IDispatch in C to create the COM object without having to depend on MFC, .NET, C#, WTL, or ATL. I believe that if I do so I will be able to compile my code without any problem. There is a great article on CodeProject entitled "COM

ReportViewer Client Print Control “Unable to load client print control”?

走远了吗. 提交于 2019-11-28 04:23:45
Has anyone come across this issue? Seems MS have broken it with their own update: A number of people have reported problems using the ActiveX print control in the report viewer after installing Microsoft Update 956391. Specifically, users receive the error "Unable to load client print control" when clicking on the print icon in the report viewer toolbar. I would like to explain what is happening, why we did it, and how to fix the problems that you or your customers are experiencing. From here: http://blogs.msdn.com/brianhartman/archive/2008/11/05/client-print-fails-to-load-after-microsoft

How to create an ActiveX control in C#?

断了今生、忘了曾经 提交于 2019-11-28 04:08:45
问题 I am not able to create a functioning ActiveX control in C#; I have tried following tutorials to do so without success. I create a sample Class Library project which includes this code: namespace AACWCSurvey { [ProgId("Prisoner.PrisonerControl")] [ClassInterface(ClassInterfaceType.AutoDual)] public class Class1 { public Class1() { MessageBox.Show("FIRETRUCK!!!"); } } } I then did the following steps: Properties => Application => Assembly Information => Make Assembly COM-visible Build =>

Reading a txt file from Javascript

我的未来我决定 提交于 2019-11-28 02:18:26
am trying to read few lines from a txt file using JS,and i have this code but its not working for some reason,, var fso = new ActiveXObject("Scripting.FileSystemObject"); var s = fso.OpenTextFile("C:\\wamp\\www\\22.txt", 1, true); var row = s.ReadLine(); alert(row); any suggestions?! If you're running WAMP anyway, just use standard AJAX to fetch the file 22.txt from the server. The easiest way is to use jQuery, where the code would be: $.get("22.txt", function(data) { alert(data); } You can search for how to do this without jQuery if you wish. Make sure your browser has the right permissions