Hello everyone,
I am not an expert in VS, but I looked what ImportResToCurFileN is doing and tested the original script. And here are the results:
It builds a list of all resources in the current document, and then in my Libraries folder. So, the first time I run it, it imports THE FIRST symbol from the list into the current document, because my document is empty.
ImportResToCurFileN( resList , 1, ImportResCallback ); Second parameter 1 is an index of the symbol in the list.
Second time it again builds the list from the current document + Libraries. And now the first symbol belongs to the current document, and nothing happens.
Because after the resource is imported, the next attempt sees it is already present, and it matches, so it doesn’t require either import or conflict handling.
You can loop through all elements of the list, and you will see the conflict eventually.
Other testing suggestions: while looping you can check the name of the resource GetNameFromResourceList(resList, idx), and/or GetResourceFromList(resList, idx), which will return NIL for resources not in the current document. And only for those resources it makes sense to call Import.
Lada