473,407 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

COM component Error while creating ppt from asp.net in windows server 2003

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....
Apr 24 '08 #1
7 4431
kenobewan
4,871 Expert 4TB
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....
Apr 24 '08 #2
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
Apr 24 '08 #3
kenobewan
4,871 Expert 4TB
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
Apr 25 '08 #4
Frinavale
9,735 Expert Mod 8TB
...
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
Apr 25 '08 #5
gnagno
1
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 ;-)
Apr 30 '10 #6
I am meeting with similar problem. See my another thread.
http://bytes.com/topic/net/answers/9...nt#post3638144
Dec 27 '10 #7
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
Expand|Select|Wrap|Line Numbers
  1. using System.Runtime.InteropServices;
  2. using System.Security.Principal;
Code for impersonation
Expand|Select|Wrap|Line Numbers
  1. public static void ImpersonateUser(string username, string password)
  2.         {
  3.             ImpersonateUser(".", username, password);
  4.         }
  5.  
  6.         /// <summary>
  7.         /// This method is used to impersonate a user with domain name
  8.         /// </summary>
  9.         public static void ImpersonateUser(string domain, string username, string password)
  10.         {
  11.             StopImpersonating();
  12.  
  13.             IntPtr userToken;
  14.             var returnValue = ImpersonationImports.LogonUser(username, domain, password,
  15.                                                       ImpersonationImports.LOGON32_LOGON_INTERACTIVE,
  16.                                                       ImpersonationImports.LOGON32_PROVIDER_DEFAULT,
  17.                                                       out userToken);
  18.             context = WindowsIdentity.Impersonate(userToken);
  19.         }
  20.  
  21.         /// <summary>
  22.         /// This method is used to stop impersonating 
  23.         /// </summary>
  24.         public static void StopImpersonating()
  25.         {
  26.             if (context != null)
  27.             {
  28.                 context.Undo();
  29.                 context = null;
  30.             }
  31.         }
  32.         public static class ImpersonationImports
  33.         {
  34.             public const int LOGON32_LOGON_INTERACTIVE = 2;
  35.             public const int LOGON32_LOGON_NETWORK = 3;
  36.             public const int LOGON32_LOGON_BATCH = 4;
  37.             public const int LOGON32_LOGON_SERVICE = 5;
  38.             public const int LOGON32_LOGON_UNLOCK = 7;
  39.             public const int LOGON32_LOGON_NETWORK_CLEARTEXT = 8;
  40.             public const int LOGON32_LOGON_NEW_CREDENTIALS = 9;
  41.             public const int LOGON32_PROVIDER_DEFAULT = 0;
  42.  
  43.             [DllImport("advapi32.dll", SetLastError = true)]
  44.             public static extern int LogonUser(
  45.                 string lpszUsername,
  46.                 string lpszDomain,
  47.                 string lpszPassword,
  48.                 int dwLogonType,
  49.                 int dwLogonProvider,
  50.                 out IntPtr phToken
  51.                 );
  52.             [DllImport("advapi32.dll", SetLastError = true)]
  53.             public static extern int ImpersonateLoggedOnUser(
  54.                 IntPtr hToken
  55.             );
  56.  
  57.             [DllImport("advapi32.dll", SetLastError = true)]
  58.             public static extern int RevertToSelf();
  59.  
  60.             [DllImport("kernel32.dll", SetLastError = true)]
  61.             public static extern int CloseHandle(IntPtr hObject);
  62.  
  63.  
  64.         }
  65.  
  66. In your button click event
  67.  protected void btnPPT_Click(object sender, EventArgs e)
  68.         {
  69.              ImpersonateUser("<username of windows server 2003>", "<password of windows server 2003>");
  70. //export code goes here
  71. StopImpersonating();
  72. }
Oct 28 '11 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

5
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...
8
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...
0
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...
7
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ó...
2
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...
1
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,...
0
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...
1
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...
1
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...
0
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
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
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,...
0
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...
0
Oralloy
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,...
0
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...
0
tracyyun
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...
0
isladogs
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.