How to Use IPowerLanguageObject?

Questions about MultiCharts and user contributed studies.
tonyng
Posts: 51
Joined: 04 Oct 2013
Has thanked: 2 times
Been thanked: 5 times

How to Use IPowerLanguageObject?

Postby tonyng » 12 Jun 2016

Hi

I try to use TagEx to hold a 64bit address for the class variable. I think I should declare this in C++:

Code: Select all

void __stdcall db_SetFXStrategy(IPowerLanguageObject * pELObjOut,LPSTR pLongStrategy, LPSTR pShortStrategy)
{
//VARIANT IPowerLanguageObject.TagEx;
int prop = pELObjOut->TagEx;
ODBC_Class * DB = (ODBC_Class *)prop;
if (DB != 0)
{
DB->oLongStrategy = pLongStrategy;
DB->oShortStrategy = pShortStrategy;
DB->oLongStrategyID = DB->FXGetStragID(DB->oLongStrategy);
DB->oShortStrategyID = DB->FXGetStragID(DB->oShortStrategy);
DB->UnderlyingType = IsFX;
}
}


Does anyone know how to pass the PowerLanguageObject from the Power Language side?


This doesn't work!!!

Code: Select all

external: "example.dll", int, "db_SetFXStrategy", IPowerLanguageObject,string,sting;

Is there any documentation about using IPowerLanguageObject?
Last edited by tonyng on 12 Jun 2016, edited 1 time in total.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: How to Use IPowerLanguageObject?

Postby TJ » 12 Jun 2016

Hi

I try to use TagEx to hold a 64bit address for the class variable. I think I should declare this in C++:

void __stdcall db_SetFXStrategy(IPowerLanguageObject * pELObjOut,LPSTR pLongStrategy, LPSTR pShortStrategy)
{
//VARIANT IPowerLanguageObject.TagEx;
int prop = pELObjOut->TagEx;
ODBC_Class * DB = (ODBC_Class *)prop;
if (DB != 0)
{
DB->oLongStrategy = pLongStrategy;
DB->oShortStrategy = pShortStrategy;
DB->oLongStrategyID = DB->FXGetStragID(DB->oLongStrategy);
DB->oShortStrategyID = DB->FXGetStragID(DB->oShortStrategy);
DB->UnderlyingType = IsFX;
}
}


Does anyone know how to pass the PowerLanguageObject from the Power Language side?


This doesn't work!!!
external: "example.dll", int, "db_SetFXStrategy", IPowerLanguageObject{self}, string{LongStr};sting{ShortSrt};


Is there any documentation about how to use IPowerLanguageObject?
Have you tried a search on "IPowerLanguageObject"?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: How to Use IPowerLanguageObject?

Postby TJ » 12 Jun 2016

see post 1 & 2
[FAQ] How to Post Codes (... so that people can read)
viewtopic.php?f=16&t=11713

tonyng
Posts: 51
Joined: 04 Oct 2013
Has thanked: 2 times
Been thanked: 5 times

Re: How to Use IPowerLanguageObject?

Postby tonyng » 12 Jun 2016

IPowerLanguageObject is being exposed by "plkit.tli". Google cannot provide any document about it.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: How to Use IPowerLanguageObject?

Postby Henry MultiСharts » 16 Jun 2016

Hello tonyng,

Code: Select all

int prop = pELObjOut->TagEx;
The object's address is received incorrectly.
IPowerLanguageObject.TagEx has VARIANT type (structure).
Therefore your pointer should be put into it and received from it.

Please refer to MSDN for more details.

Meecc
Posts: 50
Joined: 23 Jun 2011
Has thanked: 22 times
Been thanked: 7 times

Re: How to Use IPowerLanguageObject?

Postby Meecc » 05 Jul 2016

Hello tonyng,
For

Code: Select all

" external: "example.dll", int, "db_SetFXStrategy", IPowerLanguageObject,string,sting;
could try replace IPowerLanguageObject
with IEasyLanguageObject.
So it becomes:

Code: Select all

" external: "example.dll", int, "db_SetFXStrategy", IEasyLanguageObject ,string,sting;


Return to “MultiCharts”