Login Page - Create Account

Support Board


Date/Time: Fri, 29 Mar 2024 05:30:13 +0000



What should be the HINSTANCE value with Sierra Chart?

View Count: 644

[2021-04-07 22:34:33]
User741184 - Posts: 44
Hi,

I am creating a Window using CreateWindowEx() function from the Windows API and one of the parameters should be set to HINSTANCE value. What value should be given for it?
[2021-04-08 09:35:07]
User310645 - Posts: 49
If you mean a new window for doing your own drawing then the Sierra exe handle. This can be obtained from the windows API call GetModuleHandle(NULL).

If common control windows (edit boxes/buttons etc) then the hInstance of the window you are drawing in. (ie the window provided by Sierra through SCStudyInterfaceRef.ChartWindowHandle or the above value for the new window).
[2021-04-08 15:01:08]
User741184 - Posts: 44
Its a common control window with a table and few buttons on it. SCStudyInterfaceRef.ChartWindowHandle will be supplied as the Parent window handle. No? I have supplied SCStudyInterfaceRef.ChartWindowHandle as the Parent window handle but no idea what to supply for HINSTANCE value?
[2021-04-08 15:46:24]
Ticks - Posts: 174
The experts at SC should just provide its paying customers an example .cpp file for creating a working form with edit boxes, labels and buttons on it.

They are the SC experts and probably could provide one in a few days instead of its paying customers having to struggle and beg fellow users for help.
[2021-04-08 16:12:41]
User310645 - Posts: 49
I've only created either "top level" windows in which I've drawn my own GDI components or added common controls (ie. those from comctl32.lib) directly to an existing chart window.

In the first case the hWndParent would be NULL and the hInstance is the SierraChart.exe hInstance as described previously.
In the second, hInstance is NULL and hwndParent is the chart window handle.

Not being a windows GUI programmer and not knowing your use case I don't know if you mean you want to embed a window inside another and if this is possible. Maybe just draw the components directly to the chart window?

To add a comment to Ticks, to be fair to Sierra, this is Windows GUI programming. It has nothing to do with SierraChart so you can see why they wouldn't want to get bogged down answering general windows programming questions. There is already masses of information on the internet covering this especially Microsofts own documentation although I admit its sometimes difficult to find if you don't know what you're actually looking for.
[2021-04-09 01:54:45]
Ticks - Posts: 174
@310645
Sierra Charts is a Windows GUI programming.
SC is built with C++ code and they are coding their own windows, forms, etc.
The "Trade Window" itself is a windows form.
So yes, they would be the best to provide a working example of creating a custom trade window.

already masses of information on the internet covering this
There are also masses of information on the internet covering how to trade.That hasn't stopped people from writing books and creating videos on it either.
[2021-04-09 02:27:37]
Sierra Chart Engineering - Posts: 104368
So yes, they would be the best to provide a working example of creating a custom trade window.
There is an immense amount of complexity and code to this. And not really sure how it would be accomplished from ACSIL. We do not even really know ourselves.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-04-09 09:06:46]
Ticks - Posts: 174
There is an immense amount of complexity and code to this. And not really sure how it would be accomplished from ACSIL. We do not even really know ourselves.

Thanks for the reply.
Would it be possible to provide a sample .cpp file that could interact with an strat? Such as change or override its default input variables?
I have attached a screenshot of a form that would be great if we could get a working example cpp file.

Note that I`m not asking SC to provide all the features on the form, but perhaps one of each button, input box, checkbox and display trade data.
Something we can expand upon on our own after that.
Just please give us a working example .cpp to work with.
Date Time Of Last Edit: 2021-04-09 09:41:22
imageexample form.PNG / V - Attached On 2021-04-09 09:07:51 UTC - Size: 57.72 KB - 164 views

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account