beginner SDK compilation problem

Questions about MultiCharts and user contributed studies.
davidchow
Posts: 3
Joined: 01 Jul 2009
Location: Hong Kong
Contact:

beginner SDK compilation problem

Postby davidchow » 18 Feb 2010

Hi,

I am experienced Unix/Linux programmer but completely new to MS programming environment . I just don't know how to get start to use the PLkit.dll .

I tried to search for many topics on MSDN about writing dll and calling a dll.. but cannot find anything close .

I am creating my own dll with the SDK . However, I cannot get the MS compiler to recognize the IEasyLanguageObject . I already put the "#import .....PLKit.dll" line in my .cpp file . I noticed the compiler has generated two files plkit.tli and plkit.tlh ... I looked into the files and see that this is the interface declarations and definitions of the SDK . I look through many docs online and looks like the caller require a .tlb file (nowhere to find it) .

I read through the TS documentation of the SDK, and saying that new versions does not require the .tlX files . But how can I compile my dll c++ source code using MS Visual studio 2008? Please give me some pointers to documentation ... any help will be good.. Thanks.

tekram
Posts: 96
Joined: 26 May 2009
Has thanked: 6 times
Been thanked: 18 times

Postby tekram » 21 Feb 2010

It is likely you don't have access to the TS forum. Please see attached demo and doc which contains more info than what is quoted here. It is unclear how compatible PLkit is to tskit. Please report back if the demo works for PLkit.
hxxps://www.TS.com/Discussions/Topic. ... c_ID=53987

The attached demonstration illustrates how code written in Visual Basic .NET or Visual Basic 2005 can be called from TS EasyLanguage. More generally, it illustrates how types in a .NET assembly can be exposed to TS through the DLL interface that EasyLanguage provides.

Running the Demo


Running the demonstration is a seven step process:

1.) Download the file Interop Demo - General Files.zip, posted above, to your computer.

2.) Extract the files contained in the zip file. Place the three DLL files into your installation's equivalent to the following subdirectory:

C:\WINDOWS\system32\


3.) Double-click the .ELD file, and import the indicator contained therein.

4.) Move the TS workspace file, COM Interop Demo.tsw into your \Program Files\TS\MyWork\ subdirectory.

5.) Ensure that you have the Microsoft .NET framework, version 2.0, installed on your computer. To do this, follow these steps:

a.) Look for a subdirectory with a name like the following (the numbers 50727 may be different on your computer):

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

b.) If you do not find a subdirectory like this on your computer, open an Internet Explorer window. From the Internet Explorer Tools menu, choose "Windows Update". Run Windows update. You will be prompted, as one of the available updates, to install the .NET framework, version 2.0.


After you've completed installation of the framework, return to these instructions and continue with Step (6).


6.) Register the type library for the managed assembly (this is the type library created, in this demonstration, by the VB.NET code).

a.) Click on the Start button on your Windows desktop... Choose "Run" from the pop-up menu that appears.

b.) At the command prompt, type "cmd", without the quotation marks. This will cause a DOS window to appear.

c.) In the DOS window, at the prompt, type "CD\", without the quotation marks. This will cause the prompt to change to "C:\>".

d.) Type the following, adjusting the statement so that your installation's .NET framework subdirectory is used. Note: The version of the .NET framework used must be 2.0 or later.

The below statement, which must be typed at the "C:\>" prompt, appears to contain a space between "Rega" and "sm". However, there should be no space there. The web site software inserts a space there because of how it handles strings longer than 50 characters. When you're typing the line below at the C:\> prompt, type Regasm without any space.

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Regasm InteropDemo_VBCode.dll /tlb: InteropDemo_VBCode.tlb

Note: In some instances the /codebase switch may need to be added to this statement. See the following topic for more details on the use of this switch:

hxxps://www.TS.com/Discussions/Topic. ... c_ID=60379


7.) Open the demonstration workspace and ensure that the DLL-calculated moving average plots on the chart.
Attachments
tskit.zip
(100.27 KiB) Downloaded 192 times
InteropDemo.zip
(85.12 KiB) Downloaded 191 times

User avatar
Bruce DeVault
Posts: 438
Joined: 19 Jan 2010
Location: Washington DC
Been thanked: 2 times
Contact:

Postby Bruce DeVault » 21 Feb 2010

Just a quick note: the reply above is regarding C#.NET, while the original request was regarding C++.

In general, the C++ interfacing for MultiCharts should be very similar to the C++ interfacing for TS, and the same documentation should prove a good starting point.


Return to “MultiCharts”