Just a guess: is the machine with LabVIEW the same you are developing the dll on?
If not, you may simply be missing the CVI run-time Engine, which is required by the call to InitCVIRTE () in DLLMain ().
Installing the run-time engine would correct this error and some possible future errors you may encounter when coming to develop the real dll you need if the functions you call rely on the rte.