|
|
 |
| 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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

March 1st, 2008, 11:07 AM
|
|
Registered User
|
|
Join Date: Feb 2008
Location: Chicago, IL, USA.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
.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
|

March 3rd, 2008, 03:59 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 1 Time in 1 Post
|
|
Could you post the problematic line of code?
|

March 3rd, 2008, 04:33 PM
|
|
Registered User
|
|
Join Date: Feb 2008
Location: Chicago, IL, USA.
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.
David
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |