1. Euphoria DLLs and *ugh* Visual Basic

I hate to ask this, but I'd like to use a few Euphoria DLL files with Visual
Basic. Question is, can a routine in my DLL accept strings passed throug
Visual Basic as sequences? or would VB pass a pointer to the routine, and my
routine peek to it?

I ask this mainly because some of my friends want 'proof' that Euphoria is
better than VB, and they'd like me to port a chat program I wrote to VB, and
the chat program uses euLibnet and some parameters in euLibnet are sequences
(strings). I don't want to attempt this port until I'm sure it will work,
otherwise I'll just write a wrapper DLL in Euphoria first.

~Greg

new topic     » topic index » view message » categorize

2. Re: Euphoria DLLs and *ugh* Visual Basic

>From: Greg Haberek <g.haberek at comcast.net>
>Subject: Euphoria DLLs and *ugh* Visual Basic
>
>
>I hate to ask this, but I'd like to use a few Euphoria DLL files with 
>Visual
>Basic. Question is, can a routine in my DLL accept strings passed throug
>Visual Basic as sequences? or would VB pass a pointer to the routine, and 
>my
>routine peek to it?
>

  I'm guessing what you mean is want to pass C strings, from VB, to a 
Euphoria DLL. The trick is to use atoms instead of sequences for the 
strings. You must then peek the string from that pointer. The problem is 
that if you use the translator (which you have to, to make a DLL) you can 
only accept integer sized data, and therefore can not recieve pointers 
properly. The way to get around this is to use two variables, breaking up 
the pointer. If you look at my XChat Plugin interface in the archives, you 
can see how to make the C code to fix this problem. In VB, you should 
declare the parameter as a ByVal String.

>I ask this mainly because some of my friends want 'proof' that Euphoria is
>better than VB, and they'd like me to port a chat program I wrote to VB, 
>and
>the chat program uses euLibnet and some parameters in euLibnet are 
>sequences
>(strings). I don't want to attempt this port until I'm sure it will work,
>otherwise I'll just write a wrapper DLL in Euphoria first.
>

    If you are using euLibnet, then it is really based off of Libnet, which 
is an open-source library. You will probably find some wrappers for it in VB 
on the net.

>~Greg
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu