FAQ
I can not load a Windows function call, but I have not problem in loading
the another one, and according to the documentation both calls need the
same requirements (I'm using Windows XP)

package main

import (
"syscall"
)

var (
modkernel32 = syscall.MustLoadDLL("kernel32.dll")

procGetConsoleMode = modkernel32.MustFindProc("GetConsoleMode")
procReadConsoleInput = modkernel32.MustFindProc("ReadConsoleInput")
)

panic: Failed to find ReadConsoleInput procedure in kernel32.dll: The
specified
procedure could not be found.

* * *
GetConsoleMode:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms683167%28v=vs.85%29.aspx
ReadConsoleInput:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms684961%28v=vs.85%29.aspx

Search Discussions

  • Maxim Khitrov at Sep 8, 2012 at 5:55 pm

    On Sat, Sep 8, 2012 at 1:24 PM, Archos wrote:
    I can not load a Windows function call, but I have not problem in loading
    the another one, and according to the documentation both calls need the same
    requirements (I'm using Windows XP)

    package main

    import (
    "syscall"
    )

    var (
    modkernel32 = syscall.MustLoadDLL("kernel32.dll")

    procGetConsoleMode = modkernel32.MustFindProc("GetConsoleMode")
    procReadConsoleInput = modkernel32.MustFindProc("ReadConsoleInput")
    )
    ReadConsoleInput is a #define that resolves (during normal C/C++
    compilation) to either ReadConsoleInputA or ReadConsoleInputW,
    depending on the Unicode settings. When loading this function
    directly, you must specify which version you want to use.

    - Max
  • Archos at Sep 8, 2012 at 5:56 pm
    I didn't know about it, thanks

    El sábado, 8 de septiembre de 2012 18:49:29 UTC+1, Maxim Khitrov escribió:
    On Sat, Sep 8, 2012 at 1:24 PM, Archos <raul...@sent.com <javascript:>>
    wrote:
    I can not load a Windows function call, but I have not problem in loading
    the another one, and according to the documentation both calls need the same
    requirements (I'm using Windows XP)

    package main

    import (
    "syscall"
    )

    var (
    modkernel32 = syscall.MustLoadDLL("kernel32.dll")

    procGetConsoleMode = modkernel32.MustFindProc("GetConsoleMode")
    procReadConsoleInput = modkernel32.MustFindProc("ReadConsoleInput")
    )
    ReadConsoleInput is a #define that resolves (during normal C/C++
    compilation) to either ReadConsoleInputA or ReadConsoleInputW,
    depending on the Unicode settings. When loading this function
    directly, you must specify which version you want to use.

    - Max

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedSep 8, '12 at 5:24p
activeSep 8, '12 at 5:56p
posts3
users2
websitegolang.org

2 users in discussion

Archos: 2 posts Maxim Khitrov: 1 post

People

Translate

site design / logo © 2022 Grokbase