GetUserId/CustomerId from DLL

Questions about MultiCharts and user contributed studies.
Joe@DA
Posts: 10
Joined: 09 Sep 2011
Has thanked: 6 times

GetUserId/CustomerId from DLL

Postby Joe@DA » 11 Sep 2011

How can I get to something within a DLL that is unique to customer or computer running MultiCharts. I have found that, as reported in forums, the following code (VB.net) works fine in TS but returns 0 in MC. I don't know how to reference GetUserId within DLL. I don't really want to set a variable in EZL-code and then retrieve it from ELObj in DLL unless that is the only way.

TS Code

Code: Select all

Private Function TS_GetCustomerId(ByVal pELObj As TSKITLib.IEasyLanguageObject) As Integer
Dim pELTSP As TSKITLib.ITradeStationPlatform = pELObj.Platform
Dim CustomerId As Integer = pELTSP.CustomerID
Return CustomerId
End Function
MC Code

Code: Select all

Private Function MC_GetCustomerId(ByVal pELObj As PLKit.IEasyLanguageObject) As Integer
Dim pELTSP As PLKit.ITradeStationPlatform = pELObj.Platform
Dim CustomerId As Integer = pELTSP.CustomerID
Return CustomerId
End Function

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: GetUserId/CustomerId from DLL

Postby Dave Masalov » 12 Sep 2011

Dear Joe@DA,

Unfortunately, it cannot be done directly from a dll. You may want to submit a feature request to the Project Management section of our site.

At the moment you can use the following PowerLanguage code:

Code: Select all

if getuserid = 1111111111 then begin
If h > h[1] then Plot1(0);
end;

Joe@DA
Posts: 10
Joined: 09 Sep 2011
Has thanked: 6 times

Re: GetUserId/CustomerId from DLL

Postby Joe@DA » 12 Sep 2011

Thanks,
I'll just set a local PL variable to the GetUserId function and grab it within the DLL. As you can tell I'm a new MC user but I have many years of experience with TS-EZL. Is the number from GetUserId the value I should be using for checking for a valid user of my software? or is there something else?

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: GetUserId/CustomerId from DLL

Postby Dave Masalov » 12 Sep 2011

Is the number from GetUserId the value I should be using for checking for a valid user of my software?
Joe@DA,

Yes, GetUserId returns MultiCharts User ID which is a unique number of MultiCharts installattion on a particular machine.


Return to “MultiCharts”