Sounds strange, but I'm having a lot of trouble writing to text files from a VB6 add-in. This is with MapPoint 2006, although I've also tried MP2004.
The problem is occasional, but sufficiently common that if I'm writing a hundred lines of text then it will occur in either the first 'run' of my add-in or a re-run.
MapPoint 2006 itself appears to give the problem, and I get the XP message about reporting information to Microsoft. I've tried trapping errors in my file writing code - no luck.
I've tried commenting a lot of the code out so that only an open# and close# occur - still have the crashes!
(commenting ALL the file code fixes the problem, as does exporting to Excel)
I was initially using the "old school Basic" open# and close#, but also tried the modern FileSystemObject/TextStream api. This also gave the same problem.
Thinking back, I think this might be the only VB6 addin that I've written for MapPoint that writes to a text file! All the others usually write to Access or Excel via their COM interfaces.
So I checked the help file incase I missed something - a known restriction (like the non-modal dialog boxes). Can't see anything. Searches on Google and these forums also come up blank.
Is it really the case that writing to a text file in VB6 in a MapPoint addin is unreliable?
I guess a workaround would be write a C++ COM program that did the file writing and call this in a similar way as Excel.
Or I could just drop the text file output options from this add-in...
Richard