473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

System.DllNotFound Exception

AP
Hello, I am trying to register a dll so that I can call functions from it
within vb.net.
I have used the command "regsvr32 game.dll" which diplays a message box
saying DllRegisterServer in Game.dll suceeded.

In my VB.net application, I have added the following function to a module.

Declare Auto Sub CGL Lib "Game.dll" _
Alias "CreateGameLevel" (ByVal s As Integer)

When I try to run the program with the code CGL(1) placed in the Form load
method, I get an System.DllNotFound Exception, unable to load dll.
Why is this message appearing after windows has successfully registered the
dll, what am I doing wrong?

Thanks
AP

Nov 21 '05 #1
3 2168
Hello AP

API declaration like

Declare Auto Sub CGL Lib "Game.dll" _
Alias "CreateGameLevel" (ByVal s As Integer)

is used for "native" dll`s you do not need to register them ( they are
written in C , C++ ) the dll muct be in the system directory or in the
application path

dll`s that need to be registred with regsvr32.dll ( needed for install
location , and classid lookup ) are dll`s with a std ole interface (
Activex / COM / idispatch ) these dll`s need to be referenced in your
project .

project explorer , references , select the COM tab , press browse and
select the dll , now in you project you can access the property`s and
methods with the following syntax

private nameyoulike as new yourclassname

if the class exposes events

private withevents nameyoulike as new yourclassname
hth

M. Posseth
"AP" <no@no.com> wrote in message news:Uq********************@pipex.net...
Hello, I am trying to register a dll so that I can call functions from it
within vb.net.
I have used the command "regsvr32 game.dll" which diplays a message box
saying DllRegisterServer in Game.dll suceeded.

In my VB.net application, I have added the following function to a module.

Declare Auto Sub CGL Lib "Game.dll" _
Alias "CreateGameLevel" (ByVal s As Integer)

When I try to run the program with the code CGL(1) placed in the Form load
method, I get an System.DllNotFound Exception, unable to load dll.
Why is this message appearing after windows has successfully registered
the dll, what am I doing wrong?

Thanks
AP

Nov 21 '05 #2
AP
Thanks for the info. I have used your code, but I get an error saying that
the object isnt initialised.
How do I initialise the object with a running instance?
What do I need to pass as a parameter for the getObject() function? Name of
the dll? Name of the class? Title of the window?

Thanks
AP

"m.posseth" <mi*****@nohausystems.nl> wrote in message
news:uM**************@TK2MSFTNGP15.phx.gbl...
Hello AP

API declaration like

Declare Auto Sub CGL Lib "Game.dll" _
Alias "CreateGameLevel" (ByVal s As Integer)

is used for "native" dll`s you do not need to register them ( they are
written in C , C++ ) the dll muct be in the system directory or in the
application path

dll`s that need to be registred with regsvr32.dll ( needed for install
location , and classid lookup ) are dll`s with a std ole interface (
Activex / COM / idispatch ) these dll`s need to be referenced in your
project .

project explorer , references , select the COM tab , press browse and
select the dll , now in you project you can access the property`s and
methods with the following syntax

private nameyoulike as new yourclassname

if the class exposes events

private withevents nameyoulike as new yourclassname
hth

M. Posseth
"AP" <no@no.com> wrote in message news:Uq********************@pipex.net...
Hello, I am trying to register a dll so that I can call functions from it
within vb.net.
I have used the command "regsvr32 game.dll" which diplays a message box
saying DllRegisterServer in Game.dll suceeded.

In my VB.net application, I have added the following function to a
module.

Declare Auto Sub CGL Lib "Game.dll" _
Alias "CreateGameLevel" (ByVal s As Integer)

When I try to run the program with the code CGL(1) placed in the Form
load method, I get an System.DllNotFound Exception, unable to load dll.
Why is this message appearing after windows has successfully registered
the dll, what am I doing wrong?

Thanks
AP


Nov 21 '05 #3

in wich language is the dll written ? ,,,,, because if it has a ole
interface ( win 32 non native windows ) you should use the functionality as
i showed however if this dll is written in a .Net language and does not
enforce an exposed COM interface you must set a .Net reference ( the first
tab instead of the second COM tab )

regrds

Michel Posseth
"AP" <no@no.com> wrote in message news:LP********************@pipex.net...
Thanks for the info. I have used your code, but I get an error saying that
the object isnt initialised.
How do I initialise the object with a running instance?
What do I need to pass as a parameter for the getObject() function? Name
of the dll? Name of the class? Title of the window?

Thanks
AP

"m.posseth" <mi*****@nohausystems.nl> wrote in message
news:uM**************@TK2MSFTNGP15.phx.gbl...
Hello AP

API declaration like

Declare Auto Sub CGL Lib "Game.dll" _
Alias "CreateGameLevel" (ByVal s As Integer)

is used for "native" dll`s you do not need to register them ( they are
written in C , C++ ) the dll muct be in the system directory or in the
application path

dll`s that need to be registred with regsvr32.dll ( needed for install
location , and classid lookup ) are dll`s with a std ole interface (
Activex / COM / idispatch ) these dll`s need to be referenced in your
project .

project explorer , references , select the COM tab , press browse and
select the dll , now in you project you can access the property`s and
methods with the following syntax

private nameyoulike as new yourclassname

if the class exposes events

private withevents nameyoulike as new yourclassname
hth

M. Posseth
"AP" <no@no.com> wrote in message
news:Uq********************@pipex.net...
Hello, I am trying to register a dll so that I can call functions from
it within vb.net.
I have used the command "regsvr32 game.dll" which diplays a message box
saying DllRegisterServer in Game.dll suceeded.

In my VB.net application, I have added the following function to a
module.

Declare Auto Sub CGL Lib "Game.dll" _
Alias "CreateGameLevel" (ByVal s As Integer)

When I try to run the program with the code CGL(1) placed in the Form
load method, I get an System.DllNotFound Exception, unable to load dll.
Why is this message appearing after windows has successfully registered
the dll, what am I doing wrong?

Thanks
AP



Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Matthias Ludwig | last post by:
I'm trying to create a directory on the web server with a vb.net code: .... Dim dirName As String = "w:\filepath\images" If Not Directory.Exists(dirName) Then...
2
by: Paul Gronka | last post by:
I've got a VB.NET windows application (written in VS .NET 2003) that makes a call to WMI for retrieving the MAC Address from the client's PC. It works on 4 out of the 5 PC's tested so far. All...
5
by: Vitling | last post by:
For no apparent reason, a NullReference exception is thrown in system.dll (System.Net.Sockets.OverlappedAsyncResult.CompletionPortCallback). Since I only get a disassembly from Visual Studio, it...
4
by: Bhavya Shah | last post by:
Hello, I am facing a very strange problem in my application. I have a form on which I select a path. I open the FolderBrowserDialog for path selection. Once the path is selected I press a button...
22
by: EP | last post by:
When running my asp.net hosting service (asp.net without IIS), on server 2003 with IIS not installed, I get the following when trying to process a request. "System.DllNotFoundException: Unable to...
0
by: John.Luckowsky | last post by:
Hello all, I've moved my old ASP1.1 with WSE2.0 SP3 to ASP2.0 and have found strange error which raises spontaneously. Here is the stack trace: System.InvalidOperationException Message: The...
2
by: koredump | last post by:
Hi all, I have a windows app that makes some asyc calls to my webservice (WSE 3.0 with MTOM). exception gets thrown in the client win app. This exception is being thrown on another thread by a...
5
by: scheidel21 | last post by:
I am writting a DB front end in VB.NET 2003 I have a form that displays employee information it has a dataset loaded from the DB that also includes tables for lookup in some comboboxes that are...
2
by: pedrito | last post by:
I've got an app that downloads from several concurrent threads. Occasionally, I get an expcetion trying to read the HttpWebResponse stream... Sorry, the code isn't short, but I figured best to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.