Google Answers Logo
View Question
 
Q: SetClipboard crashing upon 2nd call with XP ( No Answer,   1 Comment )
Question  
Subject: SetClipboard crashing upon 2nd call with XP
Category: Computers > Programming
Asked by: lokesh_chandra-ga
List Price: $50.00
Posted: 08 Nov 2004 10:02 PST
Expires: 11 Nov 2004 06:49 PST
Question ID: 426154
Hello,

My application is crashing in SetClipboard call only with XP. It works
fine with Win-NT and Win-2000.

Here's the code snippet:

void CTelstudioView::SaveToClipboard()
{
   USES_CONVERSION ;
   UINT cFormat ;

   if( m_vecSelectedDO.size() > 0 )
   {
       //register our private clipboard format, and cache the data
       if(0 != (cFormat = RegisterClipboardFormat(XML_CLIPFORMAT)))
       {
           CXMLOleDataSource* pSource = new CXMLOleDataSource(this);
           if( pSource )
           {
               //save the selected DrawObjects to xml text
               char *lpszTempName = tmpnam( NULL ) ;
               if( NULL == lpszTempName )
                   return ;
               CFile fileNew ;
               if( !fileNew.Open( A2CT( lpszTempName ),
CFile::modeCreate | CFile::modeWrite ) )
                   return ;

               HGLOBAL hGlobal = NULL ;
               if( !RenderSelectedPACsToXML( &hGlobal ) )
                   return ;
               STGMEDIUM stg ;
               stg.tymed = TYMED_HGLOBAL ;
               stg.hGlobal = hGlobal ;
               pSource->CacheData( cFormat, &stg );
               pSource->SetClipboard() ;
           }
       }
   }
}

Any ideas?

Thanks
-Lokesh
Answer  
There is no answer at this time.

Comments  
Subject: Re: SetClipboard crashing upon 2nd call with XP
From: 12345a-ga on 08 Nov 2004 12:00 PST
 
My guess is that Xp breaks the way this call and  code  works if it
worked before in other ms Os's.

Ask microsoft about it.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy