Help Screen for Custom DLL

Let us know your likes and dislikes, or what you'd like to see next. We listen!

Help Screen for Custom DLL

Postby STEVEN.YOUNG » Wed Apr 25, 2012 11:36 am

I have started writing custom dll's - very nice to be able to do this. However I have found that when I try to use them, I have to refer back to my source code to remember the parameter meanings, order. etc. Is there a way to show custom names for the parameters to a custom dll, or provide a link to a custom help file that could display when you press the context sensitive help button.
Thanks for any guidance, or add this comment to your "Requested Feature List"
STEVEN.YOUNG
 
Posts: 6
Joined: Sun Jul 05, 2009 9:36 pm

Re: Help Screen for Custom DLL

Postby Overload » Wed Apr 25, 2012 2:23 pm

There isn't a way to reference an external Help File for your custom DLL. But a method I often use is to create a wrapper script that encapsulates the DLL call. That wrapper script can then use more descriptive parameters. For example, suppose your DLL formula has 3 parameters: price, days, and percent.

If you click the Builder button, you will be prompted for these 3 parameters:

Parm1:
Parm2:
Parm3:

As you've said, that's not very descriptive, and it's easy to forget what each parameter represents. But the wrapper I'm talking about is just a new Custom Formula that is a script instead of a DLL call, and it does nothing more than call your DLL. For example, suppose your DLL formula is named 'ABC'. You could create a script formula like this:

Name: myABC

price = parameter("Price");
days = parameter("Days");
percent = parameter("Percent");
myABC = ABC(price, days, percent);

By using myABC() instead of ABC(), you'll be able to click the Builder button and see actual names for each of the parameters instead of just Parm1, Parm2, etc.

Hope this helps.

Pete
Overload
 
Posts: 2248
Joined: Wed Nov 30, 2005 12:14 pm

Re: Help Screen for Custom DLL

Postby STEVEN.YOUNG » Wed Apr 25, 2012 5:05 pm

Sounds like just what I need. Thx
STEVEN.YOUNG
 
Posts: 6
Joined: Sun Jul 05, 2009 9:36 pm

Re: Help Screen for Custom DLL

Postby Kevin_in_GA » Thu Apr 26, 2012 8:01 pm

Gys:

Can one of you post an example of what a custom .dll looks like? Sounds interesting, and I doubt very many of us here on the forum know how to approach this.

I would even (selfishly) ask that you walk us through a simple one to teach us how and why one would do this.

Thanks in advance,

Kevin
Kevin_in_GA
 
Posts: 171
Joined: Wed Aug 04, 2010 10:14 am

Re: Help Screen for Custom DLL

Postby Overload » Fri Apr 27, 2012 8:58 am

For those interested in more sophisticated programming of Custom Formulas, StrataSearch allows you to call external DLLs. In short, these are external components that have been written in C or C++, and then compiled into machine language.

There are several benefits to Custom Formula DLLs. First, using C or C++, you can do much more sophisticated programming than you can with StrataSearch Scripts. This also gives you greater control and flexibility in creating the exact values you're looking for. Custom Formula DLLs also tend to be faster and more stable, but this partially depends on the quality of your programming. As with a StrataSearch Script, if garbage is programmed into it, garbage will be the result as well.

There is an example that comes with the StrataSearch Installation. Open the Help > Technical Support menu, and then click the Data Folders link. Then enter the "\api" folder and you'll see a "\demoAPI" folder that contains a couple of examples. For a quick look at the code, you can open demoAPI.cpp with Windows Notepad or some other text editor. This will let you see the example code for the 2 moving averages that are described in the demo. There is also some documentation that describes each approach.

You'll need a compiler to be able to be able to build Custom Formula DLLs. For a free one from Microsoft, just do a Google search on "Microsoft Visual Studio Express". You can then start by compiling and using demoAPI, and then expanding to your own creations after that.

Pete
Overload
 
Posts: 2248
Joined: Wed Nov 30, 2005 12:14 pm

Re: Help Screen for Custom DLL

Postby pschmu » Fri Dec 06, 2013 11:33 am

Pete,
Will this MS Visual Web developer work for building DLL files for SS? I have not done this in years but willing to learn. Here is the link:

http://www.asp.net/vwd

I have a script for an indicator that works but runs like molasses. I'm hoping to speed up with a DLL.

Thanks for your input
pschmu
 
Posts: 5
Joined: Fri Dec 06, 2013 7:28 am

Re: Help Screen for Custom DLL

Postby Overload » Fri Dec 06, 2013 1:05 pm

No, I don't believe MS Visual Web developer will work. That creates code for web-based applications, but I don't believe it would create a DLL. See my post just before yours for instructions. I have not checked recently, but I do believe Microsoft Visual Studio Express is still available, and example "demoAPI" is still available to all StrataSearch users within the Data Folder.

Pete
Overload
 
Posts: 2248
Joined: Wed Nov 30, 2005 12:14 pm

Re: Help Screen for Custom DLL

Postby pschmu » Sun Dec 08, 2013 8:26 pm

I have MS Visual Studio Express 2012 and I'm having problems compiling the demoAPI source file. It has the moving average example in it. I get the following error:

Error 1 error C2491: 'userMovingAverage2' : definition of dllimport function not allowed c:\users\public\documents\stratasearch data\main\api\demoapi\demoapi.cpp

I have all the .h and .def files in the folder for compiling.

Just thought maybe someone here knows how to correct this error.

Thanks

pschmu
pschmu
 
Posts: 5
Joined: Fri Dec 06, 2013 7:28 am


Return to Comments and Suggestions

cron