Results 1 to 5 of 5
  1. #1
    wajahat
    Guest

    Post Uncaught exception 'com_exception' with message 'Failed to create COM object'

    I am looking forward to use API for automatically demo account creation through my webpage.
    http://www.heliosco.com/site/start_trading
    Currently, customers have to submit 2 times, once in the software and secondly on the web.

    I have used the following code and got following fatal error and exception:

    Fatal error: Uncaught exception 'com_exception' with message 'Failed to create COM object `VertexFXOpenDemo.CVertexFXOpenDemo' in OpenDemoCode.php on line 23

    com_exception: Failed to create COM object `VertexFXOpenDemo.CVertexFXOpenDemo': Invalid syntax in OpenDemoCode.php on line 23

    Code:
    <?php
    set_time_limit(0);
    
    $Name=$_POST['name'];
    $Country=$_POST['country'];
    $Deposit=(double)$_POST['deposit'];
    $Address=$_POST['address'];
    $Email=$_POST['email'];
    $Phone=$_POST['phone'];
    
    $ServerIP="localhost";//Please provide your VertexFX ServerIP here,,,
    $ServerPort=4401;//Please provide your VertexFX Server port here,,,
    
    $Password=$_POST['password'];
    
    $obj=new COM("VertexFXOpenDemo.CVertexFXOpenDemo") or die("Unable to include the dll");
    $obj->OpenDemo($ServerIP, $ServerPort, $Address, $Email, $Name, $Phone, $Country, $Deposit, $Password);
    
    if ($obj == null)
        echo "obj Not Created";
    
    while(!$obj->ResultReceived)
        {    
            com_message_pump(10);
        }
    
    switch($obj->DemoResult)
    {
        case 1:
            echo "Username = $obj->Uname\n";
            break;
        CASE 3:
            echo "The account is not generated; same IP";
            break;
        default:
            echo "The account is not generated";    
    }    
    ?>
    Any Help will be appreciated!
    Last edited by Yousef-HS; 11-21-2011 at 08:23 AM.

  2. #2

    Default

    Hello,

    In your posted code, and from the first look there is a piece of code which is:

    Code:
    $ServerIP="localhost";//Please provide your VertexFX ServerIP here,,,
    Please change the localhost to your server IP. Save the PHP file and re-upload it and allow overwrite. The localhost means your webserver which in this case wrong because the server of where users are registering for demo client is different that your web server. Update us of any further notes after changing the value stated above.

    Make sure you have downloaded the PHP API sample from here

    Code:
     http://www.hybrid-solutions.com/forum/showthread.php?3113-VertexFX-Client-API-Samples

  3. #3
    wajahat
    Guest

    Arrow Class 'COM' not found

    Firstly, I have tried same code with my own server ip and port rather than localhost.

    Secondly, I was compiling on local wamp server, now i am compiling online and getting the error;

    "Fatal error: Class 'COM' not found in /data/16/2/104/61/2593713/user/2844419/htdocs/api/OpenDemoCode.php on line 23"

    so, error occur on line 23 i.e. COM object in not being created.
    Is there any COM class which i have to include first or some PHP/Apache Module, which is not being loaded?

  4. #4

    Default

    Hello Wajahat,

    We could replicate the case at our servers, i have informed the concerned developer about this case, he will give us an update as soon as possible.

    Thank you.

  5. #5

    Thumbs up

    Dear Wajaht,

    Please note that we support Windows enviroemtns only, if you have a windows server please do the following:

    1. Download and install Xampp by visiting the following link: http://www.apachefriends.org/en/xampp.html
    2. Download the the following sample http://www.hybrid-solutions.com/Open...tPhpSample.zip
    3. After extracting the zip file, take what's inside the folder named VertexFXOpenDemo dll to system32 and register the dll files.
    4. Insert the php files to a directory and run it then try to register for a demo account.

    If your website is on a linux web server, you may use an Iframe and insert the iframe in your webpage of which users can use to create a demo account.

    Let us know how it goes

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •