Jump to content

Problem with DllCall


jbc1
 Share

Recommended Posts

Hi,

I have a problem when using DllCall. It keeps giving me the error, 'Function not found in Dll'.

Here is the signiture of the function I am trying to call:

PVOID EXPORT WINAPI OpenChannel(void)

Here is my AutoIT code:

$result = DllCall("caccount.dll", "ptr", "OpenChannel")
    
    If @error Then
        If @error = 1 Then
            MsgBox(1, "DllCall Error - 1", "Unable to use the DLL file")
            Return
        EndIf
        
        If @error = 2 Then
            MsgBox(1, "DllCall Error - 2", "Unknown return type")
            Return
        EndIf
        
        If @error = 3 Then
            MsgBox(1, "DllCall Error - 3", "Function not found in the DLL file")
            Return
        EndIf
    Else
        MsgBox(0, "Num Chars Returned", $result[0])   ; number of chars returned
    EndIf

Can anybody give me some advice on this?

Thanks

Link to comment
Share on other sites

All is said. There is no such function in caccount.dll.

Find some tool to view exported functions. There are at least two posted as AutoIt scripts. One by monoceres (this one) and other by trancexx (yes, that would be me) - link.

I have the actual C++ code, the function does exist. So my AutoIT code is correct?

Link to comment
Share on other sites

Are you sure? Try checking with mine or trancexx tool anyway; because if this is the entire function prototype:

PVOID EXPORT WINAPI OpenChannel(void)

then I suspect you will be surprised when you see what the export viewer actually says.

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

Are you sure? Try checking with mine or trancexx tool anyway; because if this is the entire function prototype:

PVOID EXPORT WINAPI OpenChannel(void)

then I suspect you will be surprised when you see what the export viewer actually says.

I looked at the DLL using trancexx resource viewer and also PE Explorer, it looks like this under 'Exported Functions' in both applications:

_OpenChannel@0

How would I call this correctly?

Link to comment
Share on other sites

Fantastic news

Did you understand the sarcasm in monoceres' post? :D Why not simply take the name shown by PEExplorer? Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Did you understand the sarcasm in monoceres' post? :D Why not simply take the name shown by PEExplorer?

Yes I understood it quite well thank you. I find these forums get more immature each time I come.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...