Trying to understand how to use OLEObject and DLLs

I’ve been tasked with updating a project that uses a few dlls and OLEObject in the Xojo code. The code is from the XP days and has some bad habits like installing those dlls in the Windows directory, so I’m trying to resolve that. I’ve placed the dlls next to the exe, but New OLEObject("class name") is giving me a class not found error. Is there something I need to do to tell the app to use the local dlls?

If memory serves, OLE DLLs have to be registered using the regsvr32 command.

e.g.

regsvr32 c:\windows\system32\thisismy.dll

3 Likes

Same is true of an ActiveX server with a .exe extension

Hmm. Ok. Tried that with all three DLLs, but all three tell me there is no DllRegisterServer entry point. So I guess I don’t have the right files.

Usually means theyre not ActiveX (OLE) dll’s or you need to use the 64 bit compatible version https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://support.microsoft.com/en-gb/topic/how-to-use-the-regsvr32-tool-and-troubleshoot-regsvr32-error-messages-a98d960a-7392-e6fe-d90a-3f4e0cb543e5%23:~:text%3DNote%2520On%2520a%252064%252Dbit,%2525%255CSysWoW64%255Cregsvr32.exe.&ved=2ahUKEwjnwIeZuLyAAxXIF4gKHeziAW4QFnoECBQQBQ&usg=AOvVaw2gJY9QzQRBg_w3meY8mhZi

Unfortunately I’m not a Windows dev, so this is an area I have very little experience with. I’ve literally never used ActiveX or OLE. We’re given three potential packages to download: .NET, C++, and VCL. But the .NET is the only one that contains any DLLs, but it has three versions of each: netcoreapp3.1, netframework, and netstandard2.0. So I’ve guessed that netframework is the right one, but I’m well out of my depth.

Well for the curious, the trouble comes from the fact that OLE support was dropped ages ago. There’s no option for utilizing this framework without writing a Xojo plugin. Good news is MBS will likely be able to replace its functionality.

This kind of stuff is why people shouldn’t wait 15 years between updating their apps.

1 Like

If you cannot register them then their not OLE DLLS and then it has nothing to do with the low support for OLE.

.NET DLL’s do not have to be OLE DLL’s since a .NET DLL has to be compiled with special flag when it was made to make it build ole bridge in it.

There is a high chance that the DLL is a 32 bit one. If that is the case, then it should be installed in the Windows/SysWOW64 folder and registered from there.

There is no such thing. Please don’t give false information. You can put the dll any where and register it

1 Like

I doubt its the privilege issue. try to open the cmd line as Run As Administrator and then register it using regsvr32 …

No, I have confirmation from the author that OLE support was dropped. As I mentioned, the only way to use this library is by making a Xojo plugin.