ActiveX Company Name is not defined



NPAPI plugin builds fine and work!

I try to build ActiveX plugin (VS 2012) according this manual 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!


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

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

#define JUCE_MODULE_AVAILABLE_juce_core 1

#include "BrowserPluginCharacteristics.h"


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

What's Wrong?

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

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

in Juce_ActiveXGlueCode.cpp


#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!"


And delete

 #include "wrapper/juce_ActiveX_GlueCode.cpp"

in \modules\juce_browser_plugin_client\juce_browser_plugin.cpp

Then it works

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..?

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 ( with ActiveX in Visual Studio 2012 - that's all

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.


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>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>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.



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

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.