Hi,
I am trying to connect to a COM component using PHP, but keep on recieving an "Unexpected error has occured" message.
The COM component code is -
Option Explicit
-
-
Public Enum ApplicationErr
-
Unexpected = Error.Unexpected
-
End Enum
-
-
Private Const m_csClassName As String = "XYZ.Application"
-
-
Public Sub Initialize(ByVal udl As String, ByVal log)
-
On Error GoTo ErrInitialize
-
Dim enumErrorCode As xyzError
-
enumErrorCode = Success
-
-
Dim oObjectContext As ObjectContext
-
Set oObjectContext = GetObjectContext()
-
-
oObjectContext("Session")("ConString") = "FILE NAME=" & App.Path & "\" & udl
-
oObjectContext("Session")("ErrLog") = App.Path & "\" & log
-
-
ExitInitialize:
-
On Error Resume Next
-
Set oObjectContext = Nothing
-
If enumErrorCode <> Success Then
-
On Error GoTo 0
-
Call Err.Raise(enumErrorCode, m_csClassName, GetErrorDescription(enumErrorCode))
-
End If
-
Exit Sub
-
ErrInitialize:
-
If Err.Source = m_csClassName Then
-
enumErrorCode = Err.Number
-
Else
-
enumErrorCode = Unexpected
-
End If
-
If Not (Err.Source = "XYZ.Application" And Err.Number = XYZ.ApplicationErr.Unexpected) Then Call LogError(m_csClassName & ".Initialize")
-
Resume ExitInitialize
-
End Sub
-
The PHP code used is : -
<?php
-
-
try {
-
$udl = new VARIANT("XYZ.udl",VT_BSTR);
-
$errorlog = new VARIANT("ErrorLog.txt",VT_BSTR);
-
-
$Q = new COM("XYZ.Application") or die("Cannot start XYZ");
-
$lUserId = $Q->Initialize($udl,$errorlog);
-
-
echo $lUserId;
-
}
-
catch (com_exception $e)
-
{
-
$lUserId = array('errorCode' => $e->getCode(),
-
'errorMessage' => $e->getMessage(),
-
'errorFile' => $e->getFile(),
-
'errorLine' => $e->getLine());
-
}
-
-
echo "<pre>";
-
print_r($lUserId);
-
echo "</pre>";
-
?>
-
-
It always generates an exception. Can someone please help me resolve this issue.
Also could it be a Type mismatch error?
thanks.
4 1741 Markus 6,050
Recognized Expert Expert
Does the error come as a PHP error or a VB error?
the error comes as a VB error.
Following is the exception generated : -
Array
-
(
-
[errorCode] => -2147352567
-
[errorMessage] => Source: FQAI.Application
-
Description: Unexpected error has occured
-
[errorFile] => D:\WWW\AIWM\website\aiwmtest\index1.php
-
[errorLine] => 7
-
)
-
Markus 6,050
Recognized Expert Expert
Then it would make more sense to ask the question in our VB.NET forum.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: PW |
last post by:
Hi,
I'm using WinXP-Pro, ASP classic, IIS 5.0.
I regularly get this error, but I know I am the only user accessing the
website at the time of the error.
I looked it up on the MS support webiste. Their recommendation is this ...
------------------
|
by: AdamM |
last post by:
Hi all,
When I run my VbScript, I get the error: "ActiveX component can't create
object: 'getobject'. Error 800A01AD". Any ideas what I did wrong?
Here's my VBScript:
dim o
set o=getobject(,"ConsoleApplication2.Program")
msgbox o.TestString
|
by: Joergen Bech |
last post by:
Fairly new to ASP.NET 1.1. Getting the error below when running
application on a web server outside of my control, but only the first
time I run it:
1. After a long period of inactivity (or updating the code-behind dll)
accessing any aspx page in the application causes the application
to run for the first time. Some of the initialization involves
reading and writing some text and xml files using simple streamreader
and streamwriter...
|
by: Terry Holland |
last post by:
I posted a follow up to an earlier post but did not receive response so here
it is again (with original post and response)
> This could be because you are running the index service over this web
> application. try to stop indexing this application (from IIS management
> console, clear "Index this resource") or stop the index service to test if
> you still get error or not.
I removed this option but still get the error. The error...
|
by: Kaush |
last post by:
Hi all,
I am creating a webservice to accept SOAP messages, parse the
message and send a SOAP response back to the client accessing my web service
using WSE-2 in ASP.NET.
I am creating a class which derives from "SoapReceiver" class and
do the processing here. To register this class by using the HTTP protocol, I
am editing the "web.config" file. I am adding an "add" element to this config
file as follows:
<httpHandlers>
| |
by: snicks |
last post by:
I'm trying to exec a program external to my ASP.NET app using the following
code. The external app is a VB.NET application.
Dim sPPTOut As String
sPPTOut = MDEPDirStr + sID + ".ppt"
Dim p As New System.Diagnostics.Process
'p.Start(MDEPDirStr & "macrun.exe", sPPTOut)
p.Start("C:\WINDOWS\SYSTEM32\CALC.EXE")
'p.Start("C:\WINDOWS\SYSTEM32\macrun.exe", sPPTOut)
|
by: Praveen_db2 |
last post by:
Hi All
db2 8.1.3 Windows
I am getting this error in db2diag.log.Please tell why is this error
(-444) always there and how to go about for removing it.
Diag.log output:
----------------------------------------------
2006-01-28-19.48.05.816000 Instance:DB2 Node:000
PID:1628(db2syscs.exe) TID:1524 Appid:none
base sys utilities startdbm Probe:911
|
by: fniles |
last post by:
In our ASP page, we call XMLHttp to download XML files. When calling our
page using localhost (localhost/myWebSite/myPage.htm), it works, but when
calling using the IP address of the web server
(xx.x.x.xxx/myWebSite/myPage.htm), I got "Permission denied" error in the
HTTP.Open statement.
Set http = CreateObject("Microsoft.XmlHttp")
http.open "Get", "http://" & "xx.x.x.xxx" & "/XMLFiles/N-1min.xml",
ALSE --> permission denied error
|
by: MikeJ |
last post by:
In my office, we have workstations with standard Win 2000 images (OS plus
standard apps like Office, etc.) as developers, we then install our
development tools on top of those images. other developers in my office
have installed VS8 and use it with no problems. however, on a new
workstation that I recently got, I have installed VS8, and get this error
whenever I try to access a C# project or create a new C# project:
"Project 'XYZ'...
|
by: David Schrader |
last post by:
Hello all,
Let me start by saying that I'm not certain whether this belongs
here, in this notes group, or another more developmentally
oriented one. I'll try starting here then go elsewhere if you
decide otherwise. (Already forwarded here, sort-of, from:
microsoft.public.windowsnt.registry.)
I'm writing a Visual Basic program which stores and retrieves
data in the registry - no big thing, I've got all that code written
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |