How to pass data to/from a client app

Discuss and ask questions about CAD DLL (CAD Image DLL, CAD Importer DLL).

Moderators: SDS, support, admin

Post Reply
elmsst
Posts: 1
Joined: 09 Apr 2004, 17:51

How to pass data to/from a client app

Post by elmsst » 09 Apr 2004, 17:53

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.

SDS
Posts: 21
Joined: 12 Mar 2004, 11:16
Location: Russia
Contact:

Post by SDS » 12 Apr 2004, 13:05

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 
	}
}

Post Reply