Results 1 to 8 of 8

Thread: Calling a System32 file like advapi32.dll?

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Posts
    7

    Calling a System32 file like advapi32.dll?

    Im trying to call this dll in the system32 dir. but with know luck!!

    this is a web app the asp is calling MY GenCrypto.dll and this dll calles advapi32.dll from the system32 dir

    error's like = "he system cannot find the file specified"

    or "dependencies missing for GenCrypto.dll"

    Sample code


    Private Declare Function CryptAcquireContext Lib "advapi32.dll" Alias "CryptAcquireContextW"(ByRef phProv As Integer, ByRef pszContainer As Byte, ByRef pszProvider As Byte, ByVal dwProvType As Integer, ByVal dwFlags As Integer) As Integer

    this code fails with "The system cannot find the file specified"

    what's missing, security, a link, to the oject, or am i just stupid?

    the same dll code has been built for an GenCrypto.exe (works fine) and the dll being called by the web app not working..

    Thanks

  2. #2
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    The "cannot find file" error is suspicious - it may be that the way the dll is being invoked isn't able to locate advapi32.dll because in some way it requires a system environment variable? Why don't you see what happens if you specify the full path/filename for advapi32.dll.

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Posts
    7
    Slow_Learner thanks for the help...

    this is the same error evertime.

    File or assembly name CasinoUtils2003, or one of its dependencies, was not found

    asp calls -------->
    CasinoUtils2003.dll calls ------>
    GenCrypto.dll and this is were advapi32.dll and kernel32.dll is being called from.

    i changed the call to :

    Private Declare Function CryptAcquireContext Lib "C:\\WINNT\\System32\\advapi32.dll" Alias "CryptAcquireContextW" (ByRef phProv As Integer, ByRef pszContainer As Byte, ByRef pszProvider As Byte, ByVal dwProvType As Integer, ByVal dwFlags As Integer) As Integer

    same error
    thanks

  4. #4
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    Well what about the declare for CasinoUtils2003.dll? The error seems to indicate that's the file that can't be found, before you get to the call for advapi32.dll. Why don't you try specifying the full path for >that< call?

  5. #5
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    That's a real shot in the dark - I suck at API programming in general, and have no experience with ASP. But I really think that "file not found" is suspicious, it seems like it would be something simple.

  6. #6

  7. #7

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Posts
    7
    thanks again Slow_Learner

    the webapps dll's were built with vb6 and all works fine.

    trying to upgraded to vb.net so these dll's are not working ...

    the basics i understand (i think) it converting it to vb.net
    thats started this problem..

  8. #8
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    if u upgraded them to .NET then u cant use the API method of invoking them but must use REFLECTION or add a reference to them or if u're using vb.net them you can use Activator.CreateInstance() and then use late binding to use it's methods
    \m/\m/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width