Top
PowerCOBOL V11.0 Reference
FUJITSU Software

5.12 ChangeDDEItem Method

Description:

Re-connects the advise loop, using a new DDE item name.

Used in controls:

DDE

Used in objects:

None.

Parameters:

VT_BSTR - DDEItemNameX(8192)

VT_BSTR - DDEFormatNameX(8192)

Description of Parameters:

DDEItemName: The new DDE item name.

DDEFormatName: The format name of the new DDE item.

Return value:

VT_I4 - ReturnValueS9(9) COMP-5

Zero or greater indicates normal completion.
Negative indicates an error.

Example:

See the ChangeDDEItem Example

Backward compatibility
method name:

CHANGEDDEITEM

Backward compatibility
arguments:

1. X(128)
2. X(32)

Example of the ChangeDDEItem Method

Assume that you want to set these properties in an Excel DDE control (CmDDE1):

	DDEServiceName:  
	DDETopicName:	   
	DDEItemName:      R1C1:R2C2
	DDEFormatName:  CF_TEXT
	DDELinkStyle:	   2 - Warm-Link

In the form's Opened event procedure add this code to be executed only once to start the DDE session with Excel:

 ENVIRONMENT     DIVISION.
 DATA            DIVISION.
 WORKING-STORAGE SECTION.
 PROCEDURE       DIVISION.
 	   INVOKE CmDDE1 "Execute" Using
	   		"Excel c:\exceldde97.xls"
 	   		POW-SWSHOWNORMAL  
 	   		Returning ReturnValue
     INVOKE CmDDE1 "OpenDDE" 
     		RETURNING ReturnValue

The following code executes the ChangeDDEItem method

 ENVIRONMENT     DIVISION.
 DATA            DIVISION.
WORKING-STORAGE SECTION. 01 DDE-Item Pic X(16). 01 DDE-Format Pic X(16). 01 ReturnValue Pic S9(9) COMP-5. PROCEDURE DIVISION. Move "R1C1:R2C2" To DDE-Item Move "CF_TEXT" To DDE-Format INVOKE CmDDE1 "ChangeDDEItem" USING DDE-Item DDE-Format RETURNING ReturnValue