IStream:Read with WaitForSingleObject leads to an application freeze

My application uses a mixture of C++ native code and Java code.
The Java code is responsible for requesting data from a filestream and forwarding it to the C++ code, where it is written into the IStream implementation. The IStream-object is added to my Ole-Clipboard implementation.
After pasting a file, IStream:Read is called some x times until there are no more bytes to read (currently, since the data requests are rather slow). If that happens, my implementation for IStream:Read calls WaitForSingleObject(some eventhandle that was
passed during construction,INFINTE). Theoretically, the part of my code that writes data to the IStream-Object issues a SetEvent for the same eventhandle whenever new data is written to the stream.
Practically, my Application and the Windows Explorer freeze when this point in execution is reached, because the Read and Write calls are handled in the same thread.
I am not really sure why, since I call IStream:Write from a thread that has nothing to do with the IStream-Object (other than having a reference to it).
What can I do to fix my problem?

Thanks for your reply, yes I am using JNI to start a thread that handles my window-proc messages and where the Ole-library is initialized.
Java notifies this thread through a JNI-method of available data, the thread creates an IDataObject and puts it in the Ole-Clipboard.
The first time an IDataObject->GetData() request for the Filecontents format is made, the thread requests data from Java and starts writing it into an IStream-object (IStream:Write).
At some point (after the user decided to paste somewhere), the IStream:Read calls issued by the pasting program (probably explorer most of the time) reach a point where currently no data is available. My implementation of IStream:Read calls WaitForSingleObject()
in that case. Every subsequent call to IStream:Write fails because it would be executed on the same thread as IStream:Read and frankly I have no idea why and hoped somebody here could help me.
EDIT: As far as I understand it, this is basically what happens:
IStream* dsc_stream;
HANDLE ac_filerender;
typedef struct information {
HANDLE filerender;
IStream* dsc_stream;
} information;
DWORD __stdcall m_read(LPVOID dsp_stream) {
while(true) {
dsl_stream->Read(buffer,2,&bla);
DWORD __stdcall m_write(LPVOID dsp_info) {
while(true) {
dsl_info->dsc_stream->Write(buffer,10,NULL);
SetEvent(dsl_info->filerender);
int main() {
OleInitialize(NULL);
ac_filerender = CreateEvent(NULL, FALSE, FALSE, NULL);
m_create_my_stream(/*some stuff*/,&dsc_stream);
information damn;
damn.dsc_stream=dsc_stream;
damn.filerender=ac_filerender;
HANDLE threadWrite = CreateThread(NULL, 0, m_write, &damn, 0, NULL);
Sleep(10);
HANDLE threadRead = CreateThread(NULL,0,m_read,dsc_stream,0,NULL);/*...*/
GetCurrentThreadId() in IStream:Write/IStream:Read return the same threadid. Which means that I can't issue a wait-order in Read, when I need the thread running to use write.
I have no idea why IStream:Read and Write run on the same thread and am absolutely clueless on what I can do to fix this.

Similar Messages

  • HT201302 Even though there are over 200 photos on my ipad, after trying both methods of importing and connecting with a lead, a message appears saying that there are no photos on this device. Any ideas?

    Even though there are over 200 photos on my ipad, after trying both methods of importing and connecting with a lead, a message appears saying that there are no photos on this device. Any ideas?

    Did you connect your iPad to your computer then open the application on your computer that transfers photos from a camera? Your computer should recognize the iPad as a camera. All photos in the Camera Roll on the iPad should then be seen and you should be able to copy them to the computer using that application.
    Photos that were synced to your iPad by connecting to your syncing computer cannot be copied back this way as the master file for those photos are on the syncing computer.

  • How do I take a thermocouple reading with a pci6025E?

    How do I take a thermocouple reading with a pci6025E? I have seen some postings with scxi-1112 modules which I do not have. I need advice from the ground up. Do I need external circuitry, can I just wire both leads of the thermocouple to Ain0 differential pins, what vis are necessary in the actual programming... If there is an example program or anything else that might seem relavent? I appreciate any help.

    This is most probably a result of multiple factor that make the measurement imperfect:
    - You're not using signal conditioning, so your resolution is definitely very reduced. Any temperature drift in the board could cause a big difference in the reading. I recommend you run your vi for approximately half an hour, unplug the accessory and perform a self calibration. This will have the board at the operational temperature you're expecting and will give you the best results.
    -I personally would recommend using a different sensor type (RTD or Thermistor) as the CJC source, in order to obtain an accurate measurement, otherwise you have a bit of a "chicken and egg" problem, because you're using thermocouple 2 as the CJC for thermocouple 1, but what are you using as the CJC source of thermocouple 2?
    - Are both your thermocouples of the same type and manufacturer? Due to the nature of the thermocouple itself, you can find slight variations between thermocouples from different vendors, due to the purity of the metals used. While this would usually be almost impossible to detect, it might be driving your voltage just enough to be in the next detectable voltage step (again, due to the reduced resolution).
    - I've worked with temperature sensors for a while, and I'd still recommend that you try some sort of signal conditioning in order to increase your accuracy. Even a small amplifier and a passive lowpass filter will do great. I know you said you don't have SCXI, but if you want some lower cost ready to use applications you might consider looking at the SCC Carriers and modules we have.
    I hope these suggestions help. Please let me know if you have any other questions.
    Daniel

  • Problem with pdf display downloaded from application server

    Hi all,
    I have a problem with displaying pdf downloaded from application server (saved in BINARY MODE).
    I am getting the pdf output of adobe form in FPFORMOUTPUT-PDF as rawstring back to my program and then converting that rawstring into binary form using the function module SCMS_BINARY_TO_STRING.
    Now, when I export the data to presentation server directly using cl_gui_frontend_services=>gui_download, the pdf is downloaded properly.
    However, when I save the data to application server file by looping at the internal table obtained from SCMS_XSTRING_TO_BINARY and using TRANSFER, and subsequently downloading the file in "unconverted format" from AL11 to my desktop, I am getting a "blank" pdf file (with the same number of pages as the one downloaded using gui_download).
    I have tried different encodings during download but in those cases i get corrupted pdf message. only the default option of INTIAL value seems to work.
    I am forced to believe that there is a problem in my code which saves the data to app server but I cant find any solution that is logical. Any solution to this would be greatly appreciated.
    Regards,
    Sasi
    Edited by: Sasi Upadrasta on Sep 29, 2010 7:55 PM

    used a program to read the file from appl server and then downloading it to desktop.

  • I have built a android application using adobe flex, and i have exported it with native air. The application is working fine on samsung phones whereas it is getting crashed on Moto Phones, which runs on android kitkat, is there any compatibility issue ?,

    I have built a android application using adobe flex, and i have exported it with native air. The application is working fine on samsung phones whereas it is getting crashed on Moto Phones, which runs on android kitkat, is there any compatibility issue ?, I have built a android application using adobe flex, and i have exported it with native air. The application is working fine on samsung phones whereas it is getting crashed on Moto Phones, which runs on android kitkat, is there any compatibility issue ?, I have built a android application using adobe flex, and i have exported it with native air. The application is working fine on samsung phones whereas it is getting crashed on Moto Phones, which runs on android kitkat, is there any compatibility issue ?

    Thanks, Flex harUI, for the direction in regards to isolating build changes. That aside (still working on it), can you offer any direction in regards to my original question on SDK and AIR compatibility? I'm specifically looking for a version compatibility mapping or anything that definitively states, "Flex SDK x.y.z works with the following versions of AIR". This information is crucial for us in order to more specifically plan our own roadmap built upon these two frameworks as we consider both existing installations of our software and future distributions.

  • Planning problems with russian language during refresh application

    Hello all ))
    I have problems with Planning during refresh my Application with Essbase.
    I intsalled Essbase on RHEL4 and set ESSLANG=Russian_Russia.ISO-8859-5@Default also I set locale on ru_RU.iso88595
    Ater that I installed Planning on Solaris 9 which uses Oracle RDBMS with NLS_CHARACTERSET=AL32UTF8 and set locale on server to ru_RU.iso88595
    Now I can create dementions, members on russion language in Essbase without problems also I can create dementions,members,etc on russian language in Planning. But if I create demention or member in Planning on Russian languge and ) try refresh my Application with Essbase I give follow error
    "=====(HspCubeCreation.java)sQueryString:?Application=Test1
    com.hyperion.planning.olap.EssbaseException: (1060010)
    at com.hyperion.planning.olap.HspEssbaseOutlineAPI.EssAddMemberEx(Native Method)
    at com.hyperion.planning.olap.HspCubeRefreshTask.addChildren(Unknown Source)
    at com.hyperion.planning.olap.HspCubeRefreshTask.addMembers(Unknown Source)
    at com.hyperion.planning.olap.HspCubeRefreshTask.addDimensionsAndMembers(Unknown Source)
    at com.hyperion.planning.olap.HspCubeRefreshTask.buildOutlines(Unknown Source)
    at com.hyperion.planning.olap.HspCubeRefreshTask.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)"
    Why it's happened?
    Please anybody help me

    since march 5 we are on planning 9.3.1.1 and also having problems with refreshing:
    com.hyperion.planning.HspCubeRefreshInProgressException: Cannot complete your request because the database is being refreshed.
         at com.hyperion.planning.HspJSImpl.lockApp(I)V(Unknown Source)
         at com.hyperion.planning.HyperionPlanningBean.lockApp()V(Unknown Source)
         at HspSecurityFilter.Handle(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(Unknown Source)
         at HspSecurityFilter.doPost(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3150)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
    com.hyperion.planning.HspCubeRefreshInProgressException: Cannot complete your request because the database is being refreshed.
         at com.hyperion.planning.olap.HspCubeRefreshTask.run()V(Unknown Source)
         at java.lang.Thread.run()V(Unknown Source)
    anyone a idea?

  • Default pagination functionality(Jdev 11.1.1.7.0) is incomplete with in webcenter portal framework application.

    Hi,
    Am using default pagination with in the table for portlet application using Jdev(11.1.1.7.0),when I run portlet application it is working properly.
    When I run the same portlet application with in webcenter portal framework application, I could not find page number navigation and count of total number of records.
    Thanks,
    Santoshi.

    Thanks a lot,Its working fine when I moved adfp into Panel Group Layout and one more important point is am using "default globe page template" which comes with webcenter framework application with content facetRef in Panel Group Layout which uses some inline style so changed its styleClass to "AFStrechWidth".

  • My app store will not open. when i try to open it i get an error that reads "You can't open the application App Store because it may be damaged or incomplete". How can I fix this?

    my app store will not open. when i try to open it i get an error that reads "You can't open the application App Store because it may be damaged or incomplete". How can I fix this?

    I am having the exact same problem.  MacForums has been helping me, and I called Apple.  After trying everyone's suggestions, and Apple's, no success.
    My App Store app still says "incomplete or damaged."  There is even a circle with a line through it on the icon.  Apple said reinstall my Snow Leopard upgrade disc (not my original Leopard disc) and then run the Combo Update (like your suggestion).  Did not work.  I also updated the software from "Software Update".  Rebooted.
    I think this started after I replaced my hard drive with a SSD and moved the hard drive to where the DVD was.  I wonder if the person above who had the same problem also installed a SSD?
    Anyway, anymore ideas?  Even Apple is stumped.
    (In answer to the other post above, my Quicktime works fine.)
    Message was edited by: mrivmriv
    Just did some more reading.  I was going by the icon in the dock.  When I checked in Finder, there it was, fixed and brand new!!  Thanks, anyway.
    Message was edited by: mrivmriv

  • Want: Adobe Reader with Firefox but not with Safari

    I've been using Firefox as my primary browser for awhile, but still use Safari at times. I use Adobe Reader to display PDFs within Firefox, and it is currently also used by Safari.
    I'd like to take advantage of Safari's new ability to natively display PDFs within the browser window without using Adobe Reader, but I want to continue to use Reader with Firefox.
    Does anybody know of a way to make this happen? It seems to be an all-or-nothing proposition since the same plug-in is used by both browsers.
    iBook G4 12"   Mac OS X (10.4.6)   It's white.

    well, you might try quitting safari & firefox, then moving the adobe plugin(s) from /hd/library/internet plug-ins/ to /applications/firefox.app/contents/plug-ins/ In finder, press Apple-shift-G & paste the italicised text above into the box - this will take you to the firefox plug-ins folder ( assuming you have firefox in the applications folder )
    then restart the browsers & see what happens
    Please note - I don't know that this will work, but it's easy to try & easy to revert back to normal - just quit the browsers again & move the plugin(s) back where they came from.
    I'll just test it with a different plug-in......

  • Is there a way to restrict changing the browsing history in safari with ought restricting the entire application?

    Is there a way to restrict changing the browsing history in safari with ought restricting the entire application?

    For the iPod touch in your profile?
    Private browsing help here >  iOS:  Safari web settings
    For Safari for Mac OS X ...
    From your Safari menu bar click Safari > Private Browsing
    You can only block all history in Private Browsing, pages you visit, and autofill.

  • Haw do i put evry thin back on my ipod as i accadently wiped evry thin off and now it just shows a screen with the lead and itune bubble

    haw do i get my ipod 2 work after i accedently wiped evry thin off and now it just shows a screen with the lead and a itunes bubble

    dennisfromabertillery wrote:
    haw do i get my ipod 2 work after i accedently wiped evry thin off and now it just shows a screen with the lead and a itunes bubble
    Connect to your computer, fire up iTunes and do a Restore:  From iTunes, select the iPad and then select the Summary tab.  Follow directions for Restore.

  • Difference between Req with insufficient lead time and lead time const

    Hi ,
    1) Can anyone explain the difference between Requirement with insufficient lead time and Requirement lead time constraint exception messages. Both seems to be similar for me with the compressed time.Also at what situations these exceptions are generated.
    2) what is minimum lead time required ,actual lead time and its calculation.
    Thanks...

    Check out
    http://help.sap.com/saphelp_scm50/helpdata/en/99/ed3a981d0f11d5b3fc0050dadf0791/content.htm
    particularly the section "Which functions of the operations relevant to scheduling are supported?"
    It will give you a flavour of what can lead to difference in planning.

  • Copy an application with plugins into a new application and change theme...

    I copied an application (theme 23) with plugins into a new application and then changed the theme to theme 26. After that, all plugins (skillbuilders super lov, skillbuilders modal, and notification plugin) didn't work at all. However, when I changed the theme back to the original theme, things worked.
    I have applications that use theme 26 with plugins and they all work fine. I think the problem is related to copying one application, containing plugins, into a new application. Does anyone have any idea of it?
    Thanks.

    Hi,
    Most plugins have css,images or js files which can be placed on the server.
    It might be that you have placed those files on the server in the theme directory.
    If you change the theme then the plugin can not find those files any more.
    Regards,
    Kees Vlek
    <tt>Company: http://www.orcado.nl
    Blog: http://www.orcado.nl/blog/blogger/listings/69-kvlek
    Twitter: http://www.twitter.com/skier66</tt>
    If the question is answered please change it to answered.

  • WD ABAP - Reading the URL Parameters for FPM application

    Hi,
    As per the Custom requirment,
    I want to pass URL parameters for WD ABAP application (sap/bc/webdynpro/dbm/app_veh_cus_search) which uses FPM.
    example: sap/bc/webdynpro/dbm/app_veh_cus_search?Customer=12345&fromExternal=true
    I am facing difficulty in reading the URL parameters.
    How to read/get the URL Parameters for an FPM WD ABAP application????
    Observation:
    I tried reading the parameter in Window --> HANDLEDEFAULT method. But could NOT read the Parameters from here for FPM application whereas if I create a Z Custom application then I could read the URL Parameters. so the issue is in reading the URL Parameters for FPM application.
    Kindly support
    Regards,
    Hussain

    Hi Hussain,
    You can do this either with the methods of interface if_fpm_parameter...
    DATA lo_param TYPE REF TO if_fpm_parameter.
    lo_param = cl_fpm_factory=>get_instance( )->mo_app_parameter.
    CALL METHOD lo_param->get_value
        EXPORTING
            iv_key   = parameter_name
        IMPORTING
            ev_value = parameter_value.
    or a more generic approach using class cl_wd_runtime_services...
    cl_wd_runtime_services=>get_url_parameter
    Cheers,
    Amy

  • HT201210 in my phone when i open it appers a mesage with this message : error in application occured .error code : DF XX2700/6F1D WHAT'S THAT?

    in my phone when i open it appers a mesage with this message : error in application occured .error code : DF XX2700/6F1D WHAT'S THAT?

    i googled it - try a different sim card - did you go through a demagnetizer or something?

Maybe you are looking for