Hi all.
I'm sure it's a very stupid question, but I'm not able to find the answer.
I'm trying to write a plugin for NP++ in C++. I've dowloaded the "NppInsertPlugin.zip" (as suggested in "Plugins HOWTO", and I'm using the *.h files of that plugin.
If I try to compile this instruction: " SendMessage(nppData._nppHandle, NPPM_GETPLUGINSCONFIGDIR, MAX_PATH, (LPARAM)configPath);", my compiler (MS VC++ 8)issues an error: "error C2065: 'NPPM_GETPLUGINSCONFIGDIR' : undeclared identifier".
I suppose I have to include some file(s) in which all the NPPM_* are defined, but I don't know where to find it.
Can anyone help me, please?
TIA
GGa
P.S. please excuse me for bad english...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you, Harry.
But... in what file is the definition #define WM_DOOPEN (SCINTILLA_USER + 8) ?
Did you define it in your source file?
(In this case, how did you guess the "+8"?)
Or did you find it in a ".h" file you downloaded?
> To get the latest one, please have a look to the Common folder here:
> http://npp-plugins.cvs.sourceforge.net/npp-plugins/NppPlugins/
Well, I'm now using that files.
But I'm not still able to find "NPPM_DOOPEN".
Where can I find it? Did it change name?
GGa
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm a bit confused...
My question is: how do I tell to NP++ "please, open this file"?
NPPM_DOOPEN is mentioned in the "Plugins howto" page, but is not defined, and so causes an error (obviously).
I tried (trYed?) with WM_DOOPEN, and it causes the same error too, because is not defined. In which file do you have it defined?
BTW it seems to be "remembered" by Google's cache in the "Plugins howto" page. Was it an older name?!?
I tried with NPPM_RELOADFILE and NPPM_SWITCHTOFILE, but they don't work unless the file I want to open is already open (and it isn't, generally).
I tried so:
{
char xx[MAX_PATH];
GetModuleFileName(0, xx, MAX_PATH);
_execl(xx, xx, FileName);
}
but it causes an arror of "pure virtual function call" by NP++
Any suggestions? Where do I mistake?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Re-edit:
It works so:
{
char xx[MAX_PATH];
GetModuleFileName(0, xx, MAX_PATH);
_spawnl(_P_NOWAIT, xx, xx, filename, 0);
}
But it looks so strange.
I'm sure that there is a better way: there are NPPM_messages to do a lot of "advanced things"... there should be also one for a so simple task as "open a file", shouldn't it?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
its in ScintillaEditView.h, found in the scintillacomponent folder. One of the 2 defines is defined in resource.h in the main source folder of notepad++ but I merged it and modified it a bit to make it work for my plugin. You can retrieve the editoed file in the plugins CVS in FTP_synchronize/src/notepad_specific, although these 2 defines should do the job just fine
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all.
I'm sure it's a very stupid question, but I'm not able to find the answer.
I'm trying to write a plugin for NP++ in C++. I've dowloaded the "NppInsertPlugin.zip" (as suggested in "Plugins HOWTO", and I'm using the *.h files of that plugin.
If I try to compile this instruction: " SendMessage(nppData._nppHandle, NPPM_GETPLUGINSCONFIGDIR, MAX_PATH, (LPARAM)configPath);", my compiler (MS VC++ 8)issues an error: "error C2065: 'NPPM_GETPLUGINSCONFIGDIR' : undeclared identifier".
I suppose I have to include some file(s) in which all the NPPM_* are defined, but I don't know where to find it.
Can anyone help me, please?
TIA
GGa
P.S. please excuse me for bad english...
Thank you, Harry.
But... in what file is the definition #define WM_DOOPEN (SCINTILLA_USER + 8) ?
Did you define it in your source file?
(In this case, how did you guess the "+8"?)
Or did you find it in a ".h" file you downloaded?
I looked in all the .h files downloaded from http://npp-plugins.cvs.sourceforge.net/npp-plugins/NppPlugins/ and did not find "WM_DOOPEN".
GGa
This plugin has not the latest file versions. To get the latest one, please have a look to the Common folder here:
http://npp-plugins.cvs.sourceforge.net/npp-plugins/NppPlugins/
Best Regards
Jens
Thank you very much, Jens :)
May I suggest to add that link in the "Plugins HOWTO" page?
Maybe it could be useful for someone like me (?)
(forgot the signature)
GGa (the same "anonymous" of the starting post).
Thanks again.
Another problem...
> To get the latest one, please have a look to the Common folder here:
> http://npp-plugins.cvs.sourceforge.net/npp-plugins/NppPlugins/
Well, I'm now using that files.
But I'm not still able to find "NPPM_DOOPEN".
Where can I find it? Did it change name?
GGa
I think you need WM_DOOPEN, afaik NPPM_DOOPEN does not exist. I use the common folder aswell so I'm pretty sure thats it.
I'm a bit confused...
My question is: how do I tell to NP++ "please, open this file"?
NPPM_DOOPEN is mentioned in the "Plugins howto" page, but is not defined, and so causes an error (obviously).
I tried (trYed?) with WM_DOOPEN, and it causes the same error too, because is not defined. In which file do you have it defined?
BTW it seems to be "remembered" by Google's cache in the "Plugins howto" page. Was it an older name?!?
I tried with NPPM_RELOADFILE and NPPM_SWITCHTOFILE, but they don't work unless the file I want to open is already open (and it isn't, generally).
I tried so:
{
char xx[MAX_PATH];
GetModuleFileName(0, xx, MAX_PATH);
_execl(xx, xx, FileName);
}
but it causes an arror of "pure virtual function call" by NP++
Any suggestions? Where do I mistake?
EDIT: _execl wants a null argument at the end... but it is the same :(
Re-edit:
It works so:
{
char xx[MAX_PATH];
GetModuleFileName(0, xx, MAX_PATH);
_spawnl(_P_NOWAIT, xx, xx, filename, 0);
}
But it looks so strange.
I'm sure that there is a better way: there are NPPM_messages to do a lot of "advanced things"... there should be also one for a so simple task as "open a file", shouldn't it?
Code snippet of mine:
char * fileNameA = new char[MAX_PATH];
//do stuff with filename
SendMessage(nppData._nppHandle,WM_DOOPEN,0,(LPARAM)fileNameA);
WM_DOOPEN is for me defined as
#define WM_DOOPEN (SCINTILLA_USER + 8)
which needs
#define SCINTILLA_USER (WM_USER + 2000)
WM_USER is in windows.h
its in ScintillaEditView.h, found in the scintillacomponent folder. One of the 2 defines is defined in resource.h in the main source folder of notepad++ but I merged it and modified it a bit to make it work for my plugin. You can retrieve the editoed file in the plugins CVS in FTP_synchronize/src/notepad_specific, although these 2 defines should do the job just fine
So, it's in the sources of NP++. I was searching in the wrong place...
Thanks again for the information.
You were very kind.
GGa.