Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Styx - sending/receiving messages with VB6

Author
Message
aerostudios
17
Years of Service
User Offline
Joined: 20th May 2009
Location: Oklahoma City OK (USA)
Posted: 31st May 2014 01:22 Edited at: 31st May 2014 01:25
Has anyone used the MAKE APP MESSAGE and POST APP MESSAGE function to send messages to a VB6 app? I have been able to successfully find my VB6 and my DBPro app windows and their hWnd.

But when sending a message from DBPro, I don't quite know how to use the "GetMessage" API from VB6.

Anyone out there performed such a task?

Thanks.

P.S. I did determine, when searching for the handle to the DBPro app, it's class name will be the form title plus "12345". So, if your DBPro app title is MainWindow, the classname will be "MainWindow12345". And conversely,the classname for a VB6 app is "ThunderRT6FormDC". So with Styx in DBPro use:

VB6Class = "ThunderRT6FormDC"
hWnd = FIND WINDOW(VB6Class,"FORM TITLE")
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 31st May 2014 16:54
Also, as you may already know, with VB6 you are able to communicate with DBPRO using COM DLLs. The Styx plugin contains the necessary commands to reference them and send function calls to your VB6 DLL.

aerostudios
17
Years of Service
User Offline
Joined: 20th May 2009
Location: Oklahoma City OK (USA)
Posted: 31st May 2014 19:49
Thanks Chris, yes I was thinking of you when I made this post. Do you have an example piece of code that would solve the mystery? What I am wanting to do is this.

1. I have create a sort of Speech Server in VB6.
2. The pilots of the aircraft in my DBPro app, TOWER CAB must respond to ATC instructions in a spoken voice.
3. I want to send a phrase to the VB6 app from DBPro that instructs the VB6 app to speak the phrase.

I would send a phrase such as:

"!1!November one two three, descending to 3 thousand!"

The delimiter is the "!". The "1" would be voice #1, and the remaining phrase is what would be spoken using TTS in VB6.

I am assuming I can accomplish this by using the Styx "MAKE APP MESSAGE" and "POST APP MESSAGE" commands, and intercept it with the "GetMessage" API call.

What are your thoughts?
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 31st May 2014 23:16 Edited at: 31st May 2014 23:17
No, I haven't got VB6, I use VB.NET 2010. I do not use styx to commincate with DBPRO, I use Matrix1. Here is my event message function:



And here is the means to linking the function with windows messages:



Additionaly I use forms controls to communcate using the BBB GUI plugin, Dark NET (A.K.A MikeNet networking plugin) for communication which works in both DBPRO and .NET 4.0 and finally a console implementing various string function libraries and slash commands using LUA, INI and XML.

Hope that helps

aerostudios
17
Years of Service
User Offline
Joined: 20th May 2009
Location: Oklahoma City OK (USA)
Posted: 31st May 2014 23:42
Where do I find Matrix1? I do have Dark NET. I was toying with that the other day.

How do you do the reverse and send a message to your VB app?
In my situation, I only need to send a one-way message to VB.
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 1st Jun 2014 01:53
The Matrix1 thread here; but you will have to choose between the Styx core library and the Matrix1 core library (That is the core section of styx, not all of Styx). The Styx core DLL would have to be taken out of the plugins folder. Both core libraries contain many identical commands.

I do not send messages to my VB app; I have had no need for such a thing. I can only assume if I did need to communicate back I could either use the return value of the function to pass back a simple result; or obtain the window handle of the VB form and use BBB GUI to communicate back.



That would be the BBB GUI equivilent of Send Message (or is it Post Message?)

To be honest my application is more one way than two way, I can only guess that such a solution would work.

aerostudios
17
Years of Service
User Offline
Joined: 20th May 2009
Location: Oklahoma City OK (USA)
Posted: 1st Jun 2014 02:57
Thanks for the tips/link. I'll definitely check them out!

But, on further exploration, I was able to load the VTEXT.DLL and issue commands directly from DBPro using Styx, thus eliminating the need to use VB altogether! Yippie! That was my need anyway. I can now control TTS output using the DLL instead of messing with VB.
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 1st Jun 2014 06:37
Great

Login to post a reply

Server time is: 2026-07-05 17:56:09
Your offset time is: 2026-07-05 17:56:09