Extension Modules > COM

Couple Api ideas for embedding

<< < (10/14) > >>

Support:
Can you make it work with the current 2.2 version scriba.exe? Tom added a dozen math functions that were stubs in 2.1. There has also been a couple minor bug fixes as well. I really don't want to use 2.1 code knowing the grief I went through getting it resolved.


Great job on the video. You make things look so easy. I will have to play this again more than a couple times to grasp what is like opening a car door to you.  8)

dzzie:
i found the 2.2 source, attached is the COM.dll compatible with v 2.2.

all I had to do is build against its header files instead of the 2.1 ones

I also diffed the headers, I didnt see anything immediately obvious as to why the structure pointer offsets
were changed, but in the debugger I could see they were which is why it was crashing.

Support:
That solved the problem and it is working fine with Script BASIC 2.2 code base.

Theming would be sweet!




--- Code: ---import com.inc

function Button1_Click(arg)
print "Back in script basic Button1_Click arg=", arg, "\n"
Button1_Click = arg + 1
end function

function Button2_Click(arg)
print "Back in script basic Button2_Click arg=", arg, "\n"
Button2_Click = arg * 2
end function

obj = CreateObject("VB6.Sample")

if obj = 0 then
    print "CreateObject failed!\n"
else
print "obj = ", obj, "\n"
       
oCollection = CallByName(obj, "CallBackHandlers", VbGet)
    print "oCollection = ", oCollection, "\n"
   
    CallByName(oCollection, "Add", VbMethod, ADDRESS(Button1_Click()), "frmCallBack.cmdOp1_Click" )
    CallByName(oCollection, "Add", VbMethod, ADDRESS(Button2_Click()), "frmCallBack.cmdOp2_Click" )
   
    retVal = CallByName(obj, "LaunchCallBackForm", vbMethod, 21)
    print "LaunchCallBackForm returned ", retVal, "\n"
   
    ReleaseObject(obj)
    print "test complete!\n"
end if

--- End code ---

C:\SB22\sbcom\sbvb3>scriba COM_VB6_Callback_Example.sb
obj = 1414352
oCollection = 1414432
Back in script basic Button1_Click arg=21
Back in script basic Button2_Click arg=22
LaunchCallBackForm returned 44
test complete!

C:\SB22\sbcom\sbvb3>scriba -v
ScriptBasic v2.2
Variation >>Windows32<< build 2
Magic value 859001395
Node size is 16
Extension interface version is 11
Compilation: May  3 2014 21:45:37
Executable: C:\SB22\bin\scriba.exe

C:\SB22\sbcom\sbvb3>

Support:
A bit of progress on the theming front. The new com.dll (SB ext. mod.) isn't hanging when using the scriba.exe.manifest or sbiup.exe (Windows SB + theming support version) but it isn't showing a window either. Returns immediately.


C:\SB22\sbcom\sbvb3>scriba COM_VB6_Callback_Example.sb
obj = 1479888
oCollection = 1479968
LaunchCallBackForm returned 0
test complete!

C:\SB22\sbcom\sbvb3>

Support:
I was able to get your Script BASIC VB COM callback example running under Windows 7 64 bit.  I also installed Visual Studio 6 for my VB6 install on Windows 7.

Note: regsrv32 must be run as an admin to work.


Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version