Page 1 of 1

How to pass data to/from a client app

Posted: 09 Apr 2004, 17:53
by elmsst
Does anybody have an example that shows how to use the parameters to pass data to/from a client during a call to DoDraw from DXFEnum?

DXFEnum(DXF, 0, DoDraw, NULL); //Calls the DoDraw function for each DXF entity

To be more specific, we are reading in a DXF file, and we have a layer labelled "BOARD" that contains a circuit board outline. We would like parse out the board outline, and move/store it in our client software.

Thanks in advance for the feedback.

Posted: 12 Apr 2004, 13:05
by SDS
Thank you for your question
Parameter in DXFEnum is 4 bytes, which can be a pointer to any data you want to use in function passed to DXFEnum (DoDraw for instance). The next example shows how to import all the entities on the layer with "BOARD" name passed as parameter.

Code: Select all

DXFEnum(DXF, 0, DoDraw, (LPARAM)"BOARD");

Use the parameter in DoDraw like here:

Code: Select all

DoDraw(LPDXFDATA Data, LPARAM Param) 
{ 
        <b>char</b> *layer = (<b>char</b> *)Param;;
	<b>char</b> *ch = Data->Layer;
	<b>if</b> (strcmp(ch, layer) == <font color="blue">0</font id="blue">)
	{
		//add your code here 
	}
}