Upgrading App from .NET 3.5 to 4.0, COM fails now

I have an application that I am upgrading from the .NET 3.5 to the .NET 4.0 framework. It uses a COM library which is referenced. It works no problem in 3.5 but after converting to 4.0 I have issues getting the COM to work. The COM is from a 3rd party so we didn't develop it ourselves. I get the following COM error (generic COM error, not specific to the COM object itself): hr = 0x8007000b CLR gives me: 'The invocation of the constructor on type 'Skype_Business_Launcher.Main' that matches the

Getting COM object to run in Vista

We expose an interface to our simulation software using a COM/ActiveX object. This worked just fine in XP, but in Vista, we get "Error 429: ActiveX can't create object" when a VB client executes CreateObject(). The COM object has been registered by hand so that the Vista Registry is identical to XP's Registry. I run the VB interface from a DOS window that I started using "Run As Administrator". The client is correctly accessing and reading the Registry as I walk through using the debugger

Is .NET replacement for COM?

I want to know purpose of .NET and COM , Is .NET has the same purpose as that of COM ? Because main purpose of COM is to allow language interoperability so as that of .NET ? If so Why many companies still using COM for their development projects ? Is it worth learning COM when we can use .NET ?

Does COM CoCreateInstance trace-tool exist?

Over the year I have had a lot time when creating an instance of a COM-class fails. And it's always a hassle to understand why it failed, this time. I started thinking about writing a tool, which basically does all the steps CoCreateInstance does, but with logging. (Lookup GUID in registry, find DLL to load, load DLL, find the ComFactory in the DLL etc). This seems like a common issue, perhaps such a tool already exists?

COM - use IEnumerable in ATL C++ project

I use in my C++ COM server a C# COM DLL that implements IEnumerable for iterating over a collection. How do I specify in my native code that I want to access IEnumerable -> GetEnumerator() method from the instance object of C# Dll ? Do I have to import some *.tlb in order to see IEnumerable interface in my C++ project ? Ienumerable interface I saw is defined by mscorelib.dll Can I further expose an IEnumerable interface to my clients (defined in IDL in my C+ project). An example would be helpf

Symfony 2 : Handle COM Object

I would like to use a COM object in my Symfony 2 Controller. COM must be a part of PHP 5, so I guessed there would have been no problem. Here is my code: $ObjectFactory = new COM("CrystalReports11.ObjectFactory.1"); And Symfony returns me this error: Class 'App\InterfaceBundle\Controller\COM' not found I'm on Windows 7, using PHP 5.3. When displaying phpinfo, I can see COM object support enabled. What am I doing wrong? Is there any PHP inclusion to make in the Controller to make it work?

COM/OLE, Old code and Headaches

I'm currently living in 90's and I've been handed this piece of legacy code. I'm not knowledgeable when it comes to COM/OLE/MFC/ATL so I'm asking this, hoping that someone with experience from way back then, could help me to track down this issue. What I have is this really old/legacy MFC/ATL application. It launches, but eventually crashes in CFormView::HandleInitDialog (atlmfc\src\mfc\viewform.cpp) The debug output I get is this: CoCreateInstance of OLE control {6A24B340-7634-11D3-A5B0-0

LoadRunner COM/DCOM and Trapping Sub

When first using the protocoll advisor on my app I get reccomended to use the COM/DCOM protocoll for recoring the LoadRunnser VUser script. I am doing so but when starting to record I get a pop-up mesasage saying: "Trapping Sub Process" "You must be administrator to record sub processes, recording only main process" What does this indicate?

Com Is it possible to choose a manifest to use when starting a process in windows?

I am trying to provide a COM object that can be used as a replacement for an object in an executable that I do not have control of. I have created an implementation of this COM object with all the same interfaces. I want to be able to use this replacement only occasionally so I do not want its registration to replace the original object. I can get the executable to load my COM object instead of the original using reg-free COM by modifying the manifest of the executable to look in my dll to fi

COM ownership with composition in interfaces

Does a COM interface have to override AddRef and Release if it owns other interfaces? At interface creation, members are created that maintain a refcount, so I have to override Release to not leak the owned interfaces when the own refcount reaches zero. But what about AddRef? It seems like everything will be fine when just doing shallow copies of the owned interfaces. They might have a refcount below the owning interface, but can never reach zero when the owner has not reached zero. An exampl

Com How to jump from "dds esp" memory dump in WinDBG MiniDump to source code?

Suppose I have a crash dump in WinDBG with an unusable call stack (maybe a MiniDump). But using the console, I can get some approximation of the called code with a sequence of commands like: dds esp dds dds kb=<mem address> <etc> Once I get some hints about the function calls in memory like: MyDLL!MyClass::MyFunctionName (@D:\build\<path>\CodeFile.cls @ LineNumber) Is there a way to get WinDBG to open the Source pane to that code file at the right line? I always find myse

How do I specify binary data in a COM RGS file

I'm adding some custom data data to the registry during the registration of a COM object by adding it to the rgs file. Adding a DWORD value (specified by = d '3' below) gets entered into the registry as expected. For the binary/hex data however it does not get entered into the registry correctly. Can anyone advise what the correct syntax is for entering binary data in a rgs file? HKLM { NoRemove SOFTWARE { NoRemove MyCompany { NoRemove Settings {

How should I check that [out] params in COM can be used?

Officially one should not use [out] parameters from COM functions unless the function succeeded this means that there are (at least) three ways to see if an [out] parameter can be used. Consider the following interface interface IFoo : IUnknown { HRESULT GetOtherFoo([out] IFoo** ppFoo); HRESULT Bar(); }; Which of the following ways would you recommend on using it? 1. Check return value CComPtr<IFoo> other; HRESULT hr = foo->GetOtherFoo(&other); if (SUCCEEDED(hr))

Com Can I display GUID in windbg?

I am trying to debug some COM components and want to track down CLSID and IIDs in calls to CoCreateInstance. I am not sure how to display GUID in windbg. Any pointers for that.

Com Issues Using Midl to create a .tlb from .idl "expecting a type specification"

I have been having a prolonged encounter with the beast known as COM Interop... I am currently trying to generate a .tlb from a .idl file generated by the OLE/COM Object Viewer. However when trying to run Midl.exe to compile it I get an error: .\Sim.API.IDL(236) : error MIDL2025 : syntax error : expecting a type s pecification near "ImportFileStatus" My .idl file is more that 1000 lines long so I don't particularly want to post it here however, I believe the Part of interest is: typedef [u

Windows COM - how to debug a COM server

I have a com server(written in C++, ATL) that runs out of process. In one of my computers I am able to debug the server code easily just by starting the COM under the debugger, setting breakpoints and connection to the server from a client process. On my another computer this does not happen, if I start the COM server under the debugger from start, the client uses another instance of the same server and the only way to debug the server is to attch to it after the client already started it. How

How to find COM interface definition for given interface GUID?

I have a COM interface GUID but I don't know that interface definition. I don't know what methods it has, what parameters they have and so on. How can I obtain such information? Is it possible in general? Practical problem is obtaining interface definition for few COM interfaces defined in actxprxy.dll. For example IFileDialogPrivate ({AC92FFC5-F0E9-455A-906B-4A83E74A803B}). (Obviously the interface is not documented and the name does suggest there is a reason for that.) I tried to use OLE/CO

Hosting CLR in native - COM interfaces, unresolved external symbol _CStdStubBuffer_Release@4

I'm experimenting with hosting CLR (not trying to use mono for now, though I will probably try). Basically, I'm following this: http://www.lenholgate.com/blog/2010/07/clr-hosting---a-flexible-managed-plugin-system-part-1.html However, I've got some troubles with COM itself, as it's not so thoroughly explained in that article, and I'm learning as I go (haven't been playing with COM before). I've defined an interface: import "unknwn.idl"; [ object, uuid(55d96f88-9633-4ad7-b9de-1a546ea7

How to find COM object given only server.create instance?

I have inherited a classic ASP application and looking through the code I see a custom COM object reference Server.CreateObject("DBaseManager.Recordset") Now, unfortunately looking through to source code there are no .dlls provided so therefore the COM dll must still exist on the live server. In order to get the code working on my Dev Server I need to get a copy of the dll so I can register it on my Dev server. Does anyone have any recommendations about how I might be able to find the COM d

Com Where does CLSIDFromProgID() look in the registry?

MS' docs simply say: Given a ProgID, CLSIDFromProgID looks up its associated CLSID in the registry. But where exactly does it look? I have a weird issue where a wrong CLSID is being returned and I want to follow where this function is looking to help narrow down where the problem is.

how to ildasm/ilasm round trip a dll exposing COM objects

I want to round trip a dll that exposes COM objects (interop). With ildasm i dumped the dll. In the ildasm dump i renamed all occurances of the class name. An Ilasm with DLL switch and inclusion of the resources produced the new dll. I dont know how to register this new dll (Win7). Regasm/Regedit complains about a strong name. What else do i have to adjust? Thank you. Seppe

Com Thread safe hooking of DirectX Device

I successfully hooked BeginScene/EndScene methods of DirectX9's DeviceEx, in order to override regions on the screen of a graphics application. I did it by overriding the first 'line' of the function pointed by the appropriate vtable entry (42 for EndScene) with an x86 jump command. The problem is that when I would like to call the original EndScene method, I have to write the original code overriden by the jump. This operation is not thread safe, and the application has two devices used by two

Using success HRESULTs in COM

I have some functions in a COM interface that return different success values via the HRESULT, but using the space that is defined as "successful" (i.e. SUCCEEDED(hr) is non-zero). For example HRESULT MyMessageBox( BSTR title /*[in]*/, BSTR text /*[in]*/, long buttons /*[in]*/ ); a function that displays a dialog similar to a MessageBox; it returns an indicator of which button the user used to dismiss the dialog. (I defined an enum for this with values within the space of HRESULTs which is

Com How to implement advanced custom properties in VB6 usercontrols?

Sorry I don't know how to name it other than "advanced custom properties". If I know, I would search it first. I am dealing with a legacy code using 3-rd party controls. In VB6, When you drag that control onto the form, you can see all the properties supported by the control in the "Properties" window. Such as MarginLeft, MarginRight etc. etc. That's no problem. In the "Property" window, the top-most property is generally the "(Name)" field, which is the name of the control. But the 3-rd

How to register COM from VS Setup project?

I have marked my DLL as vsdraCOM, and I can see it in the registry after installing, but my application does not see the COM interface until I call RegAsm on it manually. Why could this be? The COM registration does not work on Vista (confirmed myself) and on XP (confirmed by a colleague). Using Visual Studio 2005 on XP.

HOWTO: Call Managed C# Interface From Unmanaged C++ On WindowsCE Compact Framework

I have extensive unmanaged Windows CE 5 C++ code that provides a UI that I want to use in a new product by combining it with a large amount of newer business and communications logic written in managed C# on Windows CE 6 and the Compact Framework. The UI may know about the business logic, but I want the business logic ignorant of the UI such that I can later replace it with a managed version, or any other UI that I choose as a front-end. I found an article that describes how to use COM as the

What are the frequently-encountered causes for COM memory leaks?

What are the most frequently encountered causes for COM memory leaks? I have read that passing the address of an initialized CComBSTR to a function as an [out] parameter causes a leak. I'm looking to enumerate other common programming mistakes like this.

Com How do I render the scrollable regions of a canvas with IViewObject::Draw?

I've been trying to render the entire canvas in an IWebBrowser2 control to a bitmap. IViewObject::Draw seems to be the most promising approach, but I can't get it to render anything that would requires a scroll to show. While I could automate the scrolling and stitch the images together, this would look weird with any fixed position elements. Is this even doable? Additionally, I've tried to set the controller's size to one that would allow the entire contents to display without needing to sc

Com Saving program shared data in Exchange Public Folder

I have a question reffering to Public Folders on Exchange Server. I have an application (Outlook Com Addin) that need to share settings amonge every Exchange User that have access to Public Folders. I was thinking about storing settings in MAPI assotiated message (hidden MAPI message). Wirting\Reading data from this message works fine, but I don't have good place to save this item. I am looking from some sort of global folder or root folder that every user have. I tried All Public Folders fo

What are Modules when creating COM objects with Embarcadero C++ Buider

I am creating a COM library with Embarcadero C++ Builder. The designer for the ridl file gives several things you can add to the ridl. I think I understand all of them except for creating new "Modules". I can't find good information for it in the documentation. What is a "Module" and what would it be used for in COM?

Using COM object from PowerBuilder - error 36: name not found accessing external object

I'm trying to access a third-party COM server from within Powerbuilder. I can instantiate the object but whenever I try to call a method or a property on the object I get error 36: "name not found accessing external object". OLEObject PNSession PNSession = CREATE OLEObject ll_status = PNSession.ConnectToNewObject("PNSrv9.PNSession") if ll_status = 0 then // Set the session printer try PNSession.SetSessionPrinter('TIFF Image Printer 9.0', 1, g_pfapp.null_string, False) catch (

Com Get artist name in Unicode with WMP SDK

I am writing a plug-in for Windows Media Player and need to get the name of the artist of the song currently playing. I use IWMPMedia->getItemInfo(L"Artist", &bstrArtist) to get the artist name. It works fine with ASCII names but if the name is Unicode, it returns a blank string. Does anyone know how to get around that problem? Thanks!

Does marking a parameter [out, retval] in IDL make error handling harder compared to [out]?

This is a follow up to this question When declaring interfaces in IDL, there are at least two ways to return values from an interface: [out] and [out, retval]. When [out, retval] is used, the COM wrapper makes the marked parameter the return value and no HRESULT is returned from the method anymore. The question is how then one obtains the HRESULT to test if the COM call succeeds or not? And, from an COM server design standpoint, is it generally considered bad practice to not return HRESULT on

Where the interop version is coming from when using TlbImp

I'm using tlbimp to generate a .Net interop of a COM assembly. This COM assembly has a product version and file version like 7.X.X.X but when I'm using TlbImp, my interop has then a version like 1.Y.0.0. I'm aware I can change this version when I'm using TLBImp via parameters of the executed command lines but I'm wondering where this version comes from. Can I access a manifest of this COM assembly? Why I cannot see this version on the property of the file in the explorer? I have different versi

COM calling convention on x64

I am trying to get a definitive answer regarding the way COM behaves on a x64 machine. Does Windows use the normal x64 calling convention when dispatching calls to COM interfaces on x64 machines (assuming the COM implementation is 64 bits)? Specifically, I dynamically generate my vtbl entries to point to a chunk of assembly that's dynamically loaded during runtime. This assembly needs to know how to get parameters correctly from whomever is calling it. Thus, I'd like to know if COM sets up the c

ATL/COM: Can I have the same function in two different interfaces of the same object?

I have an ATL/COM-based DLL, written in VC++ 6.0. Until recently, there was a one-to-one correspondence between my COM interfaces and classes. For example, let's say there was a ICar interface; then there was also a CCar class which implemented it, and no class other than CCar implemented ICar, and CCar implemented no interface (of mine) other than ICar. Similarly, IPlane and CPlane. The definitions might be something like: ICar had functions "StepOnGas" and "MaxPassengers"; IPlane had func

Com Setting the folder view in a CFileDialog (MFC)

Is there a standard way to set the folder view in a CFileDialog (Vista-style enabled)? I'm trying to get it to show Details view and some custom columns. I've implemented a Windows 7 column handler that displays app-specific info for files created by my app. However, in order to view these custom columns in an Explorer window or a common file dialog, I have to manually set the folder view to Details then select the specific columns I want. This works fine, but the goal is for the file selecto

Running excel automation on window server 2008 r2 got InteropServices.COMException

My application was running on following environment Window Server 2008 R2 64bits Microsoft Office 2007 IIS7 I did some way to solved that kind of problem. Making the Desktop folder under C:\Windows\SysWOW64\config\systemprofile\ and also Run dcomcnfg. Right click Properties on the node Component Services\Computers\My Computer\DCOM Config\Microsoft Excel Application. Under the Security tab, under Launch and Activation Permissions select the Customize option and click the Edit button and gr

From XP to Win 7: Unable to cast COM object to interface type. Failed due to "No such interface supported"

Note: I am very, very new to Windows development I just converted a Visual Studio .Net 2003 solution to VS 2005 (our first step toward VS2012). The converted VS 2005 solution works perfectly in its original 32-bit XP environment however fails with this "No such interface supported" error in 64-bit Windows 7. Error 13: Unable to cast COM object of type 'Reflection.Session' to interface type 'Reflection.DApplication'. This operation failed because the QueryInterface call on the COM component f

Create new process for every class of COM server

I created outproc COM server, it implements ClassA and ClassB. Factories of both classes are registered with CoRegisterClassObject(REGCLS_SINGLEUSE, CLSCTX_LOCAL_SERVER). When client app calls CoCreateInstance(ClassA) system creates process of my COM server. When client app calls CoCreateInstance(ClassA) again system creates additional process of my COM server. But when client app call CoCreateInstance(ClassB) system does not create new process, it uses already created. So two classes work in t

Updating a com dll

We have an application which uses COM dll.Now, we are pushing updates of this dll.We copy the new dll ( overwriting the existing one) and register the dll. Is this a good practice.Or, should we first unregister the dll already on clients machine.

Com Problems passing in a UserControl as a parameter in VB6

I have a COM-visible method which looks something like the following: Public Sub SomeMethod(someControl as Object) On Error Goto ErrHandler Dim someSpecificControl as SpecificControl MsgBox TypeOf someControl is Control MsgBox TypeOf someControl is SpecificControl On Error Resume Next Set someSpecificControl = someControl On Error Goto ErrHandler if someSpecificControl is Nothing then Exit Sub end if ' do stuff to the control End Sub Other components wou

Com Need to unmarshal interface pointers again which are received through QueryInterface?

If I receive a interface pointer present in the other apartment than the current, I am required to Marshal it at the sending apartment side and Un-marshal it at the receiving side. On interface pointer thus received can I do a QueryInterface? If I did the QueryInterface, is the pointer thus received is a usable interface pointer or does require any marshaling again? Thanks F

Use VB6 COM DLL as a shell or interface with .NET code behind

I have a widely used but old VB6 COM DLL that needs additional functionality. I would like to get rid of the old DLL but it's used by at least 27 applications that I don't want to recompile. Is there a way to use the "old VB6 COM DLL" (and all of it's COMie -ness) as a shell or interface with .NET code behind it actually doing the all the processing. The goal is to have the 27 applications thinking that the old DLL is still there processing? If this idea can be implemented then, I'll only ne

Is it possible to have Windows Installer register a 64-bit shell extension which is wrapped in a 32-bit Component?

I have an InstallShield Basic MSI project which builds both 32-bit and 64-bit installers using Release Flags mechanism to build the different packages with the correct Template Summary, etc. One of my Components is an explorer.exe shell extension, so in order for this to work it needs to be registered in the 64-bit node in the registry when installed on windows 64-bit, NOT in the Wow6432Node. However, because this is a 32-bit Component to Windows Installer it will get registered as such and go d

Com Is there any internal timeout in Microsoft UIAutomation?

I am using the UI Automation COM-to-.NET Adapter to read the contents of the target Google Chrome browser that plays a FLASH content on Windows 7. It works. I succeeded to get the content and elements. Everything works fine for some time but after few hours the elements become inaccessible. The (AutomationElement).FindAll() returns 0 children. Is there any internal undocumented Timeout used by UIAutomation ? According to this IUIAutomation2 interface There are 2 timeouts but they are not ac

How to clean unused COM registration from the registry?

I got some COM components (DLLs) registered on my machine, however the DLLs associated these COM components were deleted (so I can't use regsrv32). How can I clean up my registry of these old COM components. I wonder if there is a tool that list what's registered and allow me to remove components I know are no longer used.

Com How to save or load properties of filter in DirectShow

I have a source filter in the graph of my application. I could show the properties page by using standard API (from oleaut32.dll - OleCreatePropertyFrame, see Displaying a Filter's Property Pages). But how to save/serialize and load/deserialize the filter properties from code? I'm using DirectShow.NET to build graph.

  1    2   3   4   5   6  ... 下一页 共 6 页