I'm not sure if you used the term 'confidential information' in the legal/equitable sense, however given you wrote (IP) in brackets next to it I assume you were not referring to it in that way. If you did, you would need to demonstrate that (1) the information was confidential (it isn't common knowledge), (2) the information must have been imparted in circumstances importing an obligation of confidence and (3) the unauthorised use must have caused you a detriment.
Code wouldn't be considered 'confidential information', rather your rights, if any, would arise from copyright in the code. I don't want to second guess your lawyer, I am sure he gave his advice after he/she felt fully informed about the circumstances. You can bring a claim on various grounds, one of which is where your code was reproduced or copied. You need to demonstrate that your code and their code is objectively similar and there is a causal connection that links your code and the company's code.
Relevantly, copyright doesn't relate to the functionality of the code, only the expression of it - if your code does the same thing but is written differently, there is no copyright infringement. Hope that helps.