Hi,
Iam struggling with a COM component Error---"Error HRESULT E_FAIL has been returned from a call to a COM component. " while generating ppt from asp.net application. Its isworking fine in XP machine and showing error when deployed in windows server 2003.And use the com component "Microsoft PowerPoint Object 11"
I have run DCOMCNFG and give NETWORKSERVICE account. I think access permissions are all given correctly.But still showing error in server. Can any plz help me.Iam struggling with this for last fews days.
Thanks in advance....
7 4431
Seems the component may not be installed on the other machine?
Hi,
Iam struggling with a COM component Error---"Error HRESULT E_FAIL has been returned from a call to a COM component. " while generating ppt from asp.net application. Its isworking fine in XP machine and showing error when deployed in windows server 2003.And use the com component "Microsoft PowerPoint Object 11"
I have run DCOMCNFG and give NETWORKSERVICE account. I think access permissions are all given correctly.But still showing error in server. Can any plz help me.Iam struggling with this for last fews days.
Thanks in advance....
Seems the component may not be installed on the other machine?
Thanks for the quick reply. Anyway Components are already there.I haved succesfully able to create an excel document using COM component in the same way.But failed in Powerpoint.From the error Stack Trace it is found error is on the Open() function.
The Error detail is as shown below.
Exception Details: System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
What shall I do?
Thanks
Suggest showing the relevant code and highlight line that causes error.
Thanks for the quick reply. Anyway Components are already there.I haved succesfully able to create an excel document using COM component in the same way.But failed in Powerpoint.From the error Stack Trace it is found error is on the Open() function.
The Error detail is as shown below.
Exception Details: System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
What shall I do?
Thanks
...
Exception Details: System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
This type of error usually occurs when a COM component is not properly installed or the necessary resources it requires to use are missing. Make sure that the COM component is properly installed and that all of the resources it requires are also installed.
-Frinny
1. Launch DCOM Config (Administration Tools / Component Services) 2. Choose Microsoft Office Powerpoint Slide Properties ({64818D10-4F9B-11CF-86EA-00AA00B929E8}). 3. Right Click and choose Properties. 4. Select Identity Tab. 5. Set to "The Interactive user" option.
Hope it helps ;-)
Hi,
My suggestion would be to use impersonation.
This would naturally help you exporting to ppt in windows server 2003
Here's is impersonation code use namespaces - using System.Runtime.InteropServices;
-
using System.Security.Principal;
Code for impersonation - public static void ImpersonateUser(string username, string password)
-
{
-
ImpersonateUser(".", username, password);
-
}
-
-
/// <summary>
-
/// This method is used to impersonate a user with domain name
-
/// </summary>
-
public static void ImpersonateUser(string domain, string username, string password)
-
{
-
StopImpersonating();
-
-
IntPtr userToken;
-
var returnValue = ImpersonationImports.LogonUser(username, domain, password,
-
ImpersonationImports.LOGON32_LOGON_INTERACTIVE,
-
ImpersonationImports.LOGON32_PROVIDER_DEFAULT,
-
out userToken);
-
context = WindowsIdentity.Impersonate(userToken);
-
}
-
-
/// <summary>
-
/// This method is used to stop impersonating
-
/// </summary>
-
public static void StopImpersonating()
-
{
-
if (context != null)
-
{
-
context.Undo();
-
context = null;
-
}
-
}
-
public static class ImpersonationImports
-
{
-
public const int LOGON32_LOGON_INTERACTIVE = 2;
-
public const int LOGON32_LOGON_NETWORK = 3;
-
public const int LOGON32_LOGON_BATCH = 4;
-
public const int LOGON32_LOGON_SERVICE = 5;
-
public const int LOGON32_LOGON_UNLOCK = 7;
-
public const int LOGON32_LOGON_NETWORK_CLEARTEXT = 8;
-
public const int LOGON32_LOGON_NEW_CREDENTIALS = 9;
-
public const int LOGON32_PROVIDER_DEFAULT = 0;
-
-
[DllImport("advapi32.dll", SetLastError = true)]
-
public static extern int LogonUser(
-
string lpszUsername,
-
string lpszDomain,
-
string lpszPassword,
-
int dwLogonType,
-
int dwLogonProvider,
-
out IntPtr phToken
-
);
-
[DllImport("advapi32.dll", SetLastError = true)]
-
public static extern int ImpersonateLoggedOnUser(
-
IntPtr hToken
-
);
-
-
[DllImport("advapi32.dll", SetLastError = true)]
-
public static extern int RevertToSelf();
-
-
[DllImport("kernel32.dll", SetLastError = true)]
-
public static extern int CloseHandle(IntPtr hObject);
-
-
-
}
-
- In your button click event
-
protected void btnPPT_Click(object sender, EventArgs e)
-
{
-
ImpersonateUser("<username of windows server 2003>", "<password of windows server 2003>");
-
//export code goes here
-
StopImpersonating();
-
}
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Tony Wright |
last post by:
Hi,
I am having a problem installing an msi for a web site. The error
message I am getting is:
"The specified path 'http://mipdev05/features/Fas2' is unavailable.
The Internet Information...
|
by: Carel Lotz |
last post by:
H
We have ported our VB 6 application into VB .NET but are still integrating with a few COM + applications written in VB6 running on our application server (Win 2000 Server). We have the proxies...
|
by: Peter D. Dunlap |
last post by:
I have a number of web sites on my 2003 server, each of the
independent sites (i.e., not subdirectories of the localhost site).
The way I have always set these up in the past is:
1. Create a...
|
by: Dr. Zharkov |
last post by:
We have program Visual Basic .NET 2003 for construction of 3D-Graphics as a
surface z=f (x, y). From VB .NET 2003 we want to transfer coordinates of
this surface as myArrayVB (2000, 1) in myArrayVó...
|
by: Sakke |
last post by:
Hello!
We have written a GCryptoSvr.dll COM server in C++. Inside that resides
WebClient COM component. WebClient CLSID is
{8DC27D48-F94C-434B-A509-C3E1A3E75B9E}. When we are using that...
|
by: Mike |
last post by:
I have an ASP.NET 2.0 web service that runs on IIS and calls a VB6 dll which
has been registered with COM+.
The web service runs fine on all the servers that it has been installed on.
However,...
|
by: syedsarfaraz |
last post by:
Hi There!
Could anybody please help regarding the below issue.
We had a COM+ component deployed on Windows 2000/NT machine it was working fine, I mean when it was being invoked from other...
|
by: =?Utf-8?B?VmVua2F0ZXNhbiBT?= |
last post by:
Hi,
I have a requirement of consuming a connection object returned from a COM
component deployed in COM+ application. I have given the need for this
requirement end of my query.
My component...
|
by: wanaruk |
last post by:
Hi all.
I am working on a legacy application written in Classic ASP with VB6
COM+ components running on Windows 2003 Adv Server (32bit). There is
one page in the app that uses Secure FTP to send...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
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...
|
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,...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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...
| |