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

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:
External Dependencies folder
Header Files folder
Resource Files Folder
Web Folder
css folder
js folder
images folder
login.html
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?

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.

Related

Expo: How to create a file in app's internal/private folder

I have explored expo FileSystem APIs but it doesn't give any option to store files on app's internal folders.
All the files saved using createFileAsync API with Document dir are showing up on user's device file manager app.
Is there any way to do it without ejecting expo?

Writing files to AWS Elastic Beanstalk

I have developed a web application with a Node.js backend on a local machine using Webstorm IDE. Among other things, the application creates a new unique folder and writes 7 javascript (.js) files to this folder during runtime each time a user requests a new account. Everything works properly in the local development environment.
When the application is uploaded and deployed to AWS Elastic Beanstalk, and a new user is requested though the application web page, I am receiving the following 404 (Not Found) error in the browser's Developer, JavaScript Console. The same error appears for each of the 7 files. The number 1541877962401 is the unique folder name generated by the application when a user requests a new account and user.js is one of the 7 javascript files copied to this newly created folder. savedUser is an existing folder in the file structure and is not created during runtime.
GET http://sowtest082-env.stsvxa672t.us-east-1.elasticbeanstalk.com/savedUser/1541877962401/user.js net::ERR_ABORTED 404 (Not Found)
I am guessing that the application does not have the correct permissions to create the folder and/or files in AWS?
Within the context of the Elastic Beanstalk environment, what is the best method to create a folder and copy javascript files to this folder during runtime? It is fairly easy to restructure the location of the folder and the files within it in the development environment so as to match the ASW EB environment. Reengineering the application to store the contents of these files in an AWS MySQL database engine would take a lot more work.
Bye the way, these 7 files are not tmp files and they are not config files...
Thanks...

drop wizard - web app directory & edit static files

I started app development with drop-wizard recently and a bit confusing how the whole thing works.
Where is the web app directory?
Is it possible to edit static files (JS, CSS) without needing to have a redeployment?
Thanks.
I have looked into this a bit more and will attempt to answer your questions:
Where is the web app directory
DW applications are not (meant as) web applications. They are deployed as an embedded system running a jetty embedded server and listening on some port(s). Having said that, there are certainly ways of packaging the application as a web application. (see link in comment)
Is it possible to edit static files (JS, CSS) without needing to have a redeployment? - Yes(ish)
This depends on you, really. There is a thing called an AssetBundle. These can be used to server static resources (from the classpath usually). This however is a mechanism you could use to implement your own AssetBundle that instead of serving files off the classpath, will serve files off the regular path.
Or, you could add your regular path to the classpath on startup so that the AssetBundle works.
Or, you could implement a ServletFilter for the AssetBundle (assets are not part of the jersey ecosystem) and implement your dynamic changes in the Filter.
Most of these will require restart for a reason or another. E.g.a custom implementation of a Filter obviously requires a redeploy. The Servlet returning assets also (I believe) employs a caching strategy that might require a restart (subject to your implementation).
For your UI: There is also a DW-views project that adds the ability to create views (with by default mustache templates) that can be powered from your application and served by the same REST endpoints.
Hope that helps,
After some more checking:
You can serve static resources from the file system and modify them as you go. They will be served correctly. How to do this:
Add an asset bundle with the resource path:
bootstrap.addBundle(new AssetsBundle("/assets2/", "/assets"));
This adds the root classpath resource assets2 and has it served statically from the endpoint assets.
The trick is that you have to add your file system location as a classpath resource. This can be done via arguments (or the classpath tab in the eclipse run configuration). You can google that relatively easy. However, you will have to remember that classpath resources behave differently from file system resources:
In my case I added to the classpath:
/home/artur/tmp/assets/
However, my Asset bundle serves from "assets2". Let's have a look at the file system:
artur#pandaadb:~/tmp/assets$ pwd
/home/artur/tmp/assets
artur#pandaadb:~/tmp/assets$ find .
.
./assets2
./assets2/test.txt
artur#pandaadb:~/tmp/assets$
So, in my file system location has been added as root, but assets are only served from the subfolder assets2
Now, all the resources that are located in assets2 can be modified at runtime and will be served by DW as a static resource.
Have fun playing around,
Artur

Linking JSLink from outside of SharePoint

I'm creating and app which adds text field with custom JSLink.
Everything works fine when I store js files in sharepoint library, but when I reference files which are store in the "app web" (site where the app has it services and sites), this .js files are not loaded. No error, just nothing happens.
How can I reference JSLink file which is out side of sharepoint library?
You can not to do it. Because SharePoint App has isolated architecture. Same situation with host web. You cannot set JSLink property on host web to link of JS file from App web.

List files in a remote folder given the URL

I have a questions, and I would love you to try to answer it.
Is it possible to get the list of files from a remote folder in java, knowing just the URL???
for example:
http://localhost/img get all the images names in this directory.
Thanks in advance
When you are talking about a remote folder, it depends on how you are accessing it.
If it is via a network share, such as \localhost\mypath AND you have access to browse the files, you will be able to do so, just like you would with a local directory.
However, if you are trying to browse a directory on a web server, the web server would have to give you directory browsing ability for you to work with it.