| |

VerySource

 Forgot password?
 Register
Search
View: 891|Reply: 7

Ask how to build a function in the class library Function returns WIDESTRING

[Copy link]

1

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-3-13 07:00:01
| Show all posts |Read mode
Such as FUNCTION GETTBLNAME (CONST TBLNAME: WIDESTRING): WIDESTRING; SAFECALL;
And the function I created looks like this
 function gettblname (const tblname: WideString): HResult; safecall;
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 United States

Post time: 2020-6-8 20:15:01
| Show all posts
This is how COM is defined... Can be used as an out parameter to return WideString
Reply

Use magic Report

1

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-6-9 21:45:02
| Show all posts
May I ask if I choose HRESULT or BSTR
Reply

Use magic Report

0

Threads

14

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-6-10 08:00:02
| Show all posts
No problem, did you use the function created by the wizard to see if the return value was not selected?

function Get_Caption: WideString; safecall;


function TAAA.Get_Caption: WideString;
begin
  Result := WideString(Caption);
end;
Reply

Use magic Report

0

Threads

14

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-6-10 09:00:01
| Show all posts
Of course I chose BSTR
Reply

Use magic Report

1

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-6-12 13:15:01
| Show all posts
Beginner class library, is it a method to use the parameter in the number type return return type to choose BSTR?
Reply

Use magic Report

1

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-8-12 18:15:01
| Show all posts
A method is created in the class library with a wizard and registered successfully. This method cannot be called in the network.
Call the component like this <object classid="clsid:ED9D82E2-900D-4C69-8583-443199355C96" id="ACX_Report1"
width="162" height="253">
<script language="javascript"> var OutCome1;
alert(document.all.ACX_Report1.Method1);
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-26 17:00:01
| Show all posts
The parameter is out, and the pointer of WideString is passed. The return type of COM is all HRESULT and cannot be changed.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list