Include dll in internal CATIA vba

Dirk Holzhüter

Include dll in internal CATIA vba
Hello
I have recently started working with vba in CATIA v5 R18. I used the userforms and made some automations within the Generative Shape Design.
I have the following problem:
I need to write data e.g. positions of planes or values of parameters into an existing xml file. I have two dll's, probably written in C++, which are supporting the acces to this xml structure via special functions and methods.
I tried to add these dlls in the CATIA internal vba editor  via menu: Tools\References -> Browse. This brings up an error: "Can't add a reference to the specified file".
Does that mean that I cannot use the dll within the internal CATIA vba? Is there another way to link the dll so that I can use the methods? e.g. Declare? Create Object? I've read a lot but I have not found an example of the syntax.
A code example would be appreciated!

Thx in advance
Dirk

Shu Fang Fan

RE: Include dll in internal CATIA vba
(in response to Dirk Holzhüter)
http://support.microsoft.com/kb/106553

Balla Zoltan

RE: Include dll in internal CATIA vba
(in response to Dirk Holzhüter)

Hi Dirk,

did you somhow managed to connect the DLL File?

If yes, could you please share with us, how?

Thank you.

Balla Zoltan

RE: Include dll in internal CATIA vba
(in response to Shu Fang Fan)

Hi Shu Fang Fan,

the link you privided ist not available anymore. Could you share it again? Thanks.

Little Cthulhu

RE: Include dll in internal CATIA vba
(in response to Balla Zoltan)

You can only reference .dll that defines COM-objects. 

If your dll exports functions directly (user32.dll for example) use "Declare" statement to import it in VBA.