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 / Making memblocks and accessing them in VB.net

Author
Message
kojotex
21
Years of Service
User Offline
Joined: 16th Jul 2003
Location:
Posted: 7th Mar 2004 15:50
Hi,
i'm triying to make a VB.net application, that can be controlled by a DBP programm... and because exeat couldn't get the dlls working, i'm trying to control the VB app by another way....
First i wanted to control it by writing a file, and read it, but this was much too slow
Now I`m trying to write the data i want to transfer to the VB app into a memblock, write the memblock adress into a file, read this file once at the start, and the access the memblock by pointers...

But it doesnt work... heres the code:


You have to create a new DB project, and set it to windowed(200*100 should be enough...

VB.net code:

Create a new Windows Application and copy this code into it...



Now, heres the problem: I cant access the right memory, i can write a byte into the memory (remove the rem to see it) and read it, but i cant read the DarkBasic memblock?

Plz help me

Kojo
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 7th Mar 2004 20:51
You can't do that. You need to create a named shared-memory area and share this between applications.

I can show you how to do this in DBPro, but you'll have to work it out for yourself for .NET



*** Soon to be released - A Network Plug-in ***

For free Plug-ins, source and the DBPro Interface library for Visual C++ 6, .NET and soon for Dev-C++ http://www.matrix1.demon.co.uk
Dave J
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 8th Mar 2004 00:46
There's a DB<>VB Integration toolkit that uses a shared memblock system, althought it's written for VB6 so you'll have to convert the code.

It's somewhere on this forum, I can't find the URL atm though lol.


"Computers are useless they can only give you answers."
kojotex
21
Years of Service
User Offline
Joined: 16th Jul 2003
Location:
Posted: 8th Mar 2004 15:08 Edited at: 8th Mar 2004 15:55
http://darkbasicpro.thegamecreators.com/?m=forum_view&t=4570&b=6
This toolkit?

Ok, i tried it, but i have 2 problems:
1. if i import it into VB.net it says, as any can't be use, what should i use instead?

2. It doesn't work with my DBP Version!!! (the german version -> DBP patch 5.1)
If i compile it, the compiler tells me, that the variable val can't be used... and if i change val to something other (for example vall ), the programm just keeps searching for the conection

Kojo
kojotex
21
Years of Service
User Offline
Joined: 16th Jul 2003
Location:
Posted: 8th Mar 2004 20:38
It doesn`t work

I found out that when i call the initDBVB function, because it`s searching the window title...

Could please someone try it?

Kojotex

Login to post a reply

Server time is: 2025-06-09 04:11:00
Your offset time is: 2025-06-09 04:11:00