Getting encoding in x64 plugin
-
Hi,
I’m trying to get the current document encoding by using NPP message NPPM_GETBUFFERENCODING, but I cannot make it work. My code is following:
int bufferid = ::SendMessage(nppData._nppHandle, NPPM_GETCURRENTBUFFERID, 0, 0); LRESULT res = ::SendMessage(nppData._nppHandle, NPPM_GETBUFFERENCODING, bufferid, 0);The code compiles well but on runtime, NPP crashes with following error, pointing on second line of above code (tested by running NPP and plugin in debug mode):
Exception levée à 0x00007FF7929A6061 dans notepad++.exe : 0xC0000005 : Violation d’accès lors de la lecture de l’emplacement 0x000000003AC89F1C.
Le programme ‘[2312] notepad++.exe’ s’est arrêté avec le code 0 (0x0).Did anyone already experienced and solved this ?
Thanks -
Try making
bufferidan LRESULT instead of an int. It may be that it is getting downcasted (though you should get a compiler warning). -
Hi @dail, thanks for your answer, it solved my issue :D
-
G gstavi referenced this topic on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login