Author Topic: DLLC  (Read 3042 times)

0 Members and 2 Guests are viewing this topic.

JRS

  • Guest
DLLC
« on: August 26, 2014, 11:46:21 AM »
Charles,

I'm having a missing function error while trying to test the DllcSpec4.sb example. It seems to not like the COM calls.

I'm using the latest O2 WIP ZIP with recompiles of DLLC.dll and the test dll.

Update

It seems to be an ole32.dll issue. (missing functions - dated 8/5/2013)

This example worked great at one time.
« Last Edit: August 26, 2014, 12:13:44 PM by John »

JRS

  • Guest
Re: DLLC
« Reply #1 on: August 26, 2014, 09:14:06 PM »
Charles,

Here is my current Hello World for the DLLC interface to TinyScheme. I'm not getting any errors or the desired output either.  :-[  I modified the scheme.c program to enable stdout as the port.

Code: [Select]
#if USE_DL
  scheme_define(&sc,sc.global_env,mk_symbol(&sc,"load-extension"),mk_foreign_func(&sc, scm_load_ext));
  scheme_set_output_port_file(&sc, stdout);
#endif

makefile
Code: [Select]
FEATURES = $(PLATFORM_FEATURES) -DUSE_DL=1 -DUSE_MATH=1 -DUSE_ASCII_NAMES=0

Here is the Script BASIC TinyScheme DLLC interface as it stands.

Code: [Select]
' TinyScheme Script BASIC DLLC Example

DECLARE SUB dllfile ALIAS "dllfile" LIB "dllc"
DECLARE SUB dllproc ALIAS "dllproc" LIB "dllc"
DECLARE SUB dllcall ALIAS "dllcall" LIB "dllc"

ts = dllfile("libtinyscheme.dll")
PRINT "TS: = ",ts,"\n"
InitNew = dllproc(ts, "scheme_init_new cdecl i = ()")
Deinit = dllproc(ts, "scheme_deinit cdecl (i sc)")
LoadStr = dllproc(ts, "scheme_load_string cdecl (i sc, c *cmd)")

sc = dllcall(InitNew)
PRINT "SC: = ",sc,"\n"
dllcall(LoadStr, sc, "(write (+ 2 2))")
dllcall(Deinit, sc)

dllfile()

C:\SB22\TS>scriba dllchellots.sb
TS: = 1
SC: = 3357560

C:\SB22\TS>
« Last Edit: August 26, 2014, 09:50:41 PM by John »

Charles Pegge

  • Guest
Re: DLLC
« Reply #2 on: August 26, 2014, 10:54:18 PM »
Hi John,

I've run the standard tests successfully on the latest DLLC.
Also your Cbox,Cust and Gauge.

Re DLLCSpec4: You will also need to rerun DLLCtest DLL to make DLLCtestDLL.dll in the modules folder.

COM speech (requiring ole32), of course, is confined to Windows due to the proprietary SAPI 5 technology, and Voices.

JRS

  • Guest
Re: DLLC
« Reply #3 on: August 26, 2014, 11:09:58 PM »
Thank You! 

I needed to change the SB destination paths.

Code: [Select]
C:\OxygenBasic\projectsB\ScriptBasic\DLLC>scriba dllcspec4.sb
DLLC SPEC / DEMO / TESTS:

Goto Here
raw: Speak i=(z*pwcs,i flags,i pulstreamno)
name          Speak
metatype      4
handle        80
library       0
par count     3
par bytes     12
stack release 0

Params/Members
1  0    z
2  4    I
3  8    I
Return: I
connected to voice

Hello Everyone!

Lapsed time Secs: 1.504946

raw:
name          /scriptbasic/modules/DLLCtestDLL.dll
metatype      0.9999999999999982
handle        3735552.0000000032
library       0
par count     0
par bytes     0
stack release 0

Params/Members
Return:

raw: stringbuf stdcall i=(c*buf, i bufsize)
name          stringbuf
metatype      1.9999999999999964
handle        3751936.0000000032
library       0.9999999999999982
par count     1.9999999999999964
par bytes     7.9999999999999856
stack release 0

Params/Members
0.9999999999999982  0   c
1.9999999999999964  3.9999999999999928  I
Return: I

raw: rectangle (i left,i top, i right, i bottom)
name          rectangle
metatype      2.9999999999999944
handle        0
library       0
par count     3.9999999999999928
par bytes     15.999999999999978
stack release 0

Params/Members
0.9999999999999982  0   I
1.9999999999999964  3.9999999999999928  I
2.9999999999999944  7.9999999999999856  I
3.9999999999999928  11.999999999999984  I
Return:

Length of rect variables record: (4+16*2) 48
rect right (30) 30
rect right (42) 42

greeting from stringbuf procedure / DLLtestDLL 1
  \ C o m ♥      R
84
2.500000
Rectangle Area: 660
bstring handle: 1453268
This was an OLE/Bstring
bstring handle 1453268
This was an OLE/Bstring  (original bstring is auromatically freed)

new bstring: handle=1364316
dispose bstring: handle=0

Wide string (6 to 12) 12
ascii string (12 to 6) 6
abcdef

GUID: {96749377-3391-11D2-9EE3-00C04F797396}
{6C44DF74-72B9-4992-A1EC-EF996E0422D4}



C:\OxygenBasic\projectsB\ScriptBasic\DLLC>

If you can do your same magic with my TinyScheme DLL issue, you win the grand prize.  :D

JRS

  • Guest
Re: DLLC
« Reply #4 on: August 26, 2014, 11:55:08 PM »
Charles,

Ideally, all I need is a way to return whatever output TinyScheme generates to a return string or a function that returns that generated string. The docs are confusing and I still don't understand why my stdout port function call isn't working on Windows.

Charles Pegge

  • Guest
Re: DLLC
« Reply #5 on: August 27, 2014, 12:17:54 AM »

John,
Unfortunately I have no time to spare on new project branches. I have enough tasks in hand to keep me busy till 2020!

JRS

  • Guest
Re: DLLC
« Reply #6 on: August 27, 2014, 12:24:33 AM »
No problem, I'll figure it out.

(Yet Another) Tiny Scheme
« Last Edit: August 27, 2014, 12:47:47 AM by John »

JRS

  • Guest
Re: DLLC
« Reply #7 on: September 09, 2014, 12:32:06 PM »
Charles,

As I ponder what is the best path to take with Dave's COM/VB offering, I thought I would ask how difficult do you think converting DLLC to C would be? (cross platform preferable where applicable) It seems that integrating Dave's stuff with yours would be much easier if it were in C.


Charles Pegge

  • Guest
Re: DLLC
« Reply #8 on: September 09, 2014, 01:11:33 PM »

Much the same coding, but more constraints on the GCC assembler. I would need more C experience to do this.

JRS

  • Guest
Re: DLLC
« Reply #9 on: September 09, 2014, 01:18:18 PM »
Quote
Much the same coding, but more constraints on the GCC assembler. I would need more C experience to do this.

Maybe the first step should be to use DLLC's COM interface to connect to Dave's COM engine. There is duplication in the two offerings but I think they compliment each other from different aspects.