com

What are the posibilities to make a browser communicte with COM ports?

One of the requests of my project is to make a website take in measurements from a weighing module. This module currently works with a standalone app through a COM port. What would be the possibilities to perform such a thing through a browser? Is it possible at all? ...

.NET2.0 C# Interop: How to call COM code from C#?

In my last development environment, I was able to easily interact with COM, calling methods on COM objects. Here is the original code, translated into C# style code (to mask the original language): public static void SpawnIEWithSource(String szSourceHTML) { OleVariant ie; //IWebBrowser2 OleVariant ie = new InternetExplorer(); ...

Debugging COMException

I am using an ancient Intergraph routing library to do some routing. I could create several ActiveX and COM objects just fine but there is this one type "Location" and "LocationCtrl" that throws a COMException on creation. Here's the relevant code _sourceLocation.Streets = _streets; _sourceLocation.VerifyAutomatic = fa_sourceLocations...

ScreenShot of WebBrowser Control blank on 301/302 redirects

I'm using some code from SmallSharpTools Web Preview to get screen shots of websites but i get a blank screen shot if the url returns a 301/302 redirect. WebBrowser wb = new WebBrowser(); wb.ScrollBarsEnabled = false; wb.Size = new Size(1024, 768); wb.ScriptErrorsSuppressed = true; wb.AllowNavig...

Find a "native" dll which calculates a MD5/SHA1 hash in windows 2003 server

Hi, Does anyone know if there exist a dll in windows (2003 server) which I can call to calculate a MD5/SHA1 hash for a string? I've written a .dll in C# that do this but I'm not allowed to use this because of company regulations for our servers. /Ausgar ...

How to get a hold of the real object in ServicedComponent code

I have a ServicedComponent COM+ class running in a server application. It uses JIT and pooling. I want to keep track of all of the existing instances in a singleton list and call a method UpdateDisplay on them every once in a while. I have each ServicedComponent-derived object register itself by inserting a reference to itself into a si...

How to check if a container supports multiple connections?

Implemented the Sink Class - to receive event notifications from COM Server Event Interface derives from IDispatch I have an issue whereby an IConnectionPoint::Advise call returns E_NOTIMPL. This could be because the connection point only allows one connection - MSDN. Note: COM Server is out-of-process Pure C++ implementation EDI...

How to prevent crashing if com dll isnt registered

Hi From some old c++ code im trying to use a com dll, it works fine when the dll is registered, but it crahses if the dll isnt registered. // Initialize COM. HRESULT hr = CoInitialize(NULL); IGetTestPtr ptest(__uuidof(tester)); "Use method from the dll" // Uninitialize COM. CoUninitialize(); Is it anyway to check if the dll has bee...

Is it possible to use reg free COM with HTA applications?

Since HTA applications are hosted within MSHTA.exe how does one provide a manifest? Plus I assume providing a MSHTA.exe.manifest could potentially break other HTA apps? ...

Invalid Variant Operation Exception Trying to Access OleVariant in Delphi - Works in C#

I'm trying to access an OleVariant in a callback that is coming from an ActiveX library. Here's what the event handler is defined as in the TLB: procedure(ASender: TObject; var structQSnap: {??structVTIQSnap}OleVariant) of object; Here's the definition of structVTIQSnap in the TLB: structVTIQSnap = packed record bstrSymbol: WideSt...

How to check if a Server and Client are in the same concurrency model?

The concurrency model can be either apartment-threaded or multi-threaded Question: How to ensure that both the Client and Server are operating from within the same concurrency model? ...

Problem in releasing memory from an Outlook pst file

I am working on a win app which accesses the Outlook personal folders. Internally, it mounts the personal folder on the Outlook instance and processes the mails and then unmounts the pst. After unmounting the pst, I delete that file. Now the problem is that even after un mounting the pst and releasing memory, when I try to delete the ps...

.NET mshtml: How to pass a BSTR SAFEARRAY?

The class mshtml.HTMLDocumentClass in Microsoft.mshtml.dll assembly has a method: public virtual void write(params object[] psarray); Avoiding the real question for a moment, what code would you use to call write()? Would you use: String html = "<html><body>Hello, world!</body></html>"; mshtml.HTMLDocumentClass doc; ... doc.write(htm...

What is the C# data type for WINOLEAPI?

I am using some native methods to bind to running objects in a COM-based application. One of the methods is the CreateBindCtx, which has the following signature (from MSDN) WINOLEAPI CreateBindCtx(DWORD reserved, LPBC FAR * ppbc) I have defined the wrapper to be public static extern void CreateBindCtx(int reserved, out IBindCtx ppbc)...

Controlling Office 2007 with .NET: which direction?

I want to retrieve items from Fortress via its .NET API and load their descriptions into Project 2007. I was thinking about the 'best' way to do this, so I thought I would put it to my fellow stackers: Should I write a .NET assembly and wrap it in COM for Project 2007 to call from VBA? Or should I write a .NET assembly that calls Proje...

How to reuse a (Delphi) OLE server with a second client?

I wrote an OLE automation server (using Delphi). I usually start the OLE server manually and use it as a normal application. From time to time I start a client, which automatically connect to the existing OLE Server. When I terminate the client, the server does not terminate (at least when it was started manually before the client) but...

Disinheriting(?) / overriding .ToString to access COM Object .toString

I have a java library that I am accessing in VB.NET via COM. The objects on the java side expose non-trivial .toString methods that I need for debugging. Unfortunately, when I call .toString on the COM objects, the call is being intercepted by the Object class' .ToString function. How do I force the call to the COM-side .toString and ...

TSQL OLE (com) Objects

Are there any inherent problems with calling an ole object from tsql? I have been posed with a problem that I would like to solve solely using a stored procedure, is there anything I need to worry about with using a ole object as opposed to writing it in a clr based language? ...

How to determine the supported thread model of an out-of-process COM server?

Question: How to find the threading models supported by a predefined out-of-process (EXE-based) Server: Using oleview? Or any other valid methods? Note: Attempting to connect to the above described server to receive event notifications ...

How to efficiently implement an event loop?

COM Object (Server) sends event notification successfully to COM Client Without: ATL MFC How to efficiently get the main thread to wait/sleep (infinitely) until COM Server notifies the COM Client of a particular event? ...