Skip to content

Conversation

@hwoy
Copy link

@hwoy hwoy commented Jan 4, 2023

modified:   README.md
modified:   examples/basewin.zig
modified:   examples/helloworld-window.zig
modified:   src/genzig.zig
modified:   src/zig.zig

	modified:   README.md
	modified:   examples/basewin.zig
	modified:   examples/helloworld-window.zig
	modified:   src/genzig.zig
	modified:   src/zig.zig
@hwoy
Copy link
Author

hwoy commented Jan 4, 2023

FIXED: building was not successfully!!!
FIXED: example-> add win32.LoadCursor(null,win32.IDC_ARROW)

@marler8997
Copy link
Collaborator

Thanks for the contribution. Could you remove any formatting changes you've made to make it easier to review the logic/behavior changes?

	modified:   examples/basewin.zig
	modified:   examples/helloworld-window.zig
	#modified:   src/genzig.zig

## How to generate the Windows Zig bindings

First, clone the zigwin32 repo from the root of this repository to provide a location for the generated files:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these changes to the README are correct. Here's how you could build zigwin32gen from scratch:

$ git clone https://github.com/marlersoft/zigwin32gen
$ cd zigwin32gen
$ git clone https://github.com/marlersoft/zigwin32
# NOTE if you forget to run the command above, the error message will explain you haven't cloned the zigwin32 repo
$ zig build -Dfetch
# Adding the -Dfetch will cause the build to fetch the win32json repo for you (the error message you get explains this)

Lately I've been realizing that requiring the -Dfetch option for dependencies is a bit annoying, maybe I'll change it so it's not required.

@marler8997
Copy link
Collaborator

I think you may have run into build issues because your zig compiler is a little old. When I build this branch with the latest Zig I get compile errors because I think you reverted some of the code to use an older version of the std library/compiler.

@hwoy
Copy link
Author

hwoy commented Jan 5, 2023

I think zigwin32 is generated by genzig using win32json database.

@marler8997
Copy link
Collaborator

I think zigwin32 is generated by genzig using win32json database.

That's correct. The build automatically downloads the win32json database (you just have to provide it with -Dfetch). The error message you get when you don't provide that option explains it.

@hwoy
Copy link
Author

hwoy commented Jan 5, 2023

zig version 0.10.0 x86_64 windows

I have no reason to clone zigwin32 when it is generated from win32json.

I am a new in ziglang.
I like to see WINAPI in ziglang.

@marler8997
Copy link
Collaborator

You might be interested in a talk I did on this project: https://www.youtube.com/watch?v=HsnWZxrf5VE

More towards the end of the video I show a couple projects that use zigwin32 which might help you use it in your own projects. Most people don't need to worry about this repo zigwin32gen because it's only purpose is to output the full win32 bindings in the zigwin32 repo (see https://github.com/marlersoft/zigwin32).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants