com

Writing a simple ActiveX control for IE that has one method

I'm learning how to write a scriptable ActiveX control. My goal is to have a tiny control that can check to see if something is installed on the system. What I've done so far is: Create a MFC ActiveX control project in VS2008 Add some 'safe for scripting' bits that I found here. Extend the IDL to provide my "IsInstalled" method, which ...

IE Automation error in C# App

The following code, public class IEBrowser { SHDocVw.InternetExplorer view = new SHDocVw.InternetExplorer(); public void Display(String url) { // make sure it's open if (!view.Visible) view.Visible = true; view.Navigate(url); } } works as expected on the first call to Display. However, the ne...

How to authenticate windows application against other application/COM Object

I have 3 components in my system: COM Object - Provide Services to application that has func1(), func2() App1 - Trusted Application that need to use the com object funcs (1 and 2) App2 - Malicious application, not authorized to use func1(), can use func2() it is not harmful. How can the COM Object can "authenticate" App1 and allowin...

How to handle IHttpSecurity::OnSecurityProblem having a IWebBrowser2 object

Hello, I can't seem to understand how i give my implementation of the IHttpSecurity::OnSecurityProblem to my IWebBrowser2 object. I know that i need to implement a class something like this: class CServiceProvider : public IServiceProvider { public: CServiceProvider(); ~CServiceProvider(); // IUnknown ULONG STDMETHODCALLTYPE...

Is there a table of the matching types for marshaling in P/Invoke & InterOP?

I am almost buried by how the different dialects of types are matched between .NET world and native world. Such as MFC CList and other stuffs. I am desperately hoping for this: Some kind of table or cheetsheet that lists all the mappings between types of .NET world and native world. A table that lists all the types that can be marshal...

How's GUID determined?

How can applications ensure it's unique? ...

what's the implication of void**?

Hi friends~ When I develop in COM, I always see (void**) type conversion as below. QueryInterface(/* [in] */ REFIID riid,/* [out] */ void** ppInterface) What's exact meaning of it? IMHO, it tells the compiler not to enforce type validation, since the type which is pointed by the ppInterface is not known to the client code at compil...

Check COM Inteface still alive?

In COM how does one verify that a pointer to a COM object still has a valid object on the other end? I have an issue where this following bit of code attempts to check if the m_pServer pointer is still alive, however when that application exposing that interface is killed this bit of code crashes the application. Can anybody advice on ...

abode acrobat reader with vb.net

I am trying to display a PDF in an Adobe PDF reader COM component in VB.NET. All i do is: AxAcroPDF1.LoadFile("file path here") But for some reason it's not displaying the PDF. Can someone please advise me on what am I doing wrong here? ...

Access COM vtable from C#

Is there any way in C# to access a COM object's virtual method table in order to get a function's address? ...

From an ActiveX control, can I tell what domain it is being created from?

If possible, I want to prevent my ActiveX control from being accidentally executed by untrusted pages, because it can be used to download and run a file. One idea is to have the control know the domain of the HTML page it is instantiated on, and prompt the user if they trust this domain. It would remember this choice in the registry. If...

ComVisible(false) class with ComVisible(true) members

I’m studying for Microsoft Certification exams and I came across a situation with a class that was not ComVisible but had methods that were. I assumed that since the class was not visible to COM, that its members would not be accessible. However, apparently the members can be ComVisible even if the class is not. How can COM access a cla...

COMException: Type mismatch when trying to access a COM method

I tried to access a COM method by using a code like obj.Do("text") while Do is a method in obj which takes a ref string as its input (obj is a .COM object, written in VB6). However it always throw a COMException type mismatch. I tried passing obj.Do(ref a) while a is a string variable but it didn't work either. The VB code looks like th...

What languages to write windows shell extensions

I know how to write shell extesions in python. The drawbacks are it does not work on 64 bit Windows I am unsure how creating a python process everytime something “happens” reduces performance. I know how to write shell extensions using .Net (C#) The drawbacks are discouraged by MS I am unsure how this reduces performance. (does it?...

Registering a DCOM Server and running a client from remote system

Hi, I built a sample application for dcom by following the steps given in this link. After building the client and test DCom server, i tried to run client in my system and it worked correctly. But if i try to rum client from remote location, an error message is coming saying "Access is denied". How can i run my client in remote locati...

Is CreateInstance of necessary method for a source filter in directshow?

I read in a book that CreateInstance is a MUST for a source filter in directshow,but when I see this I doubt whetger it's true: CFactoryTemplate g_Templates[] = { { L"Virtual Cam", &CLSID_VirtualCam, CVCam::CreateInstance, NULL, &AMSFilterVCam }, I can name the CreateInstance static met...

Problem with triggering Events in a .NET DLL via COM from Delphi

Hello everyone, i have a problem with COM objects and triggering events. I have: a DLL written in C#.NET (3.5), which triggers events an application in Delphi5, which uses the DLL as a COM object. So far so good. Events go like this: - in the DLL there are 2 events. One is internal and is not COM-visible. The second one is external ...

Need to move .Net Assemblies to Program Files after Windows Update

I have a legacy windows client application that uses a several .Net assemblies (I created), one with a COM wrapper. The client application resides in a root drive subfolder (c:\somefolder...). Recently after a Windows update the application could not properly load the .Net assemblies. Prior to the update there were no issues. I fixed t...

Handling events from Word using dynamic com interop from C#

From Silverlight 4, it's pretty easy to start Word and let the user do something: dynamic word = System.Runtime.InteropServices.Automation.CreateObject("Word.Application"); word.Visible = true; word.Documents.Open("test.doc"); MS Word exposes a Quit event[1]. I'd like to handle this event, but for the life of me I can't figure out how...

How to export generic types to COM? Type library exporteder encountered a generic type instance in a signature.

I have a method with a default parameter: void Test(int? iRange = null); When trying to expose my class to COM, I get a warning: Type library exporter encountered an generic type instance in a signature. Generic code may not be exported to COM. Is it possible to some how expose this method? Edit Sorry, i think this is to do with t...