By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,515 Members | 1,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,515 IT Pros & Developers. It's quick & easy.

System.DllNotFound Exception

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a

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 discussion thread is closed

Replies have been disabled for this discussion.