Menu

C++ Builder plugin

Redax
2007-01-29
2012-11-14
  • Redax

    Redax - 2007-01-29

    Hi,
    I'm developing a new plugin in C++Builder. First of all I have translated the sample plugin and it seems to work, but I have a problem: when I close Notepad++, it generates an exception. I see it only when I run the plugin from the compiler to debug my code, not when I run it in a "stand alone" mode.

    My question: I suspect that the problem is in the calling convention of some function. Con you confirm this? Can you run n++ in debug mode and tell me if you can see on close an exception in a line of code in n++? or you can see only a generic exception like "Access violation ..." ? Or may be you don't see any exception?

    OK! I know! Ofcorse you have to watch my plugin and/or my code BEFORE you can tell anything: how can I send them to you?

    I hope you are interested in my little problem, so I thank you by now.

    Fabio

     
    • DV

      DV - 2007-02-02

      BTW, Chris, how did you build your .dll within MiniGW? By default MiniGW compiler/linker options, such .dll files are incompatible with Notepad++. How did you solve it?

       
    • DV

      DV - 2007-01-30

      If your plugin is compatible with Notepad++ 3.9, I can try it (sources of ver. 3.9 is under VC++ 2003, but ver. 4.0 is under VC++ 2005). You can send your files to dvv81 (at) ukr (dot) net.

       
    • Chris Severance

      Chris Severance - 2007-02-02

      Use the .h files from my NPPTextFX plugin where I have strictly defined everything. If you have messed up a calling convention a compile time error will be generated.

       
    • Chris Severance

      Chris Severance - 2007-02-02

      The complete NPPTextFX sources are all available from Don's download page. It's in there.

      The MinGW header files fail to force DllMain to be extern "C". This is not a problem when compiling as a C source but as a C++ source your MinGW DLL will not be compatible because your DllMain has the C++ mangled name and will never be called. The library default DllMain will be used instead which is not sufficient. I set my headers up to automatically fix as many problems as possible for all the compilers I use.

      NPPTextFX: PluginInterface.h
      /* This .h file is tested to be compatible with
           MinGW32/GCC 3.44
           Microsoft Visual C++ Toolkit 2003 + Platform SDK
           Microsoft Visual C++ 2005 Express Edition + Platform SDK
           Borland C++ 5.51
           Digital Mars 847
           OpenWatcom 1.4
           Pelles C 4.0
           Bloodshed Dev-C++ IDE
           Code::Blocks IDE
         for both .C and .CPP sources */
      extern "C" BOOL APIENTRY DllMain(HINSTANCE,DWORD,LPVOID);