I want to put an bitmap image over that object.
Do you mean .bmp file by "bitmap" image? Cortona does not support BMP as textures.
Can somebody explain me what is not correct here and how can I do that.
Technically, the code is correct. It should work.
Keep in mind, that if the "root" scene was not loaded from any URL (via Scene property) but created from scratch, there is no such thing as "base URL", and fully qualified URLs should be specified for all resources you're trying to load.
As an advice, to make your code more simple, concern over the possibility of use ATL classes: CComVariant as replacement of plane VARIANT, CComBSTR as wrapper for BSTR type etc.
Yes, I used .bmp files. Now I tried with .PNG and .GIF but it does not work too.
.BMP files definitely won't work.
Since there is no "base URL", texture URL such as "./image.png" is useless. You have to specify fully qualified URL, for example "file:///C:/Scenes/textures/image.png".
(Make string containing full path to texture, then convert it to URL with file scheme.)
I did not understood it.
Do you mean I have to use something like that:
if(SUCCEEDED(m_Engine->CreateNodeFromString( L"Appearance {texture ImageTexture { url "file:///C:/Scenes/textures/image.png" } ", &Appear)))
AfxMessageBox(L"Appearance object created");