Whats the prototype of CMerchandizeOrder constructors ??

Also you are using order and orders variable . My guess is you are passing the wrong one. Am not sure though. Can say more if u show what the CMerchandizeOrder ctor takes