Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 905297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:11:37+00:00 2026-05-15T16:11:37+00:00

Where I’m stuck is the right parameter syntax to instantiate an object using PHP’s

  • 0

Where I’m stuck is the right parameter syntax to instantiate an object using PHP’s com() and dotnet() classes to load .net assemblies, windows system applications and components beyond the usual MS Office apps. If successfully created, working with the objects isn’t an issue here.

Can anyone explain what each part of each parameter means for both classes, and how I can find out the proper calling syntax for any application, component or assembly? What exactly can or can’t PHP load, and if it can, how? How do I go about finding out which system components and classes are visible and can be made available through com() and dotnet()? For calling assemblies, Im I incorrect in assuming anything listed in /windows/assembly/gacxx folders can be used here?

I’m trying to dig deeper into connecting to or using Windows system applications, components and assemblies. For example, using ‘System.Windows.Forms’ assembly. After reviewing PHP’s manual on the topic including code examples, it’s not getting any clearer for me. By PHP’s errors, I’m failing to get the syntax right, failing to find the specified files, or otherwise just failing completely without explanation. No related events are showing in Event Viewer to hint at application crashing or denied access.

I have .net 4 framework installed. These are my current PHP settings…

compiled: –enable-com-dotnet

[com_dotnet]

  • COM support => enabled
  • DCOM support => disabled
  • .Net support => enabled

Directive => Local Value => Master Value

  • com.allow_dcom => 0 => 0
  • com.autoregister_casesensitive => no value => no value
  • com.autoregister_typelib => 1 => 1
  • com.autoregister_verbose => 1 => 1
  • com.code_page => no value => no value
  • com.typelib_file => no value => no value

I’ve managed to get just three cases working so far. All other cases fail, including attempting to use other mscorlib classes…

<?php

$scripting = new COM("MSScriptControl.ScriptControl");
$scriping_host = new COM("WScript.Shell');
$stack = new DOTNET("mscorlib", "System.Collections.Stack");

?>

I see ‘System.Windows.Forms’ just sitting there in the /windows/assembly folder taunting me. $forms = new DOTNET('System.Windows.Forms', 'Form'); fails, even if the full assembly string is used. Am I looking in the wrong place? Should I instead approach this from within .net and create my own assembly to allow me to dynamically call others from PHP?

Note: Using the win32api PHP extension instead is right out as it’s a dead project, and I’m hoping to step away from being dependent on others’ pet project extensions.

Edit: COM issue mostly solved. Within the registry, I was able to find a list of com supported software and system components and create several com objects using their clsid’s. Still unsure exactly how to create DOTNET objects though.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:11:39+00:00Added an answer on May 15, 2026 at 4:11 pm

    Try this:

    $forms = new DOTNET('System.Windows.Forms', 'System.Windows.Forms.Form');
    

    I notice that the examples from the manual use fully-qualified class names.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 459k
  • Answers 459k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You need to edit your machine.config. This issue started for… May 15, 2026 at 11:34 pm
  • Editorial Team
    Editorial Team added an answer You are trying to get a result from the database… May 15, 2026 at 11:34 pm
  • Editorial Team
    Editorial Team added an answer <ul> <li>Apple<input type='hidden' name='fruits[]' value='Apple'/></li> <li>Pear<input type='hidden' name='fruits[]' value='Pear'/></li> <li>Banana<input… May 15, 2026 at 11:34 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.