com

Calling C++ function from JavaScript script running in a web browser control

I have embedded a web browser control in my c++ application. I want javascript running in the web browser control to be able to call a c++ function/method. I have found mentions of three ways to do this: Implement an ActiveX component that acts as a middle man. (Implementation details here: http://blogs.msdn.com/b/nicd/archive/2007/04...

How to make SQL rise an event at SQL Client

I need to create ConsoleApp in C# which is going to write something on local disk of client corresponding of data added to SQL Server by others. Now I do not know is there a way to SQL rise an event at client. My idea is to periodicity check for new data by opening connection and selecting data. Before I start coding Ill like to explore ...

C# + COM, modify array in parameter

I have a COM object in C# and a Silverlight application(escalated privileges) which is a client to this COM object. COM object: [ComVisible(true)] public interface IProxy { void Test(int[] integers); } [ComVisible(true)] [ClassInterface(ClassInterfaceType.None)] public class Proxy : IProxy { [ComVisible(true)] public void ...

Returning string to JavaScript from C++ function

I have a class (JSObject) that implements the IDispatch interface. The class is exposed to JavaScript running in my hosted web browser control (IWebBrowser2). See more here about how this works: http://stackoverflow.com/questions/3747414/calling-c-function-from-javascript-script-running-in-a-web-browser-control I can call in to JSObjec...

Word menus are stuck after closing a document with COM

The following code opens and closes a Word document using COM; it does not produce any errors. However, if prior to running the code Word was maximized then the Word menus do not react to mouse or keyboard actions after the program is run. public static void Main(string[] args) { try { var wordDocument = GetWordDocumen...

how to program Virtual PC 2007 to automate tasks?

I have virtual machine that has windows 7 + visual studio 2010 setup, and my plan is to test some VS SDK development. Now I want to automate following tasks... Detach existing VHD Delete VHD Create a new Differencing VHD with base VHD as already good setup Attach it to the VM Start VM I tried to look for any OCX or COM control to do ...

Calling a c# .dll from native visual c++ code

Hello, the system I'm working with consists of: A front-end application written in most likely VB or else VC++ (don't know, don't and can't have the sources for it) An unmanaged VC++ .dll A C# .dll The application calls the first dll, the first dll calls different methods from the second one. In order to make the first dll able to se...

Can you launch the IE script debugger programmatically?

Having an issue with a client web page where all of the IE features are made inaccessible, I don't use IE much. The web page launches another window to show a pdf and generally fails at doing so - window displays only once, subsequent attempts flashes briefly before closing, and sometimes GPFs. Because the toolbar/menu/context menu are...

Any way to resolve C4772 errors without having to register DLLs?

I am maintaining a VS2010 project which has a number of cross-referenced COM libraries. I am trying to configure the project in such a way that it is buildable from a random workstation which has VS2010 installed. The workstation could be both 32 and 64 bit, so if I configure project to "register output", the build will fail to build on ...

How do I create a low-integrity instance of Internet Explorer using CoCreateInstance?

From a standard, non-elevated, medium-integrity process, I need to create an instance of Internet Explorer 7 on Windows Vista, and I need to use CoCreateInstance to do it. I've tried using techniques like those outlined in this thread, but I've been having some challenges. I'm able to lower a thread's integrity level, and use CoCreateIns...

Instantiating an ActiveX Object

I have imported an ActiveX library into my project in Visual Studio 2008 using: #import "TeeChart8.ocx" named_guids Now I would like to create objects exposed by the ActiveX library. However, I am having trouble understanding the API. There are two files that were created after I built the project with the #import, a .tli file and a...

COMAdmin.COMAdminCatalog - how to get DCOM Config folder content?

Is it possible to access DCOM Config via COMAdmin.COMAdminCatalog? I can get a collection of applications and configure them but cannot figure out how to get a collection of the items in the DCOM Config folder in Component Services. Any suggestions? ...

Passing array of strings from JS to C# inside WebBrowser control

I'm using ObjectForScripting property to interact with web page inside WebBrowser control and everything works fine except I can't figure out how to pass array of strings back to C# HTML code <input type="submit" onclick="window.external.save(Array('test', 'test2'))" /> Form // Returns System.__ComObject public void Save(object para...

Is is possible to proxy a COM interface using Spring.Net?

I am trying to create a dynamic proxy using Spring.NET and C# for a COM interface. I am currently experimenting using code, not config files. I have code similar to the following: Type comInterfaceType = typeof(ICOMInterface); ProxyFactory proxyFactory = new ProxyFactory(); proxyFactory.AddInterface(comInterfaceType); proxyFactory.GetP...

Activator.CreateInstance my instance?

I have a piece of code to open an instance of a COM object and perform different tasks. My problem is that if the application that I open with COM is already running then I reuse that instance. I would always like to have new instance and work with that and finally close. Anyway to do that? Type t = System.Type.GetTypeFromProgID("QlikTe...

Removing COM event handlers automatically in C#

I have a standalone .exe COM server and a trivial C# test program that launches an instance of the server and closes it immediately afterwards. Works like a charm. However, if I close the C# program itself I get an exception during the finalizer run because it is trying to unregister/unadvise COM event sinks from the no longer running CO...

Calling 64-bit COM control from 32-bit app

We have a situation where one of our products is a 32-bit app, but needs to communicate with instruments via 64-bit COM control (which wraps a 64-bit device driver). For various reasons, we don't want to compile this app as a 64-bit app, but we DO want to run it on a 64-bit OS. Since the drivers and COM control must be 64-bit to work, w...

How access USB port in C#.net

Please give me code example, How to Access USB port and detact USB driver is pluged. Eg : When pen is plug Virious gard detect it and begin search , How they do it. Thanks. ...

how to create table in MS Word using C#

i want to create a dynamic table in MS word using C#. when i submit my form ,a table (in word)should be created and this table should be fill with value. Thanks in advance ...

Best practice for continual running process in C#

I am working on a project in C#.NET using the .NET framework version 3.5. My project has a class called Focuser.cs which represents a physical device, a telescope focuser, that can communicate with a PC via a serial (RS-232) port. My class (Focuser) has properties such as CurrentPosition, CurrentTemperature, ect which represents the cur...