c - Error accessing 64bit DLL function -
i have created 64bit dll file using microsoft visual studio 2015. visual c --> win32 project.
the code squaremain.c follows :
long _stdcall square(long a) { return a*a; }
the code defile.def follows :
library "square" exports squareforexl=square
i have build dll using configuration manager settings set platform , active solution platform x64 64bit dll.
i have access dll functions through excel vba7. function in vba follows :
private declare ptrsafe function squareforexl lib "c:\math.dll" (byval x long) long sub square() dim b long b = 5 dim c long debug.print b c = squareforexl(b) debug.print "square : " & c end sub
while trying access dll function squareforexl() in code above, shows following error msgbox:
run time error '53': file not found :"c:\math.dll"
i have tried placing file in different location directories, in systems folder.
i have compiled , executed 32bit dll on in 32 bit version of office. question how can access dll functions 64 bit dll in 64 bit version of office ?
Comments
Post a Comment