Skip to content
PYD ENTERPRISES

VB6, COM, WebForms & WCF

Specify VB6 and classic .NET before you migrate them.

PYD ENTERPRISES maps COM and ActiveX dependencies, follows On Error Resume Next as real control flow, traces ViewState across postbacks and turns WCF contracts into OpenAPI 3.1.

OrderDesk.vbp · REFERENCESVB6 SP6 · 182 modules
  • ADODB

    Microsoft ActiveX Data Objects 2.8 Library

    Plumbing: data access

    214 call sites

  • MSXML2

    Microsoft XML, v6.0

    Plumbing: document parsing

    38 call sites

  • PricingEngine.Calculator

    In-house ActiveX DLL, source in scan

    Resolved · 12 rules

    61 call sites

  • CRAXDRT.Application

    Crystal Reports runtime automation

    Plumbing: reporting

    9 call sites

  • RateCalc.ocx

    ActiveX control, type library only, no source

    Unresolved · 6 call sites flagged

    6 call sites

Error path tracer

On Error Resume Next is a business rule you never wrote down.

Pick a scenario and compare legacy semantics with strict error handling. The difference between the two return values is behavior your C# rewrite will change unless someone decides it should.

1Public Function CalcDiscount(ByVal custId As Long, ByVal orderTotal As Currency) As Currency
2 On Error Resume Next
3 Dim rs As ADODB.Recordset
4 Dim tier As String
5 Dim pct As Currency
6 Set rs = gConn.Execute("SELECT TIER FROM CUSTOMER WHERE CUST_ID = " & custId)
7 tier = rs!TIERerr 3021 · resumed
8 Select Case tier
9 Case "GOLD": pct = 0.1
10 Case "SILVER": pct = 0.05
11 Case Else: pct = 0
12 End Select
13 If orderTotal > 5000 Then pct = pct + 0.02
14 CalcDiscount = orderTotal * pct
15 LogAudit "DISC", custId, CalcDiscount
16End Function

INPUT

custId=99999, orderTotal=6000.00, no CUSTOMER row

RETURNS

120.00

  • line 7 · Err.Number 3021Either BOF or EOF is True, or the current record has been deleted

Flagged for review

Unknown customers silently receive the 2% volume discount. tier stays "" after the failed read and falls to Case Else.

OrderEntry.aspx.csC#
1public partial class OrderEntry : System.Web.UI.Page
2{
3 protected void Page_Load(object sender, EventArgs e)
4 {
5 if (!IsPostBack)
6 {
7 ViewState["CreditLimit"] = CustomerDal.GetCreditLimit(Request.QueryString["cust"]);
8 BindTerms();
9 }
10 }
11
12 protected void btnSubmit_Click(object sender, EventArgs e)
13 {
14 decimal limit = (decimal)ViewState["CreditLimit"];
15 decimal total = decimal.Parse(txtTotal.Text);
16 if (total > limit && ddlTerms.SelectedValue != "PREPAID")
17 {
18 lblError.Text = "Order exceeds credit limit";
19 return;
20 }
21 OrderDal.Submit(hfCustId.Value, total, ddlTerms.SelectedValue);
22 }
23}

ASP.NET WEBFORMS

Code-behind rules, with the ViewState they depend on.

PYD ENTERPRISES parses the .aspx markup with its code-behind, links btnSubmit_Click to the button that raises it, and extracts the credit rule: reject when total exceeds the limit unless terms are PREPAID. Every ViewState key is tracked from write to read across postbacks.

  • ViewState["CreditLimit"]

    write: Page_Load (first request only) · read: btnSubmit_Click

    Stale for the life of the page: a limit change mid-session is not seen.

  • ViewState["SelectedRegion"]

    write: ddlRegion_SelectedIndexChanged · read: BindTerms, btnSubmit_Click

    Drives which payment terms are offered; becomes an input of the terms decision.

  • ViewState["DiscountApplied"]

    write: btnApplyPromo_Click · read: btnSubmit_Click

    Prevents double discount across postbacks; becomes an idempotency rule.

WCF to OpenAPI 3.1

Service contracts in, REST contracts out.

Data contracts keep their required flags, ordering and types. Operations get HTTP methods from what their call graph actually does, not from their names.

IBillingService.cs (WCF)C#
1[DataContract(Namespace = "urn:billing:2011")]
2public class InvoiceDto
3{
4 [DataMember(IsRequired = true, Order = 0)] public string InvoiceNo { get; set; }
5 [DataMember(Order = 1)] public decimal AmountDue { get; set; }
6 [DataMember(Order = 2)] public DateTime DueDate { get; set; }
7 [DataMember(Order = 3, EmitDefaultValue = false)] public string PromoCode { get; set; }
8}
9
10[ServiceContract(Namespace = "urn:billing:2011")]
11public interface IBillingService
12{
13 [OperationContract]
14 [FaultContract(typeof(InvoiceNotFoundFault))]
15 InvoiceDto GetInvoice(string invoiceNo);
16}
openapi/billing.yaml (generated)YAML
1paths:
2 /invoices/{invoiceNo}:
3 get:
4 operationId: getInvoice
5 x-pyd-source: IBillingService.cs:13-16
6 parameters:
7 - { name: invoiceNo, in: path, required: true, schema: { type: string } }
8 responses:
9 "200":
10 content:
11 application/json:
12 schema: { $ref: "#/components/schemas/Invoice" }
13 "404": { description: InvoiceNotFoundFault }
14components:
15 schemas:
16 Invoice:
17 type: object
18 required: [invoiceNo]
19 properties:
20 invoiceNo: { type: string }
21 amountDue: { type: string, pattern: "^-?[0-9]+([.][0-9]+)?$" }
22 dueDate: { type: string, format: date-time }
23 promoCode: { type: string }
WCF constructOpenAPI 3.1 / JSON Schema result
OperationContract with no writes in its call graphGET, parameters from the request message
OperationContract that inserts or updatesPOST or PUT, chosen by idempotency analysis
FaultContract types4xx and 5xx responses with problem details schema
DataMember IsRequired = truerequired in JSON Schema
EmitDefaultValue = falseoptional property, omitted when default
decimal, DateTime, enum DataContractsdecimal string pattern, date-time, string enum

FAQ

.NET and VB6 questions.

Can PYD ENTERPRISES read VB6 projects without the VB6 IDE installed?

Yes. It parses .vbp, .bas, .cls, .frm and .ctl files directly. Form files are read for control names and event bindings, so event handlers are linked to the controls that raise them.

How does it handle On Error Resume Next?

As control flow. After every statement that can raise inside a Resume Next scope, the CFG has an edge to the next statement with the error state set. Rules that can be reached with a silently swallowed error are flagged, with the error codes that lead there.

What about COM components we only have as compiled DLLs or OCX files?

PYD ENTERPRISES reads their type libraries for interfaces, methods and parameter types, so calls resolve to signatures. Behavior inside them cannot be analyzed without source, so rules that depend on their results are flagged for review.

Does it support VB.NET and C# as well?

Yes. WebForms code-behind, ASMX and WCF services in C# or VB.NET, and the .config files that bind them, are parsed into the same symbol graph as the VB6 layer they often call through COM interop.

Does WCF output have to be REST?

No. PYD ENTERPRISES proposes a RESTful OpenAPI 3.1 mapping because that is what most target architectures want, and it records the original SOAP action for each operation. You can also export contracts as JSON Schema only.

Know what the VB6 layer does before you retire it.

Run PYD ENTERPRISES on 100,000 lines of COBOL or Java in your private VPC and review OpenAPI specs and DMN tables tomorrow.