Coder Social home page Coder Social logo

Comments (2)

Kawa-oneechan avatar Kawa-oneechan commented on September 1, 2024

I may have been a bit over-eager when I found out where MFC lists get their starting contents from. Version Detection has a lot of dropdown combo boxes, so there's a lot of places I can mess up. Fortunately, it seems it's only Version Detection I need to doublecheck.

The problem is this: MFC uses DLGINIT resources to fill in list contents, with its own weird little format. In the .rc file, this format is rather unreadable with the actual text strings encoded as a series of integers..

IDD_DIALOGVERSION DLGINIT
BEGIN
    IDC_COMBO1, 0x403, 4, 0
0x4745, 0x0041,
    IDC_COMBO1, 0x403, 6, 0
0x4756, 0x2041, 0x0031,
    IDC_COMBO1, 0x403, 8, 0
0x4756, 0x2041, 0x2e31, 0x0031,
//etc...
    0
END

You'll note that EGA is 0x45 0x47 0x41, plus the terminating null.
Something much more readable would be

IDD_DIALOGVERSION DLGINIT
BEGIN
    IDC_COMBO1, 0x403, 4, 0, "EGA\0"
    IDC_COMBO1, 0x403, 6, 0, "VGA 1\0"
    IDC_COMBO1, 0x403, 8, 0, "VGA 1.1\0"
//etc...
    0
END

(Unfortunately, the "\0" is required -- using a bare "EGA" would store only three characters, and "EGA" 0 would store two nulls as a short and throw off the format.)

And throwing off the format is what happened here: I accidentally specified a six-character string but only wrote "VGA\0", which is four.

from scicompanion.

codengine avatar codengine commented on September 1, 2024

It seems to work now, thanks!

from scicompanion.

Related Issues (17)

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.