Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
add-in / dll import function
hi,
i have developped an add-in that exports some functions to the excel api throw the excel4(xlfregister..) function. But i need to export some other functions that are defined in another dll (linked to the add-in). i didn't success to make it work. someone has an idea about what should be done for that? many thanks in advance youssma |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
add-in / dll import function
You are probably having an issue in the way you compiled the addi-ins. There are two methods used for calling a routine. The "standard microsoft method" and the "C-Language method". Depending on the compiler options and the declarations of the function how the functions are called. Often DLLs have multiple netry points for the same function which provides compatibility for being called from bot methods. I think the solution is in the 1st DLL make sure you define the 2nd Dll functions using the correct method. -- joel ------------------------------------------------------------------------ joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=150545 Microsoft Office Help |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
add-in / dll import function
On 3 nov, 19:20, joel wrote:
You are probably having an issue in the way you compiled the addi-ins. There are two methods used for calling a routine. *The "standard microsoft method" and the "C-Language method". *Depending on the compiler options and the declarations of the function how the functions are called. *Often DLLs have multiple netry points for the same function which provides compatibility for being called from bot methods. I think the solution is in the 1st DLL make sure you define the 2nd Dll functions using the correct method. -- joel ------------------------------------------------------------------------ joel's Profile:http://www.thecodecage.com/forumz/member.php?userid=229 View this thread:http://www.thecodecage.com/forumz/sh...d.php?t=150545 Microsoft Office Help hi joel, thanks for your answer. do you mean that i need to duplicate the declarations of my functions in the xll and make an explicite (or implicite call) from them to the functions declared in my dll? this will make the calling process slow. i was wonderning if there was a solution that enables me to register my functions from the dlll directly to the excel menu interface. youssma |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
add-in / dll import function
first you still have to solve your inital calling problem if you where going to create an add-in to be loaded into excel. Second, I think you are wrongg with the speed issue. If you don't declare a variable in VBA is is assumed to be a variant. When you have variants excels can learn from the object(s) the properties but this takes longer the first time you call the code. Here is an example of the declaration statement when calling a dll from VBA Public Declare Function FtpGetFile Lib "wininet.dll" Alias "FtpGetFileA" _ (ByVal hFtpSession As Long, ByVal lpszRemoteFile As String, _ ByVal lpszNewFile As String, ByVal fFailIfExists As Boolean, ByVal dwFlagsAndAttributes As Long, _ ByVal dwFlags As Long, ByVal dwContext As Long) As Boolean The calling process use the Microsoft Standard method for creatting the call stack. Most compilers on windos have options to either compile the code as Standard or C-Language. If you don't understand tthe difference see this article 'Calling convention - Wikipedia, the free encyclopedia' (http://en.wikipedia.org/wiki/Calling_convention) -- joel ------------------------------------------------------------------------ joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=150545 Microsoft Office Help |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
add-in / dll import function
On 19 nov, 12:14, joel wrote:
first you still have to solve your inital calling problem if you where going to create an add-in to be loaded into excel. *Second, I think you are wrongg with the speed issue. *If you don't declare a variable in VBA is is assumed to be a variant. *When you have variants excels can learn from the object(s) the properties but this takes longer the first time you call the code. Here is an example of the declaration statement when calling a dll from VBA Public Declare Function FtpGetFile Lib "wininet.dll" Alias "FtpGetFileA" _ (ByVal hFtpSession As Long, ByVal lpszRemoteFile As String, _ ByVal lpszNewFile As String, ByVal fFailIfExists As Boolean, ByVal dwFlagsAndAttributes As Long, _ ByVal dwFlags As Long, ByVal dwContext As Long) As Boolean The calling process use the Microsoft Standard method for creatting the call stack. *Most compilers on windos have options to either compile the code as Standard or C-Language. *If you don't understand tthe difference see this article 'Calling convention - Wikipedia, the free encyclopedia' (http://en.wikipedia.org/wiki/Calling_convention) -- joel ------------------------------------------------------------------------ joel's Profile:http://www.thecodecage.com/forumz/member.php?userid=229 View this thread:http://www.thecodecage.com/forumz/sh...d.php?t=150545 Microsoft Office Help i'm trying to use the c-language calling procedure by using an xll to load my function in the excel menu. i succeded to load functions that are declared in the xll i'm using but my question is about loading throw this xll, functions that are declared in an other dll. anyway, thank you for your answers. i'll search deeply on that. many thanks regards, youssma |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
add-in / dll import function
As I said before. The DLL need two function. One when called from C-Language and one from VBA. Something like this Myfunction(c language parameter list) 'You code here end MyfunctionA(standard parameter list) 'enter any conversion code required. Call Myfunction(C language paremter list) end Call Myfunction when using from C -language. Call MyfunctionA when calling from VBA. This is what the standard Dll's to in the windows/system32 folder. -- joel ------------------------------------------------------------------------ joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=150545 Microsoft Office Help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
User input for import data function | Excel Discussion (Misc queries) | |||
Change delimiter in import function from comma to tab | Excel Programming | |||
deleting line item in import function causes REF# error | Excel Worksheet Functions | |||
Import external data function | Excel Discussion (Misc queries) | |||
When I Import an Access Table With an Excel Function in a Cell it Displays as Text not as a Function in Excel | Excel Programming |