Use OCX without registering it

Yes, this can be done. You must assume your application will only be deployed on Windows XP (or Windows Server 2003) or later, and then you can use what is called ‘registration free COM’ to make this happen. Essentially what you do is create a manifest file for the ActiveX control DLL so the Windows … Read more

Using Component Object Model (COM) on non-Microsoft platforms

Answering myself but I managed to find the perfect library for OLE/COM calling in non-Microsoft compilers : disphelper. (it’s available from sourceforge.net under a permissive BSD license). It works both in C and C++ (and thus any other language with C bindings as well). It uses a printf/scanf-like format string syntax. (You pass whatever you … Read more

Error 80040154 (Class not registered exception) when initializing VCProjectEngineObject (Microsoft.VisualStudio.VCProjectEngine.dll)

There are not many good reasons this would fail, especially the regsvr32 step. Run dumpbin /exports on that dll. If you don’t see DllRegisterServer then you’ve got a corrupt install. It should have more side-effects, you wouldn’t be able to build C/C++ projects anymore. One standard failure mode is running this on a 64-bit operating … Read more

Is .NET “all COM underneath”?

I think he’s talking about the underlying implementation of the CLR. From my understanding, he’s not talking about the interaction of the COM and .NET worlds. He’s merely telling us that they have used C++ and COM in the implementation of the runtime. I was under the assumption it is perfectly possible to write .NET … Read more

What does “Method ‘~’ of object ‘~’ failed” at runtime mean?

That can happen when supporting libraries (dlls or ocxs) are not registered properly or the versions of the installed libraries are different (and incompatible) with the version the app was compiled against originally. Make sure all dependent libraries are registered and the proper version. You may have to recompile the app to make it work … Read more

The difference between traditional DLL and COM DLL

No, there’s a Big difference. COM has a well defined protocols for creating objects, exposing methods, managing memory, publishing type information, managing threading. There is practically no language left that doesn’t support using a COM server, no matter what language it was written in. You will not get that from exposing your own functions directly. … Read more

Why use FinalReleaseComObject instead of ReleaseComObject?

Some preamble… A Runtime Callable Wrapper (RCW) only calls IUnknown.AddRef once on the unmanaged COM interface that it wraps. However, an RCW also maintains a separate count of the number of managed references there are to the RCW itself. It is this separate count of managed references that is decremented by a call to Marshal.ReleaseComObject. … Read more

Unload a COM control when working in VB6 IDE

I’m pretty sure there’s no good way to force VB6 to unload the control. Here’s what I do… instead of running Visual C and Visual Basic side-by-side, run VB6 under VC : Load up VC Open the project containing your COM objects Edit, change, etc. In VC, set the Output Executable to be VB6.EXE with … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)