0

I'm implementing a class named FilesWorkFlow. It's task is to open a file dialog and then if the file's extention is geotiff, some other member functions will be implemented to work with it. As you know before working with GDAL files , you have to call GDALAllRegister() so I need to call this function somewhere in the class that all of the member functions will suppose GDAL drivers as registered. Where should I call it?

4

1 回答 1

1

状态的文档GDALAllRegister

此函数通常应在应用程序开始时调用一次。

鉴于该要求,我认为从您的CWinApp::InitInstance覆盖中调用它没有任何问题。

作为替代方案,您可以将 GDAL 功能封装到Singleton中并使用Lazy Initialization

于 2013-07-28T13:36:53.710 回答