Original message: Hi List, The ArcView help pages "Writing your own DLL" mention that since VB5 does not support "exported" functions, it cannot be used to create dlls that ArcView can read. However, this should be possible in VB6. Is that correct? If so, does anyone have the code of a simple dll created in VB and accessed by ArcView? I can use other dlls in my Avenue code, but I'm not sure how to declare an exported function in a VB ActiveX dll. Even something as simple as the math.dll (written in C) described in help file would be great. All that dll does is add two numbers together. AV passes the two numbers to the dll, and the dll sends the result back to ArcView. Thanks for your help. Bryan Summary: The simple answer is that you can't. Scott Engel (scotte@newcenturysoftware.com), Michael Hickey (MHickey@co.tulare.ca.us), Rineer, James (JRineer@dewberry.com), Rautenberg, Volker (V.Rautenberg@pro-crm.de), Fene, Michael (MICHAEL.FENE@saic.com), and Ro bert van Waasbergen (robertvw@aeds.com) all wrote to confirm that. Bruce Cotton (Bruce.Cotton@agso.gov.au) sent a Word file documenting an error in the AV help files for writing a DLL in C++. E-mail me if you want a copy of that. Jorg Thomsen (jthomsen@mapmedia.de) sent the most detailed reply suggesting a couple workarounds. Here is Jorg's answer which was also a SUM to this list some time ago: Hi bryan, You can't. The reason is: Visual Basic only creates ActiveX DLLs. This means that you can only use these DLLs in an OLE-enabled environment, of which ArcView is not. Visual Basic compiles an ActiveX DLL, which is nothing like a true dll containing exported functions. There is no easy way within Visual Basic to export a function I recently ran into a similar situation where I had to integrate ArcView with another system based entirely on VB DLLs that had been developed over the course of several years. After posing your question to every ESRI person I could at the user conference, I came away with a simple answer- you can't do it directly. C++ DLLs work fine, but not VB Yup, VB dll's don't work with ArcView. The reason is b/c ArcView can on call "Old School" DLL's that export their functions. VB only creates COM dll's that do not export their functions. COM uses GUID's and other Microsoft voodo to make the function call. AV does not work with ActiveX DLLs at all (VB or otherwise). This is according to ESRI. BUT there are some work-arounds: If you've already got the DLLs coded and compiled, one trick would be use Visual C++ to write a wrapper around the VB DLL. This wrapper would be a standard DLL whose exposed functions pass through to the VB DLL. Since Visual C++ can use ActiveX components, this should theoretically work. I gues it could alos work in any environment that supports ActiveX. Purchase PowerBasic - a Basic dll compiler that will produce a true dll with exported functions. For about $300 US you can get both the compiler and the dialog designer. This is probably the easiest method with the smallest amount of learning to do. Supposedly Sheridan Software has a control that will allow you to export functions in a Visual Basic dll. I have never been able to get this to work, but you might consider it as a last resort. My solution was to create a VB executable that reads a "transaction file" that avenue creates, performs the appropriate action, then deletes the file. I didn't want to use DDE because I had to guarantee it would work. The exe is called from avenue with a "system.execute" request. Actually, in my application, the exe is started only once and sits listening for transaction files to process, then it quits when ArcView quits. Kind of a hokey solution, but it works and was easier than trying to get our VB guys to switch to C++. Es gibt einen Freeware-Basic-Compiler namens XBasic, mit dem man echte DLLs erstellen kann (hab's selber noch nicht getestet). Zu finden ist er bei http://www.maxreason.com/software/xbasic/xbasic.html oder bei http://ntfreeware.zdv.uni-tuebingen.de/NTSOFT/default.htm O.K., that's all. I Think we'll try the xBasic-Solution and if that does not work we will create an executable. Thanks again to: Nick Seigal, Criterion Planners/Engineers Thomas Sakowski Don Browning, GIS Analyst/Programmer at GeoFocus, Inc. Timothy E. Johnson, Maricopa County Elections Department James Marlow Bill Dollins mvh matts, Soil and Water, Helsingfors, Finland Mike Jorg Thomsen MapMedia - Kartographie und raumbezogene Informationssysteme MapMedia - Cartography and spatial Informationsystems Am Borsigturm 42, D-13507 Berlin Tel.: +49 (030) 43 03 21 00 Fax: +49 (030) 43 03 21 01 eMail: jthomsen@mapmedia.de internet: www.mapmedia.de Thank you to everyone for the answers. __________________________________________ Bryan Keith GIS Specialist Geomega, Inc. Boulder, CO, USA bryan@geomega.com