Hi all,

I have a program I'm writing in VBA for work. I have built a DLL, but it seems that I'm not accessing the functions. I have tried "user32" with messageboxw and was able to get the address. This tells me that there is something wrong with the compilation of the DLL, or some other reason.

I'm not sure what's going on and would appreciate some input. Below are the sections of code that I am using. The first is the DLL defines, and the second is the loadlibrary code in VBA.

Code:
#pragma once

#ifdef EPIQUTIL_EXPORTS
#define EPIQUTIL_API __declspec(dllexport)
#else
#define EPIQUTIL_API __declspec(dllimport)
#endif

// The functions needed to interface with VBA EPIQ Utils

// This function must be called before any other function.
extern "C" EPIQUTIL_API void EPIQ_init(const long MyWaitTime);


----------------------------------------------------------------------------

Calling routine.

    Dim ProcAddress As LongPtr
    Dim hinstLib As LongPtr
    Dim hFreeLib As LongPtr
    Dim szFunc As String
    
    hinstLib = 0
    ProcAddress = 0
    hFreeLib = 0
    ' Get a handle to the DLL module.
'    If (bUseLibrary = True) Then
'        Call SetEnvironmentVariable("PATH", "C:\Users\epperbx\source\repos\EPIQ Util DLL\x64\Debug")
        hinstLib = LoadLibrary("C:\Users\epperbx\source\repos\EPIQ Util DLL\Debug\EPIQ Util.dll")
 
        ' If the handle is valid, try to get the function address.
    
'        If (hinstLib <> Null) Then
'            szFunc = "EPIQ_Init"
            ProcAddress = GetProcAddress(hinstLib, "EPIQ_init")
            
            hFreeLib = FreeLibrary(hinstLib)
Every little bit of information is very helpful.