Visual C ++ 6.0 for Windows 8

Visual C ++ 6.0 is not supported on Windows 8, but we have some outdated applications that still need to be compiled using Visual C ++ 6.0 .: - (

You can install Visual C ++ 6.0 on Windows 8 by unchecking Data Access → Change Settings → ADO, RDS, and OLE DB Providers . See this SU question and this thread . After that, you will also need to install SP6.

Visual C ++ 6.0 works fine on one computer, but the other two cannot use the debugger. The same hardware, the same version of Windows, the same person performing the installation, the same project. There must be some difference ...

On computers with a problem, you can set a breakpoint and the debugger will go into the IDE, but when you try to take a step, enter or run the code, the error will be Unhandled exception in EXENAME.EXE (OLE32.DLL): 0xC0000005: Access violation .

Walter Oney reports the same problem on MSDN forums , but they have no solution, as VC ++ 6.0 is not supported.

Since we have Visual C ++ 6.0 running on the same Win8 computer, there is a way to do this. Any ideas on what the difference could be?

+8
visual-c ++ windows-8 vc6
source share
5 answers

Disabling OLE RPC debugging (Tools / Options / Debug) works for me (Windows 8 Pro 64 bit, Visual C ++ 6.0 Service Pack 6). This solution was proposed (later) within the aforementioned MSDN forum topic.

+5
source share

One wrinkle - I had the same problem with the Visual C ++ 6.0 debugger in Windows 8.1. But I could not find the RPC debugging option in the "Tools / Options / Debugging" option described in the answer above. Instead, I had to go into the registry editor and remove the RPC debugging key mentioned in the same MSDN stream that was listed above (it may have been there because I already installed later versions of Microsoft Visual Studio before I installed 6.0) . The debugger is working fine now, and thanks to the previous posters!

+1
source share

In the end, I managed to get VS 6 to work with Win 8 and Win 10. The main steps were the following:

  • Create a dummy file named msjava.dll in \ Windows. (For example, "echo> msjava.dll") Without this step, the VS 6 installer cannot go very far.

  • Install VS 6 and SP 6.

  • Rename MSDEV.EXE to something else, such as MSDEVQ.EXE.

  • Create a compatibility database for MSDEVQ that eliminates heap resiliency. Without this step, debugging a program that makes heavy use of HeapAlloc, etc., is painfully slow.

  • For debugging, make sure the breakpoint is turned off before OLE32 calls can occur. I include the following header at the beginning of the main program or (for the MFC application) the InitInstance function:

X64DebugHack.h:

#ifdef _DEBUG // In order to be able to debug this application on x64, we need to single // step across at least one statement before ole32.dll gets loaded. So // always leave this breakpoint in place. requiredbreakpoint: int junkola = 42; // Check to see that there was a breakpoint... PUCHAR pjunk; _asm lea eax, requiredbreakpoint _asm mov pjunk, eax if (*pjunk != 0xCC) AfxMessageBox("Required breakpoint was not set prior to loading OLE32.DLL -- single stepping will not be possible during this debugging session.", MB_OK | MB_ICONHAND, 0); LoadLibrary("OLE32"); #endif 
  1. Record the optional DLL version that provides the Debug Debug button. The extension should look for and destroy debug descriptors that have a different type of descriptor in Win64 than in Win32. The mechanics of writing an extension are beyond the scope of this forum, but the code that does the actual work is here:

CCommands :: HelpAssistantKill:

 typedef LONG NTSTATUS; #define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0) #define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004L) enum SYSTEM_INFORMATION_CLASS { SystemHandleInformation = 16, }; typedef NTSTATUS(NTAPI *PNTQUERYSYSTEMINFORMATION)(SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG); typedef struct _SYSTEM_HANDLE_INFORMATION { ULONG ProcessId; UCHAR ObjectTypeNumber; UCHAR Flags; USHORT Handle; PVOID Object; ACCESS_MASK GrantedAccess; } SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION; typedef struct _SYSTEM_HANDLE_INFORMATION_DATA { ULONG HandleCount; SYSTEM_HANDLE_INFORMATION HandleInformation[1]; } SYSTEM_HANDLE_INFORMATION_DATA, *PSYSTEM_HANDLE_INFORMATION_DATA; #define HANDLE_TYPE_DEBUG_OBJECT 11 // correct value for Win8 x64 STDMETHODIMP CCommands::HelpAssistantKill() { // CCommands::HelpAssistantKill AFX_MANAGE_STATE(AfxGetStaticModuleState()); BOOL didit = FALSE; HMODULE hDll = NULL; PSYSTEM_HANDLE_INFORMATION_DATA phi = NULL; do { // do once HRESULT hr; // Locate NtQuerySystemInformation within NTDLL.DLL hDll = LoadLibrary("NTDLL"); if (!hDll) break; PNTQUERYSYSTEMINFORMATION NtQuerySystemInformation = (PNTQUERYSYSTEMINFORMATION) GetProcAddress(hDll, "NtQuerySystemInformation"); if (!NtQuerySystemInformation) break; // Do an initial query to get the number of handles presently open in the system. // This is a large number. The returned length value is meaningless for this query. SYSTEM_HANDLE_INFORMATION_DATA hid; DWORD junk; NTSTATUS status = (*NtQuerySystemInformation)(SystemHandleInformation, &hid, sizeof(hid), &junk); if (!NT_SUCCESS(status) && status != STATUS_INFO_LENGTH_MISMATCH) break; ULONG length = sizeof(SYSTEM_HANDLE_INFORMATION_DATA) + (hid.HandleCount - 1) * sizeof(SYSTEM_HANDLE_INFORMATION); phi = (PSYSTEM_HANDLE_INFORMATION_DATA) new UCHAR[length]; if (!phi) break; // Get a list of all handles open in the system status = (*NtQuerySystemInformation)(SystemHandleInformation, phi, length, &junk); if (!NT_SUCCESS(status)) break; // Find and close any debug objects that are open in this instance of Visual Studio. DWORD pid = GetCurrentProcessId(); ULONG ihandle; for (ihandle = 0; ihandle < hid.HandleCount; ++ihandle) { // for each open handle PSYSTEM_HANDLE_INFORMATION p = phi->HandleInformation + ihandle; if (p->ProcessId != pid || p->ObjectTypeNumber != HANDLE_TYPE_DEBUG_OBJECT) continue; if (CloseHandle((HANDLE) p->Handle)) didit = TRUE; } // for each open handle // Instruct DevStudio to stop BSTR bsStopDebugging = SysAllocString(L"DebugStopDebugging"); if (!bsStopDebugging) break; hr = m_pApplication->ExecuteCommand(bsStopDebugging); SysFreeString(bsStopDebugging); if (hr != 0) break; } // do once while (FALSE); if (phi) delete[] phi; if (hDll) FreeLibrary(hDll); if (!didit) { // didn't do anything MessageBox(NULL, "Unable to find and close any debug object handles", "HelpAssistant", MB_OK | MB_ICONINFORMATION); } // didn't do anything return S_OK; } // CCommands::HelpAssistantKill 

It seemed like a pretty heroic effort, but I had about a million lines of code built on VS 6 that I had to keep working. Now that I have built a workable macro processor for VS 2015, I can undertake the conversion of this application.

0
source share

The problem is with the incompatible "ADO, RDS, and OLE DB Providers" along with Visual C ++ 6.0.

Please follow the instructions below to disable ADO, RDS and OLE DB Providers and install Visual C ++ 6.0 -

1) Run the installation as usual.

2) Click "Custom Installation" when the installer asks for the type of installation.

3) Click "Access Data" from the available items, and then click "Change Option."

4) In the new window, deselect "ADO, RDS and OLE DB Providers" and click "OK" (ignore the warning).

5) Click Continue to continue the installation.

6) The installer will not freeze during "Updating components and will be successfully installed."

7) Now install the Vs6sp6 service pack and it will also be installed successfully.

0
source share

Not all answers to them work for me.

Solving this site fix my problem.

Re-register the ole32.dll file and see if it helps.

  • Click "Start", type cmd at the beginning of the search.

  • Right-click on cmd and select "Run as Administrator."

  • At the command prompt, enter the following commands and press ENTER. after each team.

    takeown / f ole32.dll

    regsvr32 ole32.dll

  • Close the command line after running the above two commands.

Try to start the application and check that the problem persists.

0
source share

All Articles