YaBCK
YaBCK

Reputation: 3029

Load file from "Resource Files" folder C++ Windows Application (win32)

I'm trying to load a file from the Resource Files folder inside my Windows Application (Win32) C++.

My folder structure inside Visual Studios is as following:

The only way i've been able to access the login.html file is by doing the following:

WebBrowser->Navigate("file://C:\\Users\\Chris\\Desktop\\WindowsProject\\Windows\\MIA_Windows\\MIA_Windows\\MIA_Windows\\web\\login.html");

I don't want to access it by doing the whole path. I want to be able to access it like the following:

WebBrowser->Navigate("file://\\web\\login.html");

Does anyone have any suggestions on how I'd be able to do this?

Upvotes: 1

Views: 2099

Answers (1)

Ben Voigt
Ben Voigt

Reputation: 283634

Native resources can be loaded from embedded resources using the res:// URL scheme.

See the MSDN documentation for the res: protocol and more details from the Knowledge Base

For non-embedded content, you can try setting the BaseURL for the host WebBrowser, which controls decoding of relative URLs.

Upvotes: 2

Related Questions