You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When exploring #58 with VS2022,I noticed that filepath is empty in windows.cpp.
Since filepath is declared in clipboard.hpp as a static variable, then each compilation unit that includes this header will have its own copy of this variable. Some of them may be initialized correctly, some may not.
In windows.cpp, these two places will reference filepath:
because clipboard.cpp and windows.cpp are two compilation units, filepath referenced by these two places in windows.cpp is still uninitialized. As a result:
First, add copy $(TargetPath) to Command Arguments:
Then step into setWindowsClipboardDataFiles or setWindowsClipboardDataPipe, and dump the value of filepath.main and address of filepath.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
Hi! @Slackadays Instead of screenshots, I made a short video to demonstrate the issue. And the reason I did not take screenshots is once I started to debugging Clipboard with VS2022, the Print Scrn key won't work any more.
Describe the bug
When exploring #58 with VS2022,I noticed that
filepath
is empty inwindows.cpp
.Since
filepath
is declared inclipboard.hpp
as a static variable, then each compilation unit that includes this header will have its own copy of this variable. Some of them may be initialized correctly, some may not.In
windows.cpp
, these two places will referencefilepath
:Clipboard/src/clipboard/src/windows.cpp
Line 140 in 9ee091f
Clipboard/src/clipboard/src/windows.cpp
Line 196 in 9ee091f
Though
filepath
is initialized inclipboard.cpp
:Clipboard/src/clipboard/src/clipboard.cpp
Line 891 in 9ee091f
because
clipboard.cpp
andwindows.cpp
are two compilation units,filepath
referenced by these two places inwindows.cpp
is still uninitialized. As a result:will raise an exception(File not Found).
To Reproduce
First, add
copy $(TargetPath)
toCommand Arguments
:Then step into
setWindowsClipboardDataFiles
orsetWindowsClipboardDataPipe
, and dump the value offilepath.main
and address offilepath
.Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
Hi! @Slackadays Instead of screenshots, I made a short video to demonstrate the issue. And the reason I did not take screenshots is once I started to debugging
Clipboard
with VS2022, the Print Scrn key won't work any more.https://drive.google.com/file/d/1cChilbVmh1uqt4OUv-_a3JDdbsij2cxu/view?usp=sharing
Additional context
Add any other context about the problem here.
Before you post
Please make sure you check previous bug reports before filing a new one.
This will help keep the Issues section less cluttered. :)
The text was updated successfully, but these errors were encountered: