MozillaZine

c++ plugin debugging (no debug text)

Talk about add-ons and extension development.
kohedlo
 
Posts: 2
Joined: August 10th, 2017, 8:26 am

Post Posted August 10th, 2017, 8:38 am

greets. there case when i to struggle to create c++ dll firefox plugin.

for this i use:

plugin.cpp
plugin.h
npn_gate.cpp
npp_gate.cpp
np_entry.cpp
basic.rc

after succesfull compiling and building dll i receive "npbasic.dll"

after that i copy

copy /y "npbasic.dll" "C:\Documents and Settings\kohedlo3\Application Data\Mozilla\Plugins\npbasic.dll"
to firefox plugin directory.

after i run "npbasic.dll test.html" by this firefox 0.52 esr:
Code: Select all
<html>
<body>

<center><h1>Basic Plugin Example for Mozilla Test Case</h1></center>

This test case is to demonstrate the Basic Plugin example. You should see the
plugin window with the black frame aroung it and the browser user agent string
which plugin draws inside the window.
<br><br>

<center>
<embed type="application/basic-plugin" width=600 height=400>
</center>


<center><h1>7777777777777</h1></center>

</html>
</body>



in result shows window with activation plugin. in plugin manager is visible.

after activation no RESULTS.

I TRUE INSERT debug windows in c++ cole like this:

Code: Select all
NPError NS_PluginInitialize()
{



MessageBox(0,"NS_PluginInitialize","Ололо", MB_OK);

  return NPERR_NO_ERROR;
}


but after enabling plugin windows not occour. I cant be sure that procesess of plugin is works.

also inside function "static LRESULT CALLBACK PluginWinProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)"

changes for output log not occours.

HOW TO DEBUG this c++ code? whats wrong?

trolly
Moderator

User avatar
 
Posts: 39861
Joined: August 22nd, 2005, 7:25 am

Post Posted August 10th, 2017, 8:46 am

Basic debugging instructions:
Set a breakpoint in the initialization code of your DLL.
Start Firefox with the debugger attached.
If the breakpoint triggers then your DLL is loaded.
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.

kohedlo
 
Posts: 2
Joined: August 10th, 2017, 8:26 am

Post Posted August 11th, 2017, 2:06 pm

thanx. but i have no debugger. i practice only dialogbox output.

is strange that notworking this messages, thats puts in plugin.cpp class.

trolly
Moderator

User avatar
 
Posts: 39861
Joined: August 22nd, 2005, 7:25 am

Post Posted August 11th, 2017, 3:03 pm

Use OutputDebugString() and DbgView from Technet/Microsoft.
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 3 guests

cron