CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    2

    How to call a function by a pointer to that function?

    In C++, I can call a function in dll like this:
    hModule = LoadLibrary(szDllName);
    pfnProc = (FARPROC*)GetProcAddress(hModule, szProcName)
    pfnProc();


    But in vb, can I call a function like above.(through a function pointer from a GetProcAddress call.)


  2. #2
    Guest

    Re: How to call a function by a pointer to that function?

    in VB you can use the AddressOf operator to retrieve the address of a VB sub or function. You cannot call that function as in C, but you can pass the address to an API function that takes a function address as a parameter. This is usually done in subclassing.


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

Featured