Results 1 to 4 of 4

Thread: import function by ordinal

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2002
    Posts
    4

    import function by ordinal

    how can i import function by ordinal?

  2. #2

    Thread Starter
    New Member
    Join Date
    Apr 2002
    Posts
    4

    Unhappy Access Violation

    The same error i was getting before
    Unhandled exeption in app.exe:0xc0000005: Access Violation

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Have you tested if the return value is NULL?
    Never rely that GetProcAddress will return a valid address.

    Use the dependency walker (supplied with VC++) to find out if the dll really exports the function you're searching for.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4

    Thread Starter
    New Member
    Join Date
    Apr 2002
    Posts
    4

    Question hmm

    well i got it working the problem wasn't where i thought it to be.
    i had this line
    pfunc=(FARPROC (__stdcall *) (HWND, int, int, char*, char*, int))GetProcAddress(GetModuleHandle("SHELL32.DLL"),(char*)(0x3d));
    i guess the GetModuleHandle("SHELL32.DLL") was wrong here
    (don't know why) but it works this way
    pfunc=(FARPROC (__stdcall *) (HWND, int, int, char*, char*, int))GetProcAddress(LoadLibrary("SHELL32.DLL")
    char*)(0x3d));

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