Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Declaration Expected"

Status
Not open for further replies.

lbrechler

Programmer
May 17, 2001
44
US
Hi all.

I'm trying to create a VB.NET Class Library and reference a DLL from inside that library. I'm able to add a reference, import the dll, and then dim a new object using it, but then I get a "declaration expected" error on the next line(s) of the program.

My code:
--------
Imports MyDLL

Public Class Class1
Dim objAgent As New MyDLL.Agent()

'Set the hostname (Omit if local)
objAgent.Host = "
End Class
---------
the error that I'm seeing is the "Declaration Expected" on the objAgent.Host line.

I'm sure it's obvious, but what am I missing?

Thanks in advance,
~L
 
1.) Wow, how'd that get there? No, not in my code... Thanks for checking though.

2.) I'm using a (poorly documented) 3rd party DLL, so I'm not sure, but I don't think there is any code behind it. I believe it's just a Property associated with the Agent object.
 
if you type objAgent.Host(
does the intellisense show you anything for a parameter, and for that matter, does intellisense bring up MyDLL.Agent() as an option when you declare:
Dim objAgent As New MyDLL.Agent()

 
Gotcha --

MyDLL.Agent() -- yes
objAgent.Host() -- no
 
Does the third party vendor say anything about it supporting .NET or any known issues?
Can you give me the name of the tool you are trying to use?
 
The product is Latitude's MeetingPlace SDK (though MyDLL is not the actual name). I believe it was developed pre-.Net, but thought I'd try just in case.

The documentation has nothing about known issues, or, of course, about supporting .NET, though I will follow up with our contact at the vendor. The most relevant statement from the documentation is: "MyDLL is a dynamic link library (mydll.dll) that exposes the Agent Service through an exported procedural interface and a COM interface. This COM interface can be used to create ASP scripts instead of using the CGI executables, or it can be used with Visual Basic, Java or C++."

If, in fact, the SDK does not support .NET, do I have any other integration options? I believe it supports URL-encoding the parameters, but that seems kind of kludgey, and I'm not sure how to send HTTP requests from a VB.NET program... Is there a way to create a VB6.0 program to call the DLL and then reference that from my VB.NET Class -- or is that just as kludgey?
 
If you can NOT access the dll directly through .NET you might consider creating a small VB6 app/dll that makes calls to MyDll.

Then you just add the VB6 dll to your project, the wrapper takes over, and any NET/COM issues (related at least to your MyDll) should be more or less resolved.

I've had to do this with a couple of things and so far haven't run into too many issues (other than those typically dealt with related to COM; versioning, etc.).

Hope this helps.

O.
 
How difficult would it be to write your own class for the functionality you are getting out of the 3rd party tool? It seems that there is a lot of work and maintenance going to go in to making this work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top