IRC Log Viewer » #firebreath » 2013-03-30

IRC Nick Time (GMT-7) Message
SinnerSmile 14:03 Good day/night gentlemen!
taxilian 14:03 g'morning
SinnerSmile 14:03 morning? ok (got night here).
taxilian 14:03 it's morning somewhere
SinnerSmile 14:03 No doubt
Well, taxilian, bout my hwnd problem...
I dig into classes pointers etc etc and got some fresh answer on overflow, pls look at it, as u can get it from my comments to last answer the problem is, that getPlugin() function not found, well, don't you know why?
can it be related to the fact that o choose windowless plugin on creating via fbgen and there is just impossible to get browser window thru plugin window's ancestor?
taxilian 14:03 where are you trying to use the getPlugin method? it's not a global function, it's one that is in your jsapi object
actually it is quite possible that a windowless plugin can't get the ancestor
I don't really know since I've never tried
but that's not your issue; your issue seems to be that you don't understand scope
SinnerSmile 14:03 well, i'm trying to use it exact the same way as it in sample code in last answer
taxilian 14:03 that might be another issue you'll have, though
the sample code in the last answer will only work inside your API object
if you're in the main plugin object ( the one that extends PluginCore) you don't need getPlugin()
SinnerSmile 14:03 ok then what this getPlugin() does? What it returns or whatever
taxilian 14:03 in your directory you should have a file that is something like MyPluginAPI.h
it's in there
(MyPlugin will be whatever you named your plugin)
SinnerSmile 15:03 The thing it that it isnt there. im using this code with corrected object direction (TestPluginAPI::getBrowserHwnd() ) in my case, but nothing still.
checked TestPluginAPI.h manualy, yes TestPluginPtr getPlugin(); string is here...
I'm trying to write this function without any my custom objects or classes or whatewer, just near that simple echo function in TestPluginAPI.cpp
It seems that I'm loosing something so obvious, that it annoys me.
taxilian 15:03 you cannot use it as static
calling TestPluginAPI::getBrowserHwnd() will never work
you really really need to understand the difference between static and instance
you can't call instance methods from a static function
if you want you can throw your code in a gist and I'll see if I can find a better way to explain
SinnerSmile 15:03 ok, give me a moment, i will.
Only my API.cpp and API.h files?
taxilian 15:03 unless there is code in other files that you've changed that you think might matter
SinnerSmile 15:03
taxilian 15:03 okay, in C++ you don't ever call a function with Object::functionName() unless it is actually a static function
so line 32 of the .cpp file? makes no sense
that should just be getBrowserHwnd()
Problem #2: PosTest is not a member of TestPluginAPI, thus it cannot call getBrowserHwnd
you have written it "FB::variant PosTest()" hwich creates a new function. it should be "FB::variant TestPluginAPI::PosTest()"
SinnerSmile 15:03 Yes the last one just a simple mistake, but what about HWND TestPluginAPI::getBrowserHwnd() {...} part
taxilian 15:03 the last one is probably the reason it isn't working
that I have no idea; it seems reasonable
and the other issue is that you didn't add getBrowserHwnd to your class definition
if you'll forgive me saying so, these are really, really basic C++ mistakes; you really need to learn the language better. If you're getting compiler errors it's almost definitely not going to be firebreath related, it's most likely something like this where you've left something out
SinnerSmile 15:03 C2039 getBrowserHwnd : is not a member of TestPluginAPI and those 2 mistakes.
taxilian 15:03 getBrowserHwnd *isn't* a member of TestPluginAPI
you never added it to the class definition
SinnerSmile 16:03 And you are absolutely right bout my language knowlege/ Im trying to learn it on the run the same time as making my plugin. And i'm a shame that im bothering u with such a things. But sometimes I'm just strucking on something, that I can't find a way to make it work or even find why it isn't working.
taxilian 16:03 here is a tip: read the compiler warning. In this case, it told you exactly what the problem was
you just didn't look at it hard enough to understand what it meant
SinnerSmile 16:03 I never thought that i need to add it manualy, isn't it a firebreath function? I thought im just describing already defined function.
taxilian 16:03 getBrowserHwnd is not a firebreath function
it's a function you added
firebreath doesn't write c++ code for you
SinnerSmile 16:03 Ok, just add "HWND getBrowserHwnd();" in API.h right?
taxilian 16:03 in the cclass definition in your API.h file, yes
SinnerSmile 16:03 error LNK2019 unresolved external symbol "public: int __stdcall TestPluginAPI::GetWindowRect(struct HWND__ *,struct tagRECT *)" ([email protected]@@[email protected]@[email protected]@@Z) в функции "public: class FB::variant __thiscall TestPluginAPI::PosTest(void)" ([email protected]@@[email protected]@@XZ)
taxilian 16:03 I already told you how to fix that one
SinnerSmile 16:03 And one more thing, im working in VC++ express, not so long ago i unintentionally deleted those windows driver kit and reinstalled it after it, but now there is warnings on compilation Warning C4005 UINT8_MAX: macro redefinition
am i need to rebuild whole plugin?
taxilian 16:03 I would try deleting the build directory and rerunning the prep script, yes
SinnerSmile 16:03 about last error, what do you mean? Are you talking about "so line 32 of the .cpp file? makes no sense, that should just be getBrowserHwnd()" well it is right now. And posTest decred only in .h, in cpp it's FB::variant TestPluginAPI::PosTest().
taxilian 16:03 it was the missing "TestPluginAPI::" before PosTest where you implemented it
SinnerSmile 16:03 But now i got FB::variant TestPluginAPI::PosTest() in cpp and FB::variant PosTest() in .h and it's right if I'm not mad yet. But this still got this error. Can it be cos of those macro redefinitions?
taxilian 16:03 the unresolved symbol error?
I misread
SinnerSmile 16:03 ok)
yes, symbol error
taxilian 16:03 what that is saying is that there is a GetWindowRect function defined in your .h file but it can't find the implementation
line 93 of your .h
but you never implemented it
SinnerSmile 16:03 do you mean that declared but unused crap can call fatal error?
taxilian 16:03 I mean that declaring somethign but not implementing it and then calling it causes a link error
SinnerSmile 16:03 oh, got it
SinnerSmile 17:03 i'm bit of confused, am i need to even declare this GetWindowRect WinAPI function or it's declared somewhere in winAPI's .h files?
taxilian 17:03 you most definitely do not *ever* declare a windows api function… particularly not ever inside your own class
you just need to include the correct header file
SinnerSmile 17:03 yes, that makes sence, a much of sence.
oops, sense*
got tonns of warnings but they dissapeared after second recompiling with the same state (i think the same). thats weird.
taxilian 17:03 that's because warnings only show up when it compiles a file, and it doesn't need to recompile the file if the file hasn't changed
SinnerSmile 17:03 it was LNK4078 multiple 'section name' sections found with different attributes warnings
need to worry about?
taxilian 17:03 no idea
never seen before
SinnerSmile 17:03 ok
SinnerSmile 17:03 Trying to test it in console
Error: Error calling method on NPObject!
What do you thin can it be cos of windowless plugin cant get ancestor?
Trying to test PosTest()