Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / November 2006

Tip: Looking for answers? Try searching our database.

Parameter passing between C and VB

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bernard Delmée - 06 Nov 2006 16:29 GMT
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.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.