cannot add menu item with AddMenuItem3 api.

Hi all, I have an addin, built in VC++, VS 2008, that works with SWKS, till now my addin menu loads menu items properly. But recently I require bitmap icons to be displayed beside menu items, there is an api AddMenuItem3 for that. But with this api I am not able to see the menu items, with or without bmps. Here is a summary about what I have been doing.

I am creating main menu (say "Sample") with the api

AddMenu(docType,"Sample",   Pos,  &res); Strange , but res return a -1 here but still it displays a menu Sample inmain SolidWorks menu bar. .

Then I added a bmp for menu item to my addin resources, then extracted the bmp file from the resource and got a temporary file name for the bmp as "bmpPath". Something similiar to what I saw in the VB sample code provided by SolidWorks named "VB_COM_Menu_Icon".

Then I try to add menu items to it as

AddMenuItem3(docType,cookie, "menuItem@Sample" ,-1,  bstrMenuHandler, bstrUpdateMenuHandler,"",bmpPath,&IsMenuItemAdded) ;

But I cant see any menu item added to my main menu "Sample" . Variable IsMenuItemAdded returns 0.

What can be wrong here? I will be greatfull to any kinds of feedback.

Thanks and regards

SolidworksApi macros