I need to expose some complex computation performed by
an existing Borland C program to a new VB.Net front-end
My intention is to
1) split the code into an EXE using the Borland GUI
framework, calling the computational part refactored
in a plain old DLL, free from compiler-specific dependencies
2) call said DLL from VB.net as well, possibly later
porting the plain-C DLL to VC for more seamless bi-lingual
development as everything would live under Visual Studio.
I'd like to use the simplest possible parameter-passing
conventions, avoiding OLE extensions, typelibs and whatnot.
It seems basically the good old trick of carefully DECLARing
one's function signature, compiling using the _stdcall
convention for exported functions and aligning struct members
on 4-bytes boundaries should get me going. I've done simple
tests for functions with a bunch of scalar parameters
(ints, floats, strings). What is not so clear is structs.
The articles I am able to find (see e.g.
<http://groups.google.com.my/group/microsoft.public.vb.winapi/browse_frm/thread/b
f4e467b5587a499/>)
only ever seem to mention VB versions up to VB6.
Can someone point me to an up-to-date article or reference
documenting the mapping of C structs to VB UDT's and passing
them across unmanaged DLLs?
Thanks,
Bernard.
Christian Fröschlin - 06 Nov 2006 17:45 GMT
> Can someone point me to an up-to-date article or reference
> documenting the mapping of C structs to VB UDT's and passing
> them across unmanaged DLLs?
http://www.vsj.co.uk/articles/display.asp?id=501
Christian Fröschlin - 06 Nov 2006 17:47 GMT
>> Can someone point me to an up-to-date article or reference
>> documenting the mapping of C structs to VB UDT's and passing
>> them across unmanaged DLLs?
>
> http://www.vsj.co.uk/articles/display.asp?id=501
Forgot to mention, the article is about C# but
the technology is identical for VB.NET.
Bernard Delmée - 07 Nov 2006 08:20 GMT
>> http://www.vsj.co.uk/articles/display.asp?id=501
Thanks Christian; much appreciated.
Bernard.