Форум АНТИЧАТ

Форум АНТИЧАТ (https://forum.antichat.xyz/index.php)
-   С/С++, C#, Delphi, .NET, Asm (https://forum.antichat.xyz/forumdisplay.php?f=24)
-   -   проблема с GetProcAddress (https://forum.antichat.xyz/showthread.php?t=89191)

fire64 26.10.2008 20:51

проблема с GetProcAddress
 
почему не компилится код ?
я хочу вызвать функцию в dll файле

PHP код:

#include <stdio.h>
#include <windows.h>
int mainint argccharargv[] )
{
    
HMODULE steamDLL;
    
steamDLL LoadLibrary("steam.dll");
    if ( !
steamDLL)
    {
        
MessageBox0"Steam.DLL Not Found""Launcher Error"MB_OK );
    }
    
FARPROC SteamLogin GetProcAddress(steamDLL"SteamLogin");
    const 
charUser "user";
    const 
charPassword "12345";    
    
int isSecureComputer 0;
    
SteamLoginUserPasswordisSecureComputerNULL);
      return 
0;


в результате я получаю ошибку
error C2197: 'int (__stdcall *)(void)' : too many actual parameters

bons 26.10.2008 21:41

ты неправильно описал функцию SteamLogin
если она у тебя вызывается как C-функция(cdecl) то ее надо описать примерно так
Код:

typedef void (*DLLPROC)(char* user, char* pass, int isSecure, void* hz);
...
DLLPROC SteamLogin = GetProcAddress(steamDLL, "SteamLogin");



Время: 14:47