Git Product home page Git Product logo

Comments (9)

Gargaj avatar Gargaj commented on August 26, 2024

https://github.com/Gargaj/fwzSetup/blob/master/main.readme.cpp should provide you a good enough example; basically you set the values before the function call to set the "defaults", then call the function to pop the dialog with those values, and then the struct will contain the values the user selected.

from fwzsetup.

pkanyuk avatar pkanyuk commented on August 26, 2024

Thanks for the reply, I appreciate the help!

Gotcha, I did follow the steps in main.readme.cpp and that's roughly what i was expecting. Unfortunately I don't see a dialog popup and the code seemly proceeds. Should the program lock until the dialog pops up or do I need to loop until a certain condition is met?

I suspect the problem may also be in the windowing boiler plate I'm using based on https://github.com/anttihirvonen/demoscene-starter-kits/blob/master/windows/Windows1k_OpenGL/1kogl/main.cpp#L53 . That's why I'm curious if you could provide a few more lines in main.readme.cpp which shows how the values set by the dialog are used to create a new window.

Thanks!
-- Paul

from fwzsetup.

Gargaj avatar Gargaj commented on August 26, 2024

Did you add the .rc file into your solution?

from fwzsetup.

pkanyuk avatar pkanyuk commented on August 26, 2024

Yup, I'm using Visual Studio and I have the FWZ.rc file under Resources Files, and resource.h under the headers. I don't know Visual Studio very well, but it seems like that's what's required

from fwzsetup.

Gargaj avatar Gargaj commented on August 26, 2024

Hmf, that's a good question then, OpenSetupDialog should pop the dialog no matter what you pass it as long as it's "relatively" correct.

Does execution stop when you hit that line or does it just pass through without popping a dialog?

from fwzsetup.

pkanyuk avatar pkanyuk commented on August 26, 2024

Execution does not stop when it hits the line:

if (!OpenSetupDialog(&setup)) return -1;

If I simply use "return -1;", then execution will stop, so OpenSetupDialog is being called. I wonder though about some visual studio misconfiguration silently allowing this to fail. I should probably start from a blank solution to rule out something about the one I inherited from

https://github.com/anttihirvonen/demoscene-starter-kits/blob/master/windows/Windows1k_OpenGL/1kogl/main.cpp

Thanks,
-- Paul

from fwzsetup.

Gargaj avatar Gargaj commented on August 26, 2024

If it's an 1k thing then it's possible that resources get optimized out; so yeah, blank solution recommended and then move stuff over slowly :)

from fwzsetup.

pkanyuk avatar pkanyuk commented on August 26, 2024

Yup, it's something about the 1k project. In a blank solution, your code works great, so I know where to look now for the issue. The only things I needed to change were replacing _snprintf with _snprintf_s and giving char s[500] a different variable name to appease some build errors.

Sorry about the false alarm, thanks for helping me debug!

from fwzsetup.

Gargaj avatar Gargaj commented on August 26, 2024

What I'd check is whether in the optimized solution, the resources actually end up in the executable - for example, I assume if the 1k solution uses Crinkler to compress in the post-build step, then they get stripped out because generally there's no use for them in 1k.

from fwzsetup.

Related Issues (1)

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.