home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / msdos / programm / 12463 < prev    next >
Encoding:
Internet Message Format  |  1993-01-26  |  3.3 KB

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