Giter Club home page Giter Club logo

Comments (12)

Delta456 avatar Delta456 commented on August 16, 2024

What code had you opened when you were trying to use vls?

from vls.

alextwothousand avatar alextwothousand commented on August 16, 2024

A fresh project with a lot of Win API interaction.
Do you need a code sample?

from vls.

alextwothousand avatar alextwothousand commented on August 16, 2024
module main

#flag windows -DWIN32_LEAN_AND_MEAN
#include <windows.h>

type HWND = voidptr
type DWORD = u32

type WPARAM = u64
type LPARAM = i64

type LONG = int
type UINT = u32

// https://docs.microsoft.com/en-us/windows/win32/api/windef/ns-windef-point
struct POINT {
	mut:
	x LONG
	y LONG
}

// https://docs.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-msg
struct MSG {
	mut:
	hwnd 		HWND
	message 	DWORD
	wParam 		WPARAM
	lParam 		LPARAM
	time		DWORD
	pt			POINT
	lPrivate 	DWORD
}

// BOOL RegisterHotKey(HWND hWnd, int  id, UINT fsModifiers, UINT vk);
fn C.RegisterHotKey(HWND, int, UINT, UINT) bool

// BOOL GetMessage(LPMSG lpMsg, HWND  hWnd, UINT  wMsgFilterMin, UINT  wMsgFilterMax);
fn C.GetMessage(MSG, HWND, UINT, UINT) bool

// void * memset ( void * ptr, int value, size_t num );
fn C.memset(voidptr, int, size_t) voidptr

fn main() {
	if !C.RegisterHotKey(C.NULL, 1, C.MOD_ALT, `b`) {
		println("Register Hotkey is invalid")
		return
	}

	msg := MSG{}

	for !C.GetMessage(&msg, C.NULL, 0, 0) {
		if msg.message != C.WM_HOTKEY {
			continue
		}

		println("Hotkey clicked!")
	}
}

from vls.

nedpals avatar nedpals commented on August 16, 2024

This and #89 are really hard to debug where to locate the offending function without the backtraces implemented other than TCC.

@alextwothousand can you try recompile VLS without -prod? Thanks

from vls.

alextwothousand avatar alextwothousand commented on August 16, 2024

This and #89 are really hard to debug where to locate the offending function without the backtraces implemented other than TCC.

@alextwothousand can you try recompile VLS without -prod? Thanks

I wasn't explicitly compiling with -prod.

Here is what I was doing to compile my program.

v -cc msvc main.v

from vls.

nedpals avatar nedpals commented on August 16, 2024

@alextwothousand I see. Can you recompile VLS using TCC (without specifying -prod or -cc flags) then? I meant that because compiling programs using the TCC compiler can produce backtraces and it's the only supported right now in V. I want to find out what made the VLS to trigger the get_type_symbol panic.

from vls.

alextwothousand avatar alextwothousand commented on August 16, 2024

I will give this a go at the earliest convenience.

from vls.

nedpals avatar nedpals commented on August 16, 2024

@alextwothousand It might be a Windows issue but the above code works fine on Linux.
@danieldaeschle If you have the time, can you diagnose this issue?

from vls.

alextwothousand avatar alextwothousand commented on August 16, 2024

I can attempt to try it in Linux? What distribution are you running— just for reference?

The fact that it's a Windows only issue is... interesting.

from vls.

nedpals avatar nedpals commented on August 16, 2024

I can attempt to try it in Linux? What distribution are you running— just for reference?

The fact that it's a Windows only issue is... interesting.

It is interesting. My distro is Ubuntu 20.04 64-bit

from vls.

alextwothousand avatar alextwothousand commented on August 16, 2024

I can attempt to try it in Linux? What distribution are you running— just for reference?

The fact that it's a Windows only issue is... interesting.

It is interesting. My distro is Ubuntu 20.04 64-bit

OK. I will attempt to reproduce this either on Fedora or Arch.

from vls.

nedpals avatar nedpals commented on August 16, 2024

Closing this as it is not applicable anymore to the current version of VLS.

from vls.

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.