com

Register ocx for system (not just current user)

So I am installing an OCX which works great for the current user (when I use regsvr32) however I want to register the ocx for the system, not just the current user. Is there a way to easily do this? ...

Why is this C# COM class usable from VBScript but not JScript?

Consider the automation-compatible COM library in C#, given below. It follows a common COM pattern of having a visible factory coclass FooFactory implementing ICreateFoos which creates an object of type IFoo. FooFactory is the only coclass in the type library. (The factory pattern is particularly useful with COM, as it does not allow for...

IWebBrowser2 and multithreaded apartment?

Hi all, I am developing a Windows app with WebBrowser control (IWebBrowser2) embedded. Things look good if I initialize COM apartment as single threaded: CoInitialize(NULL); However, if I change it to be multithreaded: CoInitializeEx(NULL, COINIT_MULTITHREADED); then it starts to fail all over the places with return value of: ...

Direct Show graph - how to get the current fps?

Hello I have an instance of IFilterGraph - my own graph with video filters (source, transofrm and renderer). How can I obtain the current fps (video frame rate) of running graph? Regards Dominik ...

Prevent Excel from quitting

Update: I still don't have a viable solution to this question, new proposals are welcome! I'm missing an Excel.Application.Quit or an Excel.Application.BeforeQuit event. Does anybody know a workaround to mimic these events? Given an Excel.Application object (COM Interop in C#), how can I: Preferrably prevent Excel from quitting? If t...

COM interop question

Am using COM interop in my C# application. I've this line of code: IMyInterface objData = MyCOMClass.GetData(); My question here is: Do I need to release resources on objData by using? System.Runtime.InteropServices.Marshal.ReleaseComObject(objData); Thanks for reading. ...

No intellisense for dynamic keyword?

Hello, I am reading Silverlight 4 in Action and simultaneouly trying examples in it. However, i can't seem to understand the new dynamic keyword and why is it needed for COM. This is my code :- if (AutomationFactory.IsAvailable) { dynamic excel = AutomationFactory.CreateObject("Excel.Applica...

HttpWebRequest / WSAStartup issue

I have some managed C# code which is accessed on a thread from C++ through COM. When I make an HttpWebRequest in my C# code it initially works, if I deactivate some of the code on the C++ side. However, when I reactivate all the C++ code, then my C# HttpWebRequests start failing with the error: "Either the application has not called WSA...

DAO.DBEngine.OpenDatabase: Mémoire insuffisante. (ie. Out of memory)

I'm working on an application that talks to an Access database via DAO. Normally I use CreateObject("Access.Application") to get a copy of Access, then refer to the database via Application.CurrentDb, which works fine. But for some activities we need to do this instead for speed (VBA written for clarity, though the app is actually in C...

Retrieve User Entry IDs from MAPI

Hi folks, I extended the win32comext MAPI with the Interface IExchangeModifyTable to edit ACLs via the MAPI. I can modify existing ACL entries, but I stuck in adding new entries. I need the users entry ID to add it, according this C example (Example Source from MSDN) STDMETHODIMP AddUserPermission( LPSTR szUserAlias, LPMAPISES...

SpeechLib Issue With Different Language on WinXP

I'm currently working on an application that uses SpeechLib and ships with several different SAPI compatible voices. All is fine on Windows 7, but on Windows XP (English) it refuses to speak with any of the voices other than the English one. GetVoices() returns all the voices, and SPVoice lets me set the voice to the other language, but ...

How do I use IShellWindows::FindWindowSW with a cookie value?

I am monitoring the creation/destruction of Windows Explorer and Internet Explorer windows using DShellWindowsEvents.WindowRegistered and DShellWindowsEvents.WindowRevoked. The WindowRegistered event gives you the cookie value associated with the window (documentation). If I want to get the IDispatch interface of a given window, the docu...

Getting error when trying to handle ActiveX event

Hello, I have a two ActiveX servers I need to handle it's events. the first one I got to work with no problems but with the second one I get a error once I try to assign a new event. The one that works the code is below: public delegate void ICwGetXEvents_OnCommandExEventHandler(uint CommandW, uint CommandL, string CommandText); ...

blocking in STA COM object

I'm about to write a control that has this defect. Why exactly is this bad? Your ActiveX control has a common defect that single-threaded apartment (STA) ActiveX & COM objects must avoid: STA COM objects cannot perform blocking operations on the STA thread, unless the COM object also pumps Windows messages. Therefore, ...

how to raise resize request to active-x container?

We have an active-x control developed using ATL with MFC support. Our active-x control shall be used in something called frame application. The frame application create its own active-x control and embed our active-x control inside it at runtime. There are 20+ frame applications in the industry. Now the issue is that each frame applicat...

.NET user control for use in a web browser and prevent design time use

Hello, I created a .NET user control that will be installed on a user's pc via cab file. the cab will be signed with my company name and will register the .net component on the user's machine. I would like to make sure that users do not take my .net binaries that are on their pc and use them at design time in 'ANY' IDE .. With ActiveX...

DirectShow's PushSource filters cause IMediaControl::Run to return S_FALSE

I'm messing around with the PushSource sample filter shipped with the DirectShow SDK and I'm having the following problem: When I call IMediaControl::Run(), it returns S_FALSE which means "the graph is preparing to run, but some filters have not completed the transition to a running state". MSDN suggests to then call IMediaControl::GetS...

.NET [LicenseProvider(typeof(LicFileLicenseProvider))] and LicenseManager.UsageMode

Hello, I started using the .NET licenseProvider to add licensing for my net user control that can be used in a web page. In my user control's constructor I check if the control is being used in DesignMode or RunTimeMode : bool designMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime); As soon as I start using the [Licens...

COM: how to choose the compile option?

in the VS2008 ide, i write a wrapper to encapsulate the VC dll(vc.dll) to be a Com(com.dll) and the vc.dll will be called by c.exe qutsion#1: i found the compile option for vc.dll was Char Set:Not Set my question is, Which Char Set should i use to compile the com project? question#2: if we set the Char set to be Not Set also for the ...

How can I use an ITypeInfo pointer to get the name of the type?

Should be a simple question, but searching the documentation is driving me nuts. Suppose I have an ITypeInfo pointer for a coclass or an interface. How do I get the name of that class or interface? ...