> So wiring just an empty > string constant will pass a 0 lenght buffer to the function and when it then > tries to fill in the information you get a General Protection error. > > You need to create a buffer long enough for the function. The function > documentation should contain the information about what size this has to > be. >
This answer is pretty much what I would say, but just to clarify, when you overwrite memory by writing past the string's buffer, you don't always crash with a GPF. Many times you will just corrupt other buffers that have nothing to do with the DLL call. Then when you return to the diagram and LV tries to access those buffers, the contents may make no sense and cause LV to do something stupid -- causing a GPF. Many times the other buffers aren't touched until being torn down during a close or recompile. So anytime you get a crash in a LV diagram not during a particular call, the primary thing to look for is DLL nodes that are passing back data in a buffer. Greg McKaskle
