How to load HTML after LoadString() deprecation

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Re: How to load HTML after LoadString() deprecation

Postby francoismarchal » Tue Jan 05, 2021 12:40 pm

I finally use the code in tests/unittests/resource_manager_unittest.cc and cut and paste the OneShotProvider class and the ProviderDestructHelper classes in my source code, then I can easily insert content by calling the following code:

ProviderDestructHelper destruct_helper(1);

fResourceManager->AddProvider(
new OneShotProvider(content,
destruct_helper.callback()),
0, std::string());

All the problems I had with my previous implementation based on the URI are now gone! codelimit, it can interest you also because it addresses your question about how to remove the provider.
francoismarchal
Newbie
 
Posts: 5
Joined: Fri Sep 23, 2016 4:26 am

Re: How to load HTML after LoadString() deprecation

Postby ndesktop » Tue Jan 05, 2021 3:05 pm

A custom registered scheme is what I am using since forever. Then is a matter of handling the HTML content and build a dispatcher for the scheme which in turn load HTML from libraries (dll), resources, disk, from code etc. and supplying back as a response.
ndesktop
Master
 
Posts: 750
Joined: Thu Dec 03, 2015 10:10 am

Re: How to load HTML after LoadString() deprecation

Postby sekvoja » Tue Feb 09, 2021 6:06 am

francoismarchal wrote:I finally use the code in tests/unittests/resource_manager_unittest.cc and cut and paste the OneShotProvider class and the ProviderDestructHelper classes in my source code, then I can easily insert content by calling the following code:

ProviderDestructHelper destruct_helper(1);

fResourceManager->AddProvider(
new OneShotProvider(content,
destruct_helper.callback()),
0, std::string());

All the problems I had with my previous implementation based on the URI are now gone! codelimit, it can interest you also because it addresses your question about how to remove the provider.


Please tell me where does fResourceManager come from?
sekvoja
Newbie
 
Posts: 1
Joined: Tue Feb 09, 2021 5:00 am

Previous

Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 34 guests