Oxygen Basic
Programming => Problems & Solutions => Topic started by: JRS 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.
-
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.
#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
FEATURES = $(PLATFORM_FEATURES) -DUSE_DL=1 -DUSE_MATH=1 -DUSE_ASCII_NAMES=0
Here is the Script BASIC TinyScheme DLLC interface as it stands.
' 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>
-
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.
-
Thank You!
I needed to change the SB destination paths.
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
-
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.
-
John,
Unfortunately I have no time to spare on new project branches. I have enough tasks in hand to keep me busy till 2020!
-
No problem, I'll figure it out.
(Yet Another) Tiny Scheme (http://remindme.joanneandmike.com/tscm.html)
-
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.
-
Much the same coding, but more constraints on the GCC assembler. I would need more C experience to do this.
-
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.