8000 ToastCore在64位运行时引发闪退 · Issue #1 · Y-Theta/ToastHelper · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ToastCore在64位运行时引发闪退 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
LeoChen98 opened this issue Dec 25, 2019 · 7 comments
Open

ToastCore在64位运行时引发闪退 #1

LeoChen98 opened this issue Dec 25, 2019 · 7 comments

Comments

@LeoChen98
Copy link

如题,暂时没找到问题原因

@LeoChen98
Copy link
Author

更新,单步发现程序在执行

public void Dispose() {
            PropVariantClear(this);
            GC.SuppressFinalize(this);
}

时退出。

/// <summary>
        /// 创建快捷方式
        /// </summary>
        private static void CreatShortcut<T>(string shortcutPath) {

            String exePath = Process.GetCurrentProcess().MainModule.FileName;
            IShellLinkW newShortcut = (IShellLinkW)new CShellLink();

            ErrorHelper.VerifySucceeded(newShortcut.SetPath(exePath));

            IPropertyStore newShortcutProperties = (IPropertyStore)newShortcut;

            using (PropVariant appId = new PropVariant(_aumid)) {
                ErrorHelper.VerifySucceeded(newShortcutProperties.SetValue(new PropertyKey(TOAST_G, 5), appId));
            }

            using (PropVariant toastid = new PropVariant(typeof(T).GUID))  {
                ErrorHelper.VerifySucceeded(newShortcutProperties.SetValue(new PropertyKey(TOAST_G, 26), toastid));
            }
            ErrorHelper.VerifySucceeded(newShortcutProperties.Commit());

            // Commit the shortcut to disk
            IPersistFile newShortcutSave = (IPersistFile)newShortcut;

            ErrorHelper.VerifySucceeded(newShortcutSave.Save(shortcutPath, true));
        }

的调用

@LeoChen98
Copy link
Author

执行这一句的时候程序闪退:PropVariantClear(this);

@LeoChen98
Copy link
Author

测试发现不新建快捷方式就不会出现问题,而且推送Toast时快捷方式非必须。

@LeoChen98
Copy link
Author

目前还没有找到PropVariantClear引发x64闪退的原因。

@LeoChen98
Copy link
Author

更新:注释掉创建快捷方式后推送Commands不被识别,所以依然要想办法解决前面的问题

@LeoChen98
Copy link
Author
LeoChen98 commented Dec 25, 2019

PropVariantClear执行时引发了clr.dllBEX64错误

@LeoChen98
Copy link
Author

ToastHelperTest里x64测试正常,但是移植后出现该问题,现在通过注释PropVariantClear并维护ToastManager为单实例实现了功能并暂时解决了问题,但仍然不清楚导致闪退的原因。

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

No branches or pull requests

1 participant
0