Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Wikipedia:Reference desk/Archives/Computing/2025 December 9

From Wikipedia, the free encyclopedia
Computing desk
< December 8 << Nov | December | Jan >> Current desk >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


December 9

[edit]

Microsoft Q&A problem (and a computing question)

[edit]

I've been trying to ask the following question on the Microsoft Q&A site :


I'm updating a WPF application that's written in C#. My development environment is Visual Studio 2023. The application currently uses .NET Framework 4.6.1, but I'm hoping to upgrade to a more modern version of .NET as part of the update.

The application uses a 32-bit COM dll, which I've called "DataTest" in the code below. This has been registered with regsvr32 and appears on the list of available COM objects in my project. When added to the "References" section, a DLL named "Interop.DataTest.dll" is created in my \obj directory, as expected.

The DLL exposes a single object, "CDataTest", with various properties and methods. I instantiate it as follows:

   using System;
   using DataTest;
   namespace MyNameSpace.DataTest
   {
       /// <summary>
       /// Wrapper for DataTest CDataTest object
       /// </summary>
       public class DataTest
       {
           private readonly CDataTest _dataTest;
           public DataTest()
           {
               _DataTest = new CDataTest();
           }
       }
   }

This works correctly when I build the application in "x86" or "All CPUs" mode. However, I now need to access a new 64-bit DLL, so I need to build the application in "x64" mode. When I do so, I get the following exception when instantiating CDataTest:

   System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {[GUID]} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

"GUID" is the GUID of the CDataTest object. Following the advice in another question on this site, I've added the following keys to my registry:

   HKLM\Software\Classes\CLSID\{GUID}
   HKLM\Software\Classes\AppID\{GUID}

The first key contains only a REG_SZ value "AppID" which is set to the GUID, the second key contains only an empty REG_SZ value "DllSurrogate". However, this hasn't fixed the issue. A 64-bit version of "DataTest" or a 32-bit version of the new DLL are not available.


However, when I try and post it, I get a message "This question has been deleted due to a violation of our Code of Conduct". I have two questions for Wikipedia:

  1. Does anyone have any idea why the question above violates Microsoft's Code of Conduct? I don't see any obvious Scunthorpe problem.
  2. Can anyone help with the underlying DLL issue?

Thanks. ~2025-37950-70 (talk) 18:13, 9 December 2025 (UTC)reply

To answer the second part of my question:
  1. Create a new GUID using your favourite text editor (I used the one in Visual Studio). APP_GUID in the code below.
  2. In Regedit, find HKLM\Software\WOW6432Node\Classes\CLSID\{GUID}.
  3. Add a value "AppID" to this key, and set it to {APP_GUID}.
  4. Create the key HKLM\Software\WOW6432Node\Classes\AppID\{APP_GUID}.
  5. Set the (Default) value of this key to the DLL name (in my case, "DataTest.dll").
  6. Create a new REG_SZ value "DllSurrogate" for this key, leaving the value empty.
  7. Create the key HKLM\Software\WOW6432Node\Classes\AppID\DataTest.dll (or whatever your DLL name is).
  8. In this key, create the REG_SZ value "AppID", and set it to {APP_GUID}.

~2025-37950-70 (talk) 13:38, 10 December 2025 (UTC)reply