Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2008 > Visual Basic 2008 Essentials
Visual Basic 2008 Essentials If you are new to Visual Basic programming with version 2008, this is the place to start your questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2008 Essentials section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 1st, 2008, 11:07 AM
Registered User
Join Date: Feb 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default .dll interaction with an application

Now that I seem to be going okay with LINQ (at the moment), I've gotten myself into another interesting situation. I'm currently experimenting with a couple of sets of code in VB.NET (Express Edition, at the moment, but eventually to go to Pro), in which I'm collecting directory information in a VB form, then passing that to a VB .dll to query the XMLs in those directories and pass the results back to the form, meanwhile keeping information loaded in the .dll's memory for future use.

All fine and good, except that when I call the .dll's function name, I get an error message indicating that it can't find the entry point. I've checked the .dll under the Object Browser, and the functions seem to be quite visible, so I'm not sure what the problem is. I've added the .dll to my Resources and declared the functions, so VB knows everything is there.

Any ideas?

David M. Stowell
Old March 3rd, 2008, 03:59 PM
Friend of Wrox
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts

Could you post the problematic line of code?
Old March 3rd, 2008, 04:33 PM
Registered User
Join Date: Feb 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

Well, I've gotten around the problem, though we'll see what happens in the long term. I was trying to declare the .dll using the DECLARE statement, then simply using the function name later on, like this:

Declare Add Lib "MathLib.dll" (ByVal op1 As Decimal, ByVal op2 As Decimal) As Decimal

Dim lnSum As Decimal

lnSum = Add(3, 5)

It would blow up on the call to Add. Now I'm instantiating an object based on the .dll and that works. I'm just hoping that that works in the final environment - eventually the real .dll is going to be used in a Visual Foxpro application, which isn't .NET-aware. - it's COM. I know I can use CREATEOBJECT() in that code, but I hope that the two environments don't clash.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with windows application and DLL naikpalak722 General .NET 0 October 2nd, 2007 03:08 PM
Using .NET DLL from inside VB6 application Dmitriy General .NET 1 January 30th, 2006 04:45 PM
Using .NET Dll from VB6 application Dmitriy Pro VB 6 5 January 30th, 2006 04:43 PM
Reference lib or .dll in application? MMahaney@wcinfo.com C# 1 February 11th, 2005 02:25 PM
Unable to use the DLL in C# in Web application. rsaluja C# 0 September 27th, 2003 11:56 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.