home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / mswindo / programm / misc / 5370 < prev    next >
Encoding:
Text File  |  1993-01-26  |  3.3 KB  |  87 lines

  1. Path: sparky!uunet!noc.near.net!hri.com!spool.mu.edu!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!hpscit.sc.hp.com!hplextra!hpcc05!hparc0.aus.hp.com!peterj
  2. From: peterj@PROBLEM_WITH_INEWS_GATEWAY_FILE (Peter Westley)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: BC++3.0/OWL DDEACK structure from WM_DDE_EXECUTE
  5. Message-ID: <1993Jan26.013313.10919@hparc0.aus.hp.com>
  6. Date: 26 Jan 93 01:33:13 GMT
  7. Sender: news@hparc0.aus.hp.com (News Adminstrator)
  8. Organization: HP Australasian Response Centre (Melbourne)
  9. Lines: 75
  10. X-Newsreader: TIN [version 1.1 PL8.5]
  11.  
  12. Is the DDEACK structure which comes pointed to in LOWORD of lParam when
  13. WM_DDE_ACK is in response to a WM_DDE_EXECUTE message, valid?
  14.  
  15. Let me explain:
  16.  
  17. I have a method called when I receive a WM_DDE_ACK message:
  18. (Using OWL dynamic dispatching it's easy) It get's called after sending a
  19. WM_DDE_XXX message to the DDE serveer, when the server replies with an 
  20. WM_DDE_ACK message.
  21.  
  22. class DDEClass
  23. {
  24.     //...
  25.     WMDDEAck(TMessage & Msg)
  26.     =[WM_FIRST + WM_DDE_ACK];
  27.     WORD PendingMessage;
  28. }
  29.  
  30. void DDEClass::WMDDEAck(TMessage& Msg)
  31. {
  32.     switch (PendingMessage)//pending message is the message which was just sent
  33.                //to the DDE server - i.e. it's what this WM_DDE_ACK
  34.                //is in reply to.
  35.     {
  36.     case WM_DDE_INITIATE:
  37.         //stuff
  38.         break;
  39.         case WM_DDE_REQUEST:                       
  40.     //I put this and the next case in blocks so that the DdeAck is only
  41.     //created if it's needed (i.e. a local copy only)
  42.         {   //Get the pointer to the DDEACK     
  43.         DDEACK *DdeAck = (DDEACK *)Msg.LP.Lo;
  44.         if(DdeAck->fAck)               //\
  45.             //stuff if ack is valid;   // \
  46.                 else                           //  |- these are different to the
  47.             //other stuff if it isn't; // /   DDE_EXECUTE commands
  48.         }                                  ///
  49.         break;
  50.     case WM_DDE_EXECUTE:
  51.         {   //Get the pointer to the DDEACK
  52.         DDEACK *DdeAck = (DDEACK *)Msg.LP.Lo; 
  53.         if(DdeAck->fAck)
  54.             //stuff if ack is valid;
  55.                 else
  56.             //other stuff if it isn't;
  57.         }
  58.         break;
  59.     }
  60. }
  61.  
  62. The problem is that when I get the response from the WM_DDE_REQUEST message,
  63. everything is fine (same for the WM_DDE_INITIATE but I don't use the DDEACK
  64. structure there)  When it enters the case WM_DDE_EXECUTE case section,
  65. I get a GP fault on access to the DdeAck->fAck location.  The code generated
  66. by the compiler is the same for both parts of the case statements (though
  67. I haven't been able to check the code which sets up the DDEACK struct).
  68.  
  69. SO, does anyone know if there is a problem in the windows code (3.1) which 
  70. might be broken here such that it doesn't allocate the DDEACK structure 
  71. properly?  Is the DDEACK struct supposed to be valid when it's in response
  72. to a WM_DDE_EXECUTE message?
  73.  
  74. Please help!
  75.  
  76. Thank in anticipation,
  77.  
  78. Peter Westley             .-_!\        Hewlett Packard
  79. Phone: +61 3 (T)272 2440        /     \        Australian Support Centre
  80. Fax: +61 3 890 0326          \_.-.b/<--------31-41 Joseph St.
  81. E-mail: peterj@hparc0.aus.hp.com     v          Blackburn, Victoria 3130
  82. //
  83. // The views, opinions, information or other data here is solely from the
  84. // mind of myself.  It is not the official word from my employer.  While I
  85. // endeavour to provide accurate information, no responsibility is taken
  86. // for errors or omissions.
  87.