Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
User input for import data function PsyberFox Excel Discussion (Misc queries) 0 March 26th 09 07:00 AM
Change delimiter in import function from comma to tab marksince1984[_7_] Excel Programming 1 June 13th 06 05:38 AM
deleting line item in import function causes REF# error Jen Excel Worksheet Functions 1 April 13th 06 02:24 AM
Import external data function Michael Schultz Excel Discussion (Misc queries) 1 January 12th 05 04:38 PM
When I Import an Access Table With an Excel Function in a Cell it Displays as Text not as a Function in Excel Niek Otten Excel Programming 2 September 18th 03 03:55 AM


All times are GMT +1. The time now is 03:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"