Forum Guidelines

This forum is for finished source code that is working properly. If you have questions about this or any other source code, please post it in one of the Discussion Forums, not here.
See more
See less

Convert VS resource.h files

  • Filter
  • Time
  • Show
Clear All
new posts

  • Convert VS resource.h files


    I thought I should post this little snippet because all of you
    have given me so much advice and help in the past. I wrote this
    with PBDOS but it should be easy to convert to PBDLL/CC. This
    will convert most "resource.h" files from VisualStudio to a PBDLL
    "" file.

    rem Convert VisualStudio resource.h files
    dim Source as string
    dim Target as string
    dim Buffer as string
    if command$ = "" then
        print "usage: makinc [resource.h]"
    end if
    Source = command$
    Target = command$
    replace ".h" with ".inc" in Target
    open Source for input as #1
    open Target for output as #2
    do until eof(1)
        line input #1,Buffer
        replace "//" with "rem //" in Buffer
        replace "#ifdef " with "#if %def(%" in Buffer
        replace "#ifndef " with "#if not %def(%" in Buffer
        replace "#define " with "%" in Buffer
        replace "%_" with "%" in Buffer
        replace " 0" with "= 0" in Buffer
        replace " 1" with "= 1" in Buffer
        replace " 2" with "= 2" in Buffer
        replace " 3" with "= 3" in Buffer
        replace " 4" with "= 4" in Buffer
        replace " 5" with "= 5" in Buffer
        replace " 6" with "= 6" in Buffer
        replace " 7" with "= 7" in Buffer
        replace " 8" with "= 8" in Buffer
        replace " 9" with "= 9" in Buffer
        if instr(Buffer,"%def(%") then Buffer = Buffer + ")"
        print #2, Buffer
    I think i'm going to make another conversion utility that will
    shell "rc.exe" and "pbres.exe" to completely convert the
    VisualStudio resource combo.

    If you want a precompiled EXE please send me an email...

    email: mark.s[email protected]