com

How do I silently register a COM assembly on a WinXP computer

I have a C++ console application to which I want to a Windows Form. I don’t want to use MFC because I don’t know how. Instead, I am using a C# to create the COM dll (Class Library). When I distribute the application and the dll to the target computer, I need to register the dll such that the application can see the COM interface and use ...

C# IE BHO: Do work asynchroniously while keeping to the same thread?

I have an IE BHO that's in development in C#. It is supposed to wait for the user to do some stuff, contact our server and download some data, and then alter the DOM of the currently loaded web page with the results. I am running into some seemingly insurmountable issues relating to the rules of COM compartmentalization and threading --...

Is there a tool like Reflector for COM libraries?

Is there a tool like Reflector for COM libraries? I would like to open a COM library and browse the classes and interfaces just like in Reflector. I would rather not install Visual Basic 6.0 in order to do this, if possible. ...

Wrapping a 3rd party DLL

Hi, I have a 3rd party DLL that needs to be loaded dynamically using LoadLibrary() and which uses the __cdecl calling convention. I need to be able to use the dll from VB6 so I've created a wrapper DLL of my own that uses the __stdcall calling convention and exports the functions that are needed. An additional requirement has now arri...

How can I use a User Defined Type (UDT) in a COM server?

I have a COM server with a method currently returning an integer: [ object, uuid("..."), dual, helpstring("IMyCOMServer Interface"), pointer_default(unique) ] __interface IMyCOMServer : IDispatch { [id(1), helpstring("method MyQuery")] HRESULT MyQuery([in] BSTR instr, [out,retval] int* outint); }; This comp...

failed accessing COM method after successful cocreateinstance

after successful coInitialize and cocreateinstance (COM server registration is perfect).. When i access a method in class it returns the error: "First-chance exception in XYZ.exe (OLEAUT32.DLL): 0xC0000005: Access Violation". By step by step debugging i found it gives this error while calling // make the call SCODE sc = m_lpDispatch->...

COM MFC application don't show window

Hello, I have a MFC application with ATL support, the idea is when someone creates an instance of my interface declared in the mfc application, this instantiation creates and displays a window. This all works fine if the com client is the cmd.exe, i made a quick com client that instance the interface and when this instances occur the ...

How to keep Excel interop from stealing focus while inserting images

I'm using the Excel COM interop to insert images (specifically EPS) into a spreadsheet. The images are inserted fine, but Excel ignores all the visible/background settings and steals the focus the display a dialog box saying something like "importing image". The dialog box only stays a fraction of a section, but it makes the screen fli...

The correct way to call unmanaged code from partially trusted code

What is the correct way to call unmanaged code such as a COM API through .Net interop from a code that is being executed in a partially trusted environment? While developing an ASP.Net WebPart for Microsoft SharePoint I had to communicate with another system through its COM API. I solved this issue temporarily by changing SharePoint's p...

Where is the Visual Basic COM project template?

I was at a class recently, and the instructor started a new Visual Studio 2008 project using a "COM project" template. Now that I'm back, I tried finding that template in my installation of VS2008 with no luck. Does anybody know where I can find that template, or failing that, what it might be doing to achieve its effect? ...

Will VB.NET automatically generate ComClass attribute and guids?

I've run across some VB.NET code that explicitly creates three GUID constants and uses them in a class's ComClass attribute. I've written COM-aware classes in the past just by checking the "Make COM-Visible" and "Register for COM interop" options in the project options. Is this explicit code simply unnecessary, or is it doing something a...

VC++ Charts using Chart X

Hi, I'm new to drawing the chart using chartfx can you give me the meanings of teh following methods, they are kinda confusing...I did not find documentation anywhere. GetValue ( ) GetXValue ( ) PutItem() Thanks, Arjun ...

in .NET, How do I set STAThread when I'm running a form in an additional thread?

I'm running a form in a second thread. If I do Ctrl-C to copy text on the clipboard, I get an Exception, "Current thread must be set to a single thread apartment (STA) before OLE calls can be made. (Using the clipboard involves OLE apparently). Putting the [STAThread] with my thread proc, which is the entry point of my second thread ...

Is there a DCOM-exposed object that permits streaming a write-locked UTF8 file?

The Scripting.FileSystemObject TextStream object supports Windows style Unicode and 'plain text' modified by the system codepage, but does not appear to support UTF8 -- However, it can actually stream files that are locked for updates, such as an IIS logfile. ADODB.Stream supports UTF-8 (or raw binary), but will not "LoadFromFile" a fil...

Using a reference parameter on ActiveX via Javascript

I have an ActiveX (3rd party, no source) with a method that has a reference parameter like this: HRESULT GetSomething( [in] short param1, [out] BSTR* someString); In C++ you'd execute it like this: BSTR someString = NULL m_activeX.GetSomething(0, &someString); How would I execute this via Javascript? All other functions in the Act...

Are there any reasons not to host a COM server in a COM+ application?

The simplest way to transform an in-proc COM server into an out-proc COM server is creating a COM+ application. What are the possible drawbacks of doing it this way? ...

How to debug regsvr32 post-compile DLL registration exception?

I'm using Visual Studio 2008 (on Windows 2003 Server / 32 bit) to compile a library and after the DLL is produced the "Custom Build Step" -> "General" executes a command line: regsvr32 /s /c "($TargetPath)" which generates the exception: An unhandled win32 exception occurred in regsvr32.exe [212]. This throws up a debug sessi...

CoRegisterClassObject never works...

Recently I've tried to solve several different issues with CoRegisterClassObject (because its introduction on MSDN looks pretty nice) - unfortunately it never works for me. Am I doing something wrong? Here's what I've tried: (1) Use CoRegisterClassObject for proxy/stub objects: I have a downloaded COM server (in DLL) with its proxy/stub...

What's the purpose of noncreatable coclasses in IDL?

What is the reason for declaring noncreatable coclasses like the following in IDL? [ uuid(uuidhere), noncreatable ] coclass CoClass { [default] interface ICoClass; }; I mean such class will not be registered to COM anyway. What's the reason to mention it in the IDL file and in the type library produced by compiling that ID...

Can I pass a HWND in a COM method?

Is it possible to have a COM method which passes a HWND? With the following method in my object CoCreateInstance returns DISP_E_BADVARTYPE (0x80020008): STDMETHODIMP ShowDialog(HWND hWndParent); So far, I'm getting round this problem by passing an OLE_HANDLE then casting it but it feels like a cludge: STDMETHODIMP ShowDialog(OLE_HAND...