Question

I'm trying to execute GetTickCount from KERNEL32.DLL through PHP COM extension and had no success. What ProgID or Class ID should I use to execute GetTickCount?

$com = new COM("?WhatProgID.ID?");
$time = $com->GetTickCount();

in C++ it looks like this:

#include <windows.h>
#include <iostream>

int main(void)
{
    std::cout << GetTickCount() << std::endl;
}
Was it helpful?

Solution

Use DynamicWrapper:

  1. Download dynwrap.dll http://techsupt.winbatch.com/techsupt/dynawrapNt.zip (or other version from here DynaWrap - DynaCall Wrapper):
  2. Unpack and register: regsvr32 dynwrap.dll /c (you can also recompile it if you like)

Now this code below should work (it works for me):

$com = new COM("DynamicWrapper");
$com->Register("KERNEL32.DLL", "GetTickCount", "i=l", "f=s", "r=l");
echo $com->GetTickCount(0);

Description of the input parameters is in Readme.txt.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top