ActiveX Company Name is not defined


#1

 

Hello.

NPAPI plugin builds fine and work!

I try to build ActiveX plugin (VS 2012) according this manual https://github.com/julianstorer/JUCE/blob/master/extras/browser%20plugin%20demo/How%20to%20build%20a%20browser%20plugin.txt. But i get

juce_browser_plugin.h(53): fatal error C1189: #error :  "You must define the JuceBrowserPlugin_Company macro before including juce_browser_plugin.h!"

But its defined!

 


#2

If that test fails then it obviously isn't defined!

Presumably you've defined it somewhere, but it needs to be in AppConfig.h


#3

#define JUCE_MODULE_AVAILABLE_juce_core 1

#include "BrowserPluginCharacteristics.h"

 

And in "BrowserPluginCharacteristics.h i have company name "BlaBla"

What's Wrong?


#4

If the compiler says it's not defined, then it's not defined.. Check your spelling + the order of inclusion.


#5

Julian, But i use all default source from github, i dont edit anything. NPAPI builds successfully But Activex not.


#6

in Juce_ActiveXGlueCode.cpp

paste

#include "JuceHeader.h"
#include <olectl.h>
#include <objsafe.h>
#include <exdisp.h>
#pragma warning (disable:4584)

#ifndef JuceBrowserPlugin_ActiveXCLSID
#error "For an activeX plugin, you need to define JuceBrowserPlugin_ActiveXCLSID in your BrowserPluginCharacteristics.h file!"
#endif

...

And delete

 #if JUCE_BUILD_ACTIVEX
 #include "wrapper/juce_ActiveX_GlueCode.cpp"
#endif

in \modules\juce_browser_plugin_client\juce_browser_plugin.cpp

Then it works


#7

What? No no no no no.. It's not possible to include JuceHeader.h in a module file - that would make no sense at all. 

I haven't time to try this myself right now, but I can't see what the problem is.. The juce_browser_plugin.cpp file includes juce_ActiveX_GlueCode.cpp, and before it does so, it also includes AppConfig.h, which in turn includes BrowserPluginCharacteristics.h which defines that macro. I can't really see a problem with all that..?


#8

Dear, Julian. JUCE framework is realy awsome for me. But it's not my imagination. I just download source code from github and then try to build plugin demo (https://github.com/julianstorer/JUCE/tree/master/extras/browser%20plugin%20demo/build/win32) with ActiveX in Visual Studio 2012 - that's all


#9

I just tried compiling the demo browser plugin project, and this doesn't happen for me. I don't know what you're misunderstanding or doing wrong, I'm afraid.


#10

Jules,

I'm afraid I can confirm the error here (latest pull from repo, no changes whatsoever).

I did as stated in the docs in "How to build a browser plugin.txt" for an ActiveX plugin:

"add the juce_ActiveX_GlueCode.cpp file to the project".

This is the full build log (Visual Studio 2008 SP1, on Win7 64-bit):

1>------ Rebuild All started: Project: JuceBrowserPluginDemo, Configuration: Release Win32 ------
1>Deleting intermediate and output files for project 'JuceBrowserPluginDemo', configuration 'Release|Win32'
1>Compiling...
1>juce_ActiveX_GlueCode.cpp
1>Have you included your AppConfig.h file before including the JUCE headers?
1>e:\koen\juce\modules\juce_browser_plugin_client\wrapper\../juce_browser_plugin.h(51) : fatal error C1189: #error :  "You must define the JuceBrowserPlugin_Company macro before including juce_browser_plugin.h!"
1>juce_gui_basics_wrapper.cpp
1>juce_graphics_wrapper.cpp
1>juce_events_wrapper.cpp
1>juce_data_structures_wrapper.cpp
1>juce_core_wrapper.cpp
1>juce_browser_plugin_wrapper.cpp
1>JuceBrowserPluginDemo.cpp
1>Build log was saved at "file://e:\Koen\JUCE\extras\browser plugin demo\build\win32\Release\BuildLog.htm"
1>JuceBrowserPluginDemo - 1 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Seems like some order-of-inclusion thing.

The JuceBrowserPlugin_Company macro is defined in BrowserPluginCharacteristics.h, which is included by AppConfig.h. And AppConfig.h is included by JuceHeader.h.

However, when the build starts, the compiler starts with compiling juce_ActiveX_GlueCode.cpp, and that one includes juce_browser_plugin.h, where the existence of JuceBrowserPlugin_Company is checked. But JuceHeader.h nor AppConfig.h have been seen at that moment.

Koen

 


#11

Thanks - yes, I've been meaning to look at this for a while - will do so soon.


#12

Sorry, it was just the readme that was incorrect.

You don't need to do anything at all to build the ActiveX version - as long as JUCE_BUILD_ACTIVEX = 1 (which is the default) then the module will do the rest. I've updated the readme now.