Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » U++ community news and announcements » 2022.3rc5
Re: 2022.3rc4 [message #59426 is a reply to message #59424] Sat, 24 December 2022 13:13 Go to previous messageGo to previous message
Klugier is currently offline  Klugier
Messages: 1076
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Lindquist and Mirek,

Thank you for raising this issue! I confirm that this issue is critical in the context of release. It is with us since 2022.1 when we introduced wchar that is 4 bytes length. The problem is that winapi requires 2 bytes instead of 4 bytes. The problem is with AppendFiles:
void AppendFiles(VectorMap<String, ClipData>& clip, const Vector<String>& files)
{
	WString wfiles;
	for(int i = 0; i < files.GetCount(); i++)
		wfiles << files[i].ToWString() << (wchar)0;
	sDROPFILES h;
	h.unicode = true;
	h.offset = sizeof(h);
	GetCursorPos(&h.pt);
	h.nc = TRUE;
	String data;
	data.Cat((byte *)&h, sizeof(h));
	data.Cat((byte *)~wfiles, 2 * (wfiles.GetCount() + 1)); // Windows wants 2 bytes unicode string instead of 4 bytes we are providing
	clip.GetAdd("files") = ClipData(data);
}


Mirek, you should be able to propose the best solution here since you know the WString 4 bytes internals very well. I would opt for something like using ToSystemCharset on files to make sure that we have proper encoding.

The bug can be reproduce with reference/DropFiles example. In this case you can not drop files from the window.

The issue is only reproduce on Windows.

Klugier


U++ - one framework to rule them all.

[Updated on: Sat, 24 December 2022 13:14]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ide insert data/timestep/GUID
Next Topic: clang-format integration
Goto Forum:
  


Current Time: Mon May 13 04:56:47 CEST 2024

Total time taken to generate the page: 0.02583 seconds