Unable to build Data plugin

I am following below instructions in adk.html file.

Creating your own plug-in DLL is quite simple. If you are using Visual C++ 6 you should do the following:

  1. Choose File->New from the menu.
  2. From the list of available projects choose "Win32 Dynamic-Link Library" and type the project name, for example "MyPlugin", then click "OK"
  3. In the page "Win32 Dynamic-Link Library - Step 1 of 1" choose "A simple DLL project" - this will create a project file and three source code files - MyPlugin.cpp, StdAfx.h, StdAfx.cpp
  4. Now copy "Plugin.cpp", "Plugin.h" files from the Data_Template plugin DLL source code folder to your project folder
  5. Choose Project->Add to project->Files... menu. From the file dialog please choose "Plugin.cpp", "Plugin.h" files and click OK. Now these files are added to the project and you can build it.

When trying to build the plugin, I get the error "Cannot open include file: 'Test.h': No such file or directory". I tried including all the files Test.h, resource.h, Plugin_Legacy.h, ConfigDlg.h , but unable to build it successfully.

What am i missing here?

  1. Are you running Windows 95 or 98 ? Because you've left us to a wild guess.

  2. There are more than 10 sample projects in the ADK and around 4 of Data plugins, do you mind telling us which one you used or from which Directory you copied files?

  3. Your Project Files doesn't show Test.h, where is it?
    image

  4. If you check the Data_Template Sample, Test.h file is already there.
    image

  5. Line #25 of Plugin.cpp does indeed reference it.
    image

By the way I cant test it on VC++ 6 because even if the ADK is a decade or more older, it works fine even on VS2017.

2 Likes

Thanks for responding travick.

  1. Are you running Windows 95 or 98 ? Because you've left us to a wild guess.

I am running Microsoft Visual C++ 6.0 on Windows 7 Enterprise (64 Bit).

  1. There are more than 10 sample projects in the ADK and around 4 of Data plugins, do you mind telling us which one you used or from which Directory you copied files?

I am using the files from the folder ADK > Data_Template.

Your Project Files doesn't show Test.h , where is it?

This was the initial error I got. I did add the "Test.h"; then got error for other header files, added all those. Then had a error MainDLL was already defined (or something like that). So I copied the contents of ADK > Data_Template > Plugin.cpp to MyPlugin.cpp.

Now able to build. Strange thing i noticed is the built dll (MyPlugin.dll) is about 1.4 MB; but when I tried to build the files in Data_Template (Test.dll) is just 105 KB. I am not sure what I have done is right.

Any way next step is to see if Amibroker can recognize the plugin and try the sample code to fetch some data.

Thanks again for replying :slight_smile:

I haven't really monitored them but there is something not right with such large size.
Probably something in the form of dependencies and supporting files got bundled along with it.
You have to check your config and target OS etc.

Just FYI, if you are starting out or you are new, you can setup the whole thing with later versions of VS.
Is there a compulsion to stick with VC++ 6 or is it just because it was in the ADK at that time?

You have to check your config and target OS etc.
Thanks, will try to do that.

Just FYI, if you are starting out or you are new, you can setup the whole thing with later versions of VS.
Is there a compulsion to stick with VC++ 6 or is it just because it was in the ADK at that time?

Yes, I am very new. Only programming language I know is something called SAP ABAP. Have to learn C++. I initially tried with Visual Studio 2017 community Edition. As I got the error and the ADK mentions VC++ 6; i switched to that. Now I think I will try the same in VS 2017.

You can use VC++ core desktop features.

Just make sure that Windows Universal CRT package is installed.
Its dependency is XP support for C++

The relatively newer apps run on Managed .NET or other SDKs which isn't needed for AB.