Troubleshooting Siemens 840D OEMProgPack VB6.0 Make EXE Hang
The Siemens SINUMERIK 840D HMI Programming Package (commonly shipped as OEMProgPack 7.6) ships with VB6.0 OEM sample projects in .\HMI-Programming-Package\HMI-Environment\OEMSamples. When engineers attempt to compile a modified OEM sample into a standalone *.exe using the VB6.0 IDE, the build process can freeze at 10%-20% of the resource-compile phase with no error dialog, no event-log entry, and no progress for many minutes. This article documents the root cause, the diagnostic path, and three field-validated remediation paths that preserve the original VB6.0 OEM API surface.
1. Problem Statement
Field symptoms consistently reported on the OEMProgPack 7.6 toolchain:
- VB6.0 IDE launches the Make XX.exe sequence without an error popup.
- Resource compilation indicator (status-bar progress) reaches 10%-20% and freezes.
- Wait time of 10 minutes or more produces no
*.exefile, no*.log, and no event in the Windows Application log. - Building a stock "Hello World" VB6.0 project on the same workstation completes normally, proving the VB6.0 runtime itself is not corrupt.
- The unmodified OEM sample (no user code added) reproduces the hang with identical symptoms.
Because the hang appears even on a fresh, untouched sample copied from the OEMSamples directory, the problem is environmental (IDE, host OS, or OEM sample dependencies) and not caused by user-modified BASIC source.
2. Affected Versions and Components
| Component | Version Tested | Notes |
|---|---|---|
| Siemens OEM Programming Package | OEMProgPack 7.6 | Shipped with HMI sl for SINUMERIK 840D sl / 840D pl |
| OEM Sample Project | .\HMI-Programming-Package\HMI-Environment\OEMSamples\*.vbp |
Provided as VB6.0 IDE project |
| Microsoft Visual Basic 6.0 IDE | SP6 (build 9782) | Last public service pack of VB6.0 |
| Microsoft Visual C++ Toolset (alt) | MSVS 2003 (7.1) or MSVS 2005 (8.0) | Recommended alternative for DLL build |
| Host Windows | Windows XP SP3 / Windows 7 / Windows 10 | Behavior identical across versions once VB6.0 is installed |
3. Root Cause Analysis
The OEM sample *.vbp registers dependencies that the stock VB6.0 compiler cannot resolve on the workstation. The most common dependency conflicts and their signatures:
3.1 Dependency on VC++-compiled OEM DLLs
The Siemens OEM model splits the HMI program into two halves:
- A VB6.0 front-end that owns the Forms,
*.frm,*.frxresources, and operator-screen logic. - A VC++ DLL (
*.dllbuilt under MSVS 2003 or MSVS 2005) that owns the HMI-PRO / WinCC flexible runtime interface and the OPC, MPI, or Profibus link to the NCK/PLC.
The DLL exposes the OEM interface (e.g. OEM.HmiInit, OEM.HmiRead, OEM.HmiWrite) which the VB6.0 *.exe imports at startup. If the DLL is missing, the VB6.0 linker cannot finish the import-table stage of the Make EXE operation. The IDE does not raise File not found because it walks the reference list silently during the resource compile; it simply blocks on the unresolved Declare statement.
3.2 Compiled-Helper-File (CHM) registration failure
Siemens ships compiled HTML Help workshop artifacts (*.chm, *.hhc, *.hhk) that the OEM sample references through the VB6.0 HelpFile property. On hosts where the HTML Help viewer is not registered, the resource compiler enters a retry loop while trying to bind HHCTRL.OCX. This matches the 10%-20% freeze signature exactly.
3.3 VB6.0 IDE is in an unsupported state
Microsoft has documented that VB6.0 IDE compatibility is best-effort on all post-Windows 7 operating systems. See the Support Statement for Visual Basic 6.0 on Windows for the official position. The hang behavior is consistent with the "It Just Works" runtime goal for already-compiled VB6 applications not always being met by the IDE's resource compile stage, particularly when COM/ActiveX controls registered by Siemens OEM runtime are present but point at missing OCX files.
4. Prerequisites for Diagnosis
- Administrative account on the development host (required to register OCX/DLL).
- OEMProgPack 7.6 installation media or a verified local install of
HMI-Programming-Package. - VB6.0 SP6 IDE with the latest cumulative update.
- Access to
regsvr32.exeand the Windows event viewer. - Optionally: Dependency Walker (
depends.exe) for symbol-level inspection.
5. Diagnostic Procedure
-
Confirm the symptom baseline. Copy the OEM sample to a write-protected working folder, open
XX.vbpin VB6.0, and select File → Make XX.exe. Time the freeze. If the freeze is reproducible on the unmodified sample, the problem is not user code. -
Inspect the project references. Open Project → References... in VB6.0. Note every
MISSING:entry. Siemens OEM samples referenceHMI Pro OEM Interface 1.0 Type Library,Siemens HMI Embedded Helper 1.0, and the VC-built OEM DLL's TLB. AMISSINGreference is the single most common cause of an unrecoverable build freeze. -
List the OCX dependencies. Open Project → Components... and identify all
*.ocxcontrols loaded by the OEM sample (e.g.MSCOMCTL.OCX,MSFLXGRD.OCX, Siemens-internal*.ocx). Verify each exists inWindows\System32(orSysWOW64on x64 hosts) and is registered withregsvr32 /uthenregsvr32. -
Trace the DLL import chain. Run
depends.exeagainst the VB6.0-produced stub*.exe(if an older build exists) or againstMSVBVM60.DLL+ the OEM DLL. Look for entries flagged withError: Can't find dependent libraries. -
Enable VB6.0 verbose logging. Set the environment variable
VB6_LOG=1and re-launch the IDE. Avb6.logfile is emitted in%TEMP%capturing the file I/O during Make EXE. The log pauses at the exact file that triggers the freeze. -
Check for the HTML Help binding. If the OEM sample sets
App.HelpFile = "...\OEM.chm", ensure the CHM file exists and thatHHCTRL.OCXis registered. Re-register with:
regsvr32 hhctrl.ocx /u
regsvr32 hhctrl.ocx -
Check the OEM runtime service. Several OEM samples assume the
Siemens HMI Embedded Helperservice is running. The Make EXE stage waits on an inter-process mutex that is only released by the helper. Start the service (or the OEM runtime simulator) before running Make EXE.
vb6.exe with Task Manager during a Make EXE freeze. The process holds a transactional lock on the *.exe target file. Killing the process can leave a zero-byte *.exe that the IDE then refuses to overwrite on the next attempt; delete the partial output manually before retrying.
6. Solution Path A: Repair the VB6.0 OEM Sample in Place
Use this path when the OEM DLL stack is correct and only IDE-level references are missing. It is the lowest-risk fix and preserves the original toolchain.
- Re-install OEMProgPack 7.6 over the existing install with "Repair" selected.
- Register the runtime COM objects from a CMD prompt with administrative rights:
cd /d "C:\Program Files\Siemens\HMI-Programming-Package\HMI-Environment\Bin" for %f in (*.dll) do regsvr32 /s "%f" for %f in (*.ocx) do regsvr32 /s "%f" - Re-link the missing references inside VB6.0 (Project → References → Browse...) to the freshly registered TLBs in the
Binfolder. - Disable the CHM help file reference in the Project → Properties → General tab as a temporary test; if the Make EXE completes, the CHM binding is the culprit.
- Rebuild the
*.exe. The Make EXE should pass 10%-20% within seconds.
7. Solution Path B: Rebuild the OEM DLL under MSVS 2003 / 2005
Recommended when the OEM runtime requires a modern C runtime. VB6.0 can only consume 32-bit DLLs; MSVS 2003 produces clean 32-bit binaries compatible with the VB6.0 caller, and MSVS 2005 introduces the manifest-bound side-by-side CRT that must be shipped with the OEM *.exe.
- Open the OEM DLL project (typically
*.dswfor MSVS 6.0/2003 or*.slnfor 2005) shipped in the OEMProgPack. - Build the DLL in Release configuration with the Win32 platform toolset. Confirm the output
*.dlland the accompanying*.libimport library. - Copy the freshly built
*.dllinto theOEMSamplesfolder next toXX.vbpso VB6.0 resolves the import at link time. - In VB6.0, File → Make XX.exe. The compile should now complete; VB6.0 will produce a
*.exethat dynamically loads the OEM DLL at startup. - Deploy the runtime triplet — the VB6.0
*.exe, the OEM*.dll, and the MSVC CRT (for MSVS 2005:msvcr80.dll+ the matchingMicrosoft.VC80.CRT.manifest) — into the SINUMERIK HMI environment or the operator-panel runtime directory.
PATH and must be loaded by a 32-bit-aware parent process. Do not place the OEM DLL in System32 on x64 hosts; use SysWOW64 or an application-private directory.
8. Solution Path C: Migrate the Front-End Off VB6.0
For long-term maintainability, the OEM front-end can be moved to a .NET language while keeping the OEM DLL as the integration boundary. This sidesteps the IDE-level VB6.0 problem entirely.
- Create a C# or VB.NET Windows Forms project targeted to .NET Framework 4.x with x86 platform. The 32-bit target is required to consume the OEM DLL.
-
P/Invokethe OEM DLL functions that were previously called with VB6.0Declarestatements:[DllImport("oem_dll.dll", CallingConvention = CallingConvention.Cdecl)] public static extern int HmiInit(IntPtr hWnd); [DllImport("oem_dll.dll", CallingConvention = CallingConvention.Cdecl)] public static extern int HmiRead(int channel, byte[] buffer, int len); [DllImport("oem_dll.dll", CallingConvention = CallingConvention.Cdecl)] public static extern int HmiWrite(int channel, byte[] buffer, int len); - Replace the VB6.0
*.frmfiles with equivalent Windows Forms designer output. The 840D HMI tag model is rebuilt usingHmiRead/HmiWritecalls wrapped in aSystem.Windows.Forms.Timerat the operator-panel refresh interval (typically 100 ms to 500 ms). - Build and test the new front-end in a non-SINUMERIK host first, against a stub OEM DLL that simulates the HMI PRO interface.
The OEM DLL stays compiled under MSVS 2003/2005; only the front-end is replaced. This separation matches Siemens' own reference architecture and protects the long-lived, certification-sensitive DLL from front-end churn.
9. Verification
After applying any of the three solutions, verify the build with the following checks:
| Check | Pass Criterion | Tool |
|---|---|---|
| Make EXE completes |
*.exe produced in < 60 s, no hang at 10%-20% |
VB6.0 IDE / MSBuild |
| Standalone launch |
XX.exe starts without Error 53: File not found
|
Run on the dev host with no VB6.0 IDE |
| OEM DLL resolution |
depends.exe shows all *.dll found, no error icons |
Dependency Walker |
| HMI PRO tag polling | Operator-panel values refresh at configured interval | OEM runtime simulator / live NCK |
| Service-mode install | Application registers with the Siemens HMI Embedded Helper service |
OEM runtime log |
10. Long-Term Recommendations
- Pin a development image. Build a VM or a dedicated workstation with a known-good configuration: Windows 7 SP1 x86, VB6.0 SP6, OEMProgPack 7.6, MSVS 2005 SP1, and the registered Siemens OCX set. Snapshot the image; restore on any build host that drifts.
- Avoid VB6.0 on Windows 10/11 hosts. The IDE's resource compile and the COM reference resolver are not part of Microsoft's VB6.0 It Just Works support policy, which targets running pre-compiled applications, not the development IDE. Use Windows 7 or Windows XP x86 hosts for VB6.0 development.
- Treat the OEM DLL as the stable boundary. The DLL is the contract with the HMI PRO runtime. Refactor front-ends freely (VB6.0, C#, WPF, even web-based HMI) without re-certifying the DLL.
- Keep the OEM runtime service running. Many Make EXE freezes are caused by a missing inter-process mutex. Confirm the service is up before starting the IDE.
-
Document the binary triplet. The deployed payload is three files minimum: the front-end
*.exe, the OEM*.dll, and the CRT (or its manifest) for MSVS 2005+ toolchains. A missing third file is the most common runtime failure after a successful build.
11. Troubleshooting Matrix
| Symptom | Likely Cause | First Action | Reference Path |
|---|---|---|---|
| Make EXE freezes at 10%-20%, no error | Missing COM/ActiveX reference | Check Project → References for MISSING:
|
Path A |
| Make EXE freezes, depends.exe reports missing DLL | OEM DLL not built or not on path | Rebuild OEM DLL under MSVS 2003/2005 | Path B |
| Make EXE completes, EXE crashes on launch | CRT missing (MSVS 2005 manifest) | Ship msvcr80.dll + manifest alongside EXE |
Path B step 5 |
| EXE launches, HMI tags read as 0 | OEM DLL loaded but service not running | Start Siemens HMI Embedded Helper service |
Diagnostic step 7 |
| EXE runs on Win XP, fails on Win 10 | VB6.0 runtime is JIT-bound to a specific OS | Run on supported OS or migrate front-end | Path C |
| OCX throws 0x80040154 on 64-bit host | OCX is 32-bit, process is 64-bit | Set process to x86; copy OCX to SysWOW64
|
Path C step 1 |
12. Frequently Asked Questions
Why does the VB6.0 Make EXE hang at 10%-20% specifically?
That range corresponds to the resource-compile stage in the VB6.0 linker, where OCX references, type-library imports, and CHM help bindings are walked. A missing or unregistered dependency enters a silent retry loop and produces the freeze. Check Project → References for MISSING: entries first.
Is VB6.0 officially supported by Microsoft on modern Windows?
Microsoft's VB6.0 support statement covers the runtime of already-compiled VB6.0 applications on supported Windows versions under an "It Just Works" goal. The IDE itself, including Make EXE, is not covered. For development, use a Windows 7 x86 or Windows XP x86 host.
Can the OEM sample be compiled with MSVS 2003 or MSVS 2005 instead of VB6.0?
The VB6.0 *.vbp cannot be opened directly in MSVS. The OEM sample's VB6.0 *.exe consumes a VC++-built OEM *.dll (compiled under MSVS 2003 or MSVS 2005). The fix is to keep the VB6.0 front-end and rebuild the OEM DLL under one of those MSVS versions so the import table resolves at link time.
Do I need to ship MSVCR80.DLL with my OEM application?
Yes, if the OEM DLL is built with MSVS 2005. The MSVS 2005 CRT is side-by-side and is not present on a clean Windows install. Copy msvcr80.dll and the matching Microsoft.VC80.CRT.manifest into the same directory as the OEM DLL and the VB6.0 EXE. MSVS 2003 builds do not require this step.
What OEMProgPack version is the VB6.0 sample known to work with?
OEMProgPack 7.6 is the version reported on the affected toolchain. The same hang pattern is independent of OEMProgPack version because the root cause is the VB6.0 IDE's resource compile stage, not the OEM sample itself. Path A (repair) or Path B (DLL rebuild) resolves the issue on every supported OEMProgPack release.