Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Support

Pages: 1 ... 13 14 [15] 16 17 ... 59
211
COM / Re: Couple Api ideas for embedding
« on: June 17, 2014, 06:06:01 PM »
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>

212
COM / Re: Couple Api ideas for embedding
« on: June 17, 2014, 09:57:57 AM »
That solved the problem and it is working fine with Script BASIC 2.2 code base.

Theming would be sweet!



Code: [Select]
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

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>

213
COM / Re: Couple Api ideas for embedding
« on: June 16, 2014, 07:59:44 PM »
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)

214
COM / Re: Couple Api ideas for embedding
« on: June 16, 2014, 07:16:01 PM »
Yours worked. STRANGE !!!

C:\SB22\sbcom\sbvb3>scriba COM_VB6_CallBack_Example.sb
obj = 1413952
oCollection = 1414112
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>

You're using the 2.1 (OLD) version of scriba.exe. I think that was compiled with VC7 or VC9. The SB 2.2 was compiled with VC10 from the Win7 SDK.

C:\SB22\sbcom\sbvb3>scriba -v
ScriptBasic v2.1
Variation >>STANDARD<< build 1
Magic value 859034417
Node size is 16
Extension interface version is 11
Compilation: Sep 11 2009 23:19:32
Executable: C:\SB22\bin\scriba.exe

C:\SB22\sbcom\sbvb3>

215
COM / Re: Couple Api ideas for embedding
« on: June 16, 2014, 06:50:13 PM »
Please e-mail me the scriba.exe you are using.

What I'm using.

C:\SB22\sbcom\sbvb3>scriba -v
ScriptBasic v2.2
Variation >>Windows32<< build 2
Magic value 859012665
Node size is 16
Extension interface version is 11
Compilation: Nov  9 2012 18:29:05
Executable: C:\SB22\bin\scriba.exe

C:\SB22\sbcom\sbvb3>

Here is a later compiled version but still GPF's.

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

216
COM / Re: Couple Api ideas for embedding
« on: June 16, 2014, 06:47:15 PM »
I have Visual Studio 2013 on Win7 64 and VS2008 on XP.

I really like using MinGW-GCC-TDM.

217
COM / Re: Couple Api ideas for embedding
« on: June 16, 2014, 06:44:00 PM »
1. Over wrote directory with new zip.
2. Copied com.dll to modules dir.
3. Copied com.inc to include dir.
4. Re-registered VB6_Example.dll.

GPF after I press one of the callback test buttons.

C:\SB22\sbcom\sbvb3>scriba COM_VB6_CallBack_Example.sb
obj = 1414352
oCollection = 1414432

C:\SB22\sbcom\sbvb3>

218
COM / Re: Couple Api ideas for embedding
« on: June 16, 2014, 06:34:12 PM »
I forgot to copy the com.dll to the SB modules directory. I also copied the com.inc to the include directory. Now it GPF's.  :'(

219
COM / Re: Couple Api ideas for embedding
« on: June 16, 2014, 06:25:06 PM »
I re registered it again but it still says the script writer forgot to register the callback handler.

I'm on the #AllBASIC IRC (see link for web client in  upper right corner of forum) if that would be better to resolve this.

220
COM / Re: Couple Api ideas for embedding
« on: June 16, 2014, 06:19:16 PM »
I thought that is what you meant. Didn't want to scare anyone away before it's out of the kitchen.  :)

Can you confirm the output I posted was what you expected?

With each release I put it in a sub-directory of sbcom. I then regsrv the DLL again due to it's new location.


221
COM / Re: Couple Api ideas for embedding
« on: June 16, 2014, 06:02:59 PM »
Quote
you will have to change the project -> properties -> C++ -> additional include directories to compile the com.dll on your system.

Are you saying I need to do this to test this callback example or if I'm doing something new?

I only use the console VC compiler and Visual Studio isn't something I'm proficient with. 

Why does it have to be compiled on my XP box? I can match what directory structure you use. Having Script BASIC programmers compiling C++ DLLs to make this work may be over their heads.

Update

I'm guessing it's working (or not). It popped dialogs saying the callbacks weren't registered or something like that..

C:\SB22\sbcom\sbvb3>scriba COM_VB6_CallBack_Example.sb
obj = 1414352
currently unsupported VT return type: 9
oCollection = 0
LaunchCallBackForm returned 21
test complete!

C:\SB22\sbcom\sbvb3>

222
COM / Re: Couple Api ideas for embedding
« on: June 16, 2014, 10:49:06 AM »
The MS calender ActiveX example works great!



This is the added code to the above example to show the calender dialog.
Code: [Select]
    sDate = CallByName(obj, "SelectDate")
    if len(sDate) = 0 then
    print "User pressed cancel for date selection\n"
    else
    print "Date: ", sDate, "\n"
    end if

Console output
Quote
C:\SB22\sbcom\sbvb2>scriba COM_VB6_Example.sb
GetString returned: default value!
objForm = 1414640
Waiting until user closes form to proceede..
Date: 16/6/2014
anndddd were done!

C:\SB22\sbcom\sbvb2>

223
COM / Re: Couple Api ideas for embedding
« on: June 16, 2014, 08:09:24 AM »
Thanks Dave for the update and Peter for helping out.

Take a look at the trial extension module and the myicall function. This shows you how to call SB script functions from the extension module. (my utopia I'm striving for in the IUP ext. module) Charles has already done this in DLLC and in fact doing it multi-threaded with a common shared event handler. IUP isn't thread safe by design but that didn't stop Charles.

I will test the calendar control and let you know how it goes. This is too cool being able to call VB forms and interact with them.

I created a Windows version of scriba called scriabw.exe and sbiup.exe which are consoleless Windows versions with themeing support enabled. Works great with IUP. When I tried them with your stuff, nothing is displayed and doesn't return to the console prompt like it should.  ??? I wonder if you disable alert dialogs the main form may theme. (noticed this problem early on with DYC)




224
COM / Re: Couple Api ideas for embedding
« on: June 15, 2014, 08:07:35 PM »
Dave,

I created a form with a calender control and wanted to see if I could make it work with Script BASIC. Can you post the steps needed to use VB forms with SB?



225
COM / Re: Couple Api ideas for embedding
« on: June 14, 2014, 05:53:25 PM »
Here is some screen shots of the COM_VB6_Example.sb program running on XP using VB6 resources.

          







Quote
C:\SB22\sbcom>scriba COM_VB6_Example.sb
GetString returned: Script BASIC
objForm = 1414336
Waiting until user closes form to proceede..
anndddd were done!

C:\SB22\sbcom>

Code: [Select]
import com.inc

obj = CreateObject("VB6.Sample")

'Sample function prototypes
' longTest(v As Long)
' intTest(v As Integer)
' ByteTest(v As Byte)
' GetString(prompt As String, title, def) As String
' ShowUI() As Long

if obj = 0 then
print "CreateObject failed!\n"
else
    CallByName(obj, "longTest", VbMethod, 20000)
    CallByName(obj, "intTest", VbMethod, 1000)
    CallByName(obj, "byteTest", VbMethod, 255)
   
    'this one fails silently because its invalid value for byte type..
    CallByName(obj, "byteTest", VbMethod, 256)

    retVal = CallByName(obj, "GetString", VbMethod, "Enter some Text:", "my title", "default value!")
    print "GetString returned: ", retVal, "\n"
   
    'do NOT release objects you dont own..
    objForm = CallByName(obj, "LaunchUI")
    print "objForm = ", objForm, "\n"
   
    for i=0 to 10
        CallByName(objForm, "AddItem", VbMethod, "Hello from script basic! " & i)
    next
   
    print "Waiting until user closes form to proceede..\n"
    CallByName(obj, "BlockUntilFormCloses")
   
    ReleaseObject(obj)
    print "anndddd were done!\n"
   
end if

FYI The SAPI COM example works fine.

VB6 & XP Themes  - I couldn't get the manifest method to work with your example.

Pages: 1 ... 13 14 [15] 16 17 ... 59