Welcome to HostingForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Clipboard Access + IIS6.0 + Win2003

 
   Web Hosting Problem Solving Community! (Home) -> IIS RSS
Next:  WCAT & Using NTLM authentication  
Author Message
prasanna1

External


Since: Aug 06, 2004
Posts: 2



(Msg. 1) Posted: Fri Aug 06, 2004 8:59 pm
Post subject: Clipboard Access + IIS6.0 + Win2003
Archived from groups: microsoft>public>inetserver>iis (more info?)

Hi
I cannot access clipboard for setting or getting data in my Web Application.
Does it have anything to do with security.
Where should i make changes, Local Security Policy, what rights are
required for accesing Clipboard

Thanks
Prasanna

 >> Stay informed about: Clipboard Access + IIS6.0 + Win2003 
Back to top
Login to vote
user641

External


Since: Aug 22, 2003
Posts: 1637



(Msg. 2) Posted: Fri Aug 06, 2004 8:59 pm
Post subject: Re: Clipboard Access + IIS6.0 + Win2003 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Prasanna Dsouza" <prasanna.RemoveThis@irislogic.com> wrote in message
news:egtbZD7eEHA.712@TK2MSFTNGP09.phx.gbl...
 > Hi
 > I cannot access clipboard for setting or getting data in my Web
Application.
 > Does it have anything to do with security.
 > Where should i make changes, Local Security Policy, what rights are
 > required for accesing Clipboard

Exactly how are you trying to access the Clipboard from your web app?

--
Tom Kaminski IIS MVP
<a style='text-decoration: underline;' href="http://www.microsoft.com/windowsserver2003/community/centers/iis/" target="_blank">http://www.microsoft.com/windowsserver2003/community/centers/iis/</a>
<a style='text-decoration: underline;' href="http://mvp.support.microsoft.com/" target="_blank">http://mvp.support.microsoft.com/</a>
<a style='text-decoration: underline;' href="http://www.iisfaq.com/" target="_blank">http://www.iisfaq.com/</a>
<a style='text-decoration: underline;' href="http://www.iistoolshed.com/" target="_blank">http://www.iistoolshed.com/</a> - tools, scripts, and utilities for running IIS
<a style='text-decoration: underline;' href="http://www.tryiis.com" target="_blank">http://www.tryiis.com</a><!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Clipboard Access + IIS6.0 + Win2003 
Back to top
Login to vote
prasanna1

External


Since: Aug 06, 2004
Posts: 2



(Msg. 3) Posted: Mon Aug 09, 2004 7:22 pm
Post subject: Re: Clipboard Access + IIS6.0 + Win2003 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Tom

I am using the following Statement
System.Windows.Forms.IDataObject temp =
System.Windows.Forms.Clipboard.GetDataObject();

I get the Exception The Clipboard operation failed
The function that contains the statement runs under a STA thread.

My web service code does the following
based on a document id, RTF content is fetched from the database.
A word document is created.
The RTF content is set to the Clipboard using the IDataObject retrieved
using the statement System.Windows.Forms.Clipboard.GetDataObject();

then using this statement
p_oTempWordDoc.Range(ref l_oMissing,ref l_oMissing).Paste the rtf content is
pasted to the word document. this document is saved and then sent to the
client (that is the URL to the document)

This is the statement that fails
System.Windows.Forms.Clipboard.GetDataObject();
It same code works correctly on Win2k server with IIS5.0 Wonder what could
be the reason for not working in WIN2K3 and IIS6

Thanks

"Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
news:cevvqv$4cc21@kcweb01.netnews.att.com...
 > "Prasanna Dsouza" <prasanna RemoveThis @irislogic.com> wrote in message
 > news:egtbZD7eEHA.712@TK2MSFTNGP09.phx.gbl...
  > > Hi
  > > I cannot access clipboard for setting or getting data in my Web
 > Application.
  > > Does it have anything to do with security.
  > > Where should i make changes, Local Security Policy, what rights are
  > > required for accesing Clipboard
 >
 > Exactly how are you trying to access the Clipboard from your web app?
 >
 > --
 > Tom Kaminski IIS MVP
<font color=purple> > <a style='text-decoration: underline;' href="http://www.microsoft.com/windowsserver2003/community/centers/iis/</font" target="_blank">http://www.microsoft.com/windowsserver2003/community/centers/iis/</font</a>>
<font color=purple> > <a style='text-decoration: underline;' href="http://mvp.support.microsoft.com/</font" target="_blank">http://mvp.support.microsoft.com/</font</a>>
<font color=purple> > <a style='text-decoration: underline;' href="http://www.iisfaq.com/</font" target="_blank">http://www.iisfaq.com/</font</a>>
 > <a style='text-decoration: underline;' href="http://www.iistoolshed.com/" target="_blank">http://www.iistoolshed.com/</a> - tools, scripts, and utilities for running
IIS
<font color=purple> > <a style='text-decoration: underline;' href="http://www.tryiis.com</font" target="_blank">http://www.tryiis.com</font</a>>
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Clipboard Access + IIS6.0 + Win2003 
Back to top
Login to vote
user641

External


Since: Aug 22, 2003
Posts: 1637



(Msg. 4) Posted: Tue Aug 10, 2004 12:27 pm
Post subject: Re: Clipboard Access + IIS6.0 + Win2003 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Prasanna Dsouza" <prasanna DeleteThis @irislogic.com> wrote in message
news:%23iAV$6ffEHA.708@TK2MSFTNGP09.phx.gbl...
 > Hi Tom
 >
 > I am using the following Statement
 > System.Windows.Forms.IDataObject temp =
 > System.Windows.Forms.Clipboard.GetDataObject();
 >
 > I get the Exception The Clipboard operation failed
 > The function that contains the statement runs under a STA thread.
 >
 > My web service code does the following
 > based on a document id, RTF content is fetched from the database.
 > A word document is created.
 > The RTF content is set to the Clipboard using the IDataObject retrieved
 > using the statement System.Windows.Forms.Clipboard.GetDataObject();
 >
 > then using this statement
 > p_oTempWordDoc.Range(ref l_oMissing,ref l_oMissing).Paste the rtf content
is
 > pasted to the word document. this document is saved and then sent to the
 > client (that is the URL to the document)
 >
 > This is the statement that fails
 > System.Windows.Forms.Clipboard.GetDataObject();
 > It same code works correctly on Win2k server with IIS5.0 Wonder what could
 > be the reason for not working in WIN2K3 and IIS6

I'm not familiar with using the Clipboard object and frankly (even though it
worked on IIS5) it doesn't seem like something suited to a web
app/server-side code.

--
Tom Kaminski IIS MVP
<a style='text-decoration: underline;' href="http://www.microsoft.com/windowsserver2003/community/centers/iis/" target="_blank">http://www.microsoft.com/windowsserver2003/community/centers/iis/</a>
<a style='text-decoration: underline;' href="http://mvp.support.microsoft.com/" target="_blank">http://mvp.support.microsoft.com/</a>
<a style='text-decoration: underline;' href="http://www.iisfaq.com/" target="_blank">http://www.iisfaq.com/</a>
<a style='text-decoration: underline;' href="http://www.iistoolshed.com/" target="_blank">http://www.iistoolshed.com/</a> - tools, scripts, and utilities for running IIS
<a style='text-decoration: underline;' href="http://www.tryiis.com" target="_blank">http://www.tryiis.com</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Clipboard Access + IIS6.0 + Win2003 
Back to top
Login to vote
sbense

External


Since: Aug 11, 2004
Posts: 1



(Msg. 5) Posted: Wed Aug 11, 2004 7:22 am
Post subject: Re: Clipboard Access + IIS6.0 + Win2003 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Prasanna

I had the same problem and have a solution, which does not use the
clipboard. Simply write your RTF text to a text file saved with a .rtf
extension. Then use the Selection.InsertFile method of the word
automation object. All your RTF formatting is retained as Word will
take care of the rtf decoding - presumably the reason for wanting to
use the clipboard in the first place.

Code extract:
//Sample rtf
string oSubText="{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose
02020603050405020304}Times New
Roman;}{\f35\fswiss\fcharset0\fprq2{\*\panose
020b0604030504040204}Verdana;}";

string sRTFFile=@"c:\test\insrtf.rtf"
SaveToTextFile(sRTFFile,oSubText,false);
//using word automation

Range range = oRange;
//Find tag to replace
range.Find.Execute(ref oFindText,
ref m_oMissing, ref m_oMissing, ref m_oMissing, ref m_oMissing, ref
m_oMissing,
ref m_oMissing, ref m_oWrap, ref m_oMissing, ref m_oMissing, ref
m_oMissing,
ref m_oMissing, ref m_oMissing, ref m_oMissing, ref m_oMissing);

m_oWord.Selection.Start = range.Start;
m_oWord.Selection.End = range.End;

//Insert RTF from file
m_oWord.Selection.InsertFile(sRTFFile,ref m_oMissing, ref
m_oMissing,ref oMissing, ref m_oMissing);

//Simple string to file function
public void SaveToTextFile(string sFile, string sOut,bool bAppend)
{
FileStream s;
StreamWriter w;
int i;
if(bAppend)
s = new FileStream(sFile,FileMode.Append);
else
s = new FileStream(sFile,FileMode.Create);
   
w = new StreamWriter(s);
w.Write(sOut);
w.Close();
}

Hope this helps you. Annoyingly this problem only ocurred on certain
machines and frankly I don't have the time to figure it out. The old
addage applies: "If it hurts stop doing it", so forget the clipboard
for now. It hurts too much!

Mulgara

"Prasanna Dsouza" <prasanna.DeleteThis@irislogic.com> wrote in message news:<#iAV$6ffEHA.708@TK2MSFTNGP09.phx.gbl>...
 > Hi Tom
 >
 > I am using the following Statement
 > System.Windows.Forms.IDataObject temp =
 > System.Windows.Forms.Clipboard.GetDataObject();
 >
 > I get the Exception The Clipboard operation failed
 > The function that contains the statement runs under a STA thread.
 >
 > My web service code does the following
 > based on a document id, RTF content is fetched from the database.
 > A word document is created.
 > The RTF content is set to the Clipboard using the IDataObject retrieved
 > using the statement System.Windows.Forms.Clipboard.GetDataObject();
 >
 > then using this statement
 > p_oTempWordDoc.Range(ref l_oMissing,ref l_oMissing).Paste the rtf content is
 > pasted to the word document. this document is saved and then sent to the
 > client (that is the URL to the document)
 >
 > This is the statement that fails
 > System.Windows.Forms.Clipboard.GetDataObject();
 > It same code works correctly on Win2k server with IIS5.0 Wonder what could
 > be the reason for not working in WIN2K3 and IIS6
 >
 > Thanks
 >
 > "Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
 > news:cevvqv$4cc21@kcweb01.netnews.att.com...
  > > "Prasanna Dsouza" <prasanna.DeleteThis@irislogic.com> wrote in message
  > > news:egtbZD7eEHA.712@TK2MSFTNGP09.phx.gbl...
   > > > Hi
   > > > I cannot access clipboard for setting or getting data in my Web
 > Application.
   > > > Does it have anything to do with security.
   > > > Where should i make changes, Local Security Policy, what rights are
   > > > required for accesing Clipboard
  > >
  > > Exactly how are you trying to access the Clipboard from your web app?
  > >
  > > --
  > > Tom Kaminski IIS MVP
<font color=green>  > > <a style='text-decoration: underline;' href="http://www.microsoft.com/windowsserver2003/community/centers/iis/</font" target="_blank">http://www.microsoft.com/windowsserver2003/community/centers/iis/</font</a>>
<font color=green>  > > <a style='text-decoration: underline;' href="http://mvp.support.microsoft.com/</font" target="_blank">http://mvp.support.microsoft.com/</font</a>>
<font color=green>  > > <a style='text-decoration: underline;' href="http://www.iisfaq.com/</font" target="_blank">http://www.iisfaq.com/</font</a>>
  > > <a style='text-decoration: underline;' href="http://www.iistoolshed.com/" target="_blank">http://www.iistoolshed.com/</a> - tools, scripts, and utilities for running
 > IIS
<font color=green>  > > <a style='text-decoration: underline;' href="http://www.tryiis.com</font" target="_blank">http://www.tryiis.com</font</a>>
  > >
  > ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Clipboard Access + IIS6.0 + Win2003 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting Problem Solving Community! (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]