Giter Club home page Giter Club logo

Comments (7)

sskodje avatar sskodje commented on August 31, 2024

Sounds like a problem with write access. Does it happen if you run it as administrator?

from screenrecorderlib.

FoxPride avatar FoxPride commented on August 31, 2024

I had same issue and run as administrator doesn't help.
My case:

  1. if I run program in debug mode from Visual studio then everything is OK and I can record video
  2. if I run program from debug\release folder directly then I get error from "utilities.h -> static bool CreateAllDirs(std::wstring path) -> BOOL result = CreateDirectory(path.substr(0, pos).c_str(), nullptr);" BUT if I use record to stream checkbox then everything is OK again
  3. if I deploy program with wix installer then install it then everything is OK again...

Once I faced this error in Visual studio debugging mode. I tried different settings for project and when I changed Windows SDK version back and forth then magically error disappeared and now I have only case №2 left.
The thing is that most of our users not facing this error but around 1 from 10000 gets it and I have no idea why.

from screenrecorderlib.

sskodje avatar sskodje commented on August 31, 2024

This is really weird. I don't understand why Directory.CreateDirectory from c# and CreateDirectory from c++ should behave differently. I pushed commit 3056ea7 where i replaced CreateDirectory with std::filesystem::create_directories, and also made it print the error message in the error return. Please test it and see if it fixes your issue.

from screenrecorderlib.

FoxPride avatar FoxPride commented on August 31, 2024

Just tested it, works like a charm in any case from above.
One note: std::filesystem::create_directories(directory, ec) returns false if directory already exists so I changed code a bit.

from screenrecorderlib.

FoxPride avatar FoxPride commented on August 31, 2024
	std::error_code ec;
	if (std::filesystem::exists(directory))
	{
		LOG(L"output folder is already exists");
		m_OutputFolder = directory;
	}
	else
	{
		if (std::filesystem::create_directories(directory, ec))
		{
			LOG(L"output folder is ready");
			m_OutputFolder = directory;
		}
		else
		{
			// Failed to create directory.
			ERR(L"failed to create output folder");
			if (RecordingFailedCallback != nullptr)
				RecordingFailedCallback(L"Failed to create output folder: " + utilities::s2ws(ec.message()));
			return E_FAIL;
		}
	}

from screenrecorderlib.

sskodje avatar sskodje commented on August 31, 2024

Ah.. Thanks for the heads up. I'll push a new release with the changes then.

from screenrecorderlib.

sskodje avatar sskodje commented on August 31, 2024

Fixed with c37cd96

from screenrecorderlib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.