PDA

View Full Version : Installing OpenGL package into C++ Builder 2010



Deep Thought
08-11-2010, 08:29 AM
For some years I have been using OpenGL with Borland C++ Builder 4 and now need to upgrade to Embarcadero C++ Builder 2010. I have tried loading the original package OpenGLPanel_DP.bpk but get an error message telling me that VCL40.dll is not found. I have recently received a more recent version from the author excluding the .bpk component and have compiled at .bpl level OpenGLPanel_DP.bpl and get an error message "Registration procedure, Openglpanel.register in package .......OpenGLPanel_DP.bpl raised exception class EPaletteException Blank group names are not allowed"

Can anyone explain what is going wrong here ?

It is an excellent package which has served me well and I do not want to try any alternative package if it means changes to my coding.

Thanks

Dan Bartlett
08-11-2010, 10:59 AM
I'm not sure of the equivalent for C++ Builder, but in Delphi you'll get that exception if you try to install a package that contains a "Register" procedure which tries to register components to be shown into a page with no name.

eg. This will cause the exception:

procedure Register;
begin
RegisterComponents('', [TMySceneViewer, TMyScene]);
end;
but this won't

procedure Register;
begin
RegisterComponents('My Scene', [TMySceneViewer, TMyScene]);
end;

Looking at http://docwiki.embarcadero.com/VCL/en/Classes.RegisterComponents and http://docwiki.embarcadero.com/CodeSamples/en/RegisterComponents_(C%2B%2B), it seems the C++ equivalent would be:

void __fastcall PACKAGE Register()
{
TComponentClass classes[2] = {__classid(TMySceneViewer), __classid(TMyScene)};
RegisterComponents("My Scene", classes, 1);
}

Deep Thought
08-13-2010, 01:59 PM
Thanks Dan, that has helped me narrow things down and I think that this code needs revising for B2010 to reflect the hiden nature of the TMetaClass* which I have not quite grasped.

void __fastcall PACKAGE Register()
{
TComponentClass classes[1] = {__classid(TOpenGLPanel)};
RegisterComponents("OpenGL_DP", classes, 0);
}

Any thoughts ?

Thanks