Set camera name fail, why?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 29/07/2007 at 19:07, xxxxxxxx wrote:

User Information:
Cinema 4D Version:    
Platform:   Windows  ;   
Language(s) :   C.O.F.F.E.E  ;  C++  ;

---------
when I  was added a new camera after, I reset the name of camera, but was fail , the code is this:
CameraObject* cam = (CameraObject* )BaseObject::Alloc(Ocamera);
 if ( !cam )
 {
  MessageDialog("CameraObject Create Fail!");
  return false;
 }
cam->SetName("Publish_Camera1"); 
doc->InsertObject(cam, NULL, NULL);

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 30/07/2007 at 05:44, xxxxxxxx wrote:

I don't understand, your code seems to work fine.

cheers,
Matthias