Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Being a newbie to making browser plugins, I'm making a firebreath based plugin which adds two integers. I'm debugging the plugin by attaching the source to the browser. I'm getting the above exception at this step of my PLUGINAPI.cpp I have created and built the dll of the wrapper and the c# class libraries. it's working..added the project references of these to my firebreath api project. In PLUGINAPI project>>

C++
int PLUGINAPI::PerformAddition(int a, int b)
{
    IWrapIt *wrapIt=IWrapIt::CreateInstance();
    HWND handler=getPlugin()->AttachedWindow;
    wrapIt->SetHandle(handler);//ABOVE EXCEPTION RAISED HERE
    return wrapIt->PerformAddition(a,b);
}
In PLUGIN.cpp(window attached event)>>

 bool PLUGIN::onWindowAttached(FB::AttachedEvent *evt, FB::PluginWindow * wnd)
{
    // The window is attached; act appropriately
    AttachedWindow = wnd->get_as<fb::pluginwindowwin xmlns:fb="#unknown">()->getHWND();
    return false;
}

What am I doing wrong here? Also My debug point in c# class library is not hit even if i have set the Property of the firebreath (unmanaged c++) debugging to mixed
Posted
v2
Comments
Richard MacCutchan 20-May-13 5:23am    
You need to add some error checking in your code to ensure that your references actually contain something. The line IWrapIt *wrapIt=IWrapIt::CreateInstance(); could fail, but you have not tested the return value, to see if that is so. The same could be true of the next line, so your handler could be null or garbage.

1 solution

In such cases the most common issue is, that the handle is NOT a valid handle for that IWrapIt interface.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900