Git Product home page Git Product logo

Comments (4)

tsunamistate avatar tsunamistate commented on April 28, 2024

Further investigation showed that the problem is in osinterface.c:

char* osinterface_open_directory_browser(char *title) {
    BROWSEINFO      bi;
    char            pszBuffer[MAX_PATH];
    LPITEMIDLIST    pidl;
    LPMALLOC        lpMalloc;

    // Initialize COM
    if (CoInitializeEx(0, COINIT_APARTMENTTHREADED) != S_OK) {
        MessageBox(NULL, _T("Error opening browse window"), _T("ERROR"), MB_OK);
        CoUninitialize();
        return 0;
    }

Where if statement for initializing COM fails

from openrct2.

IntelOrca avatar IntelOrca commented on April 28, 2024

Are you able to find out why it fails?

from openrct2.

tsunamistate avatar tsunamistate commented on April 28, 2024

Unfortunately, I have no idea how to trace it further, because I'm complete n00b in C. Just happened to get such a bug and reported it.
Have you been able to reproduce it?

from openrct2.

DutchRPW avatar DutchRPW commented on April 28, 2024

CoInitializeEx seems to be called somewhere else first and hence results S_FALSE instead of S_OK as per http://msdn.microsoft.com/en-us/library/windows/desktop/ms695279%28v=vs.85%29.aspx. This is no problem, but the return value check is too strict.

Changing

CoInitializeEx(0, COINIT_APARTMENTTHREADED) != S_OK

to

!SUCCEEDED(CoInitializeEx(0, COINIT_APARTMENTTHREADED))

solves the issue.

from openrct2.

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.