[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Help-glpk] VBA/dll for Excel
From: |
Meketon, Marc |
Subject: |
RE: [Help-glpk] VBA/dll for Excel |
Date: |
Tue, 18 Mar 2008 12:49:35 -0400 |
Thanks.
I produced a DLL as well by adding __stdcall __export to the right
function calls. [BTW, I'm using the free Turbo C++ compiler from
Borland.]
BUT, I cannot seem to get the callback function for "glp_term_hook" to
properly work. Before I begin to setup the problem, I use very similar
VBA code to what the Version 10 of the Informatiks software uses:
Const MAXMSG as long = 500
Private ActMsg as long
Private Messages(MAXMSG) as string
Public sub INIT_GLPK()
Dim info as long
info = 0
glp_term_hook AddressOf MessageHandler, info
ActMsg = 0
end sub
and
public function MessageHandler(ByVal info As Long, ByVal msg As Long)
As Long
Dim l As Long
Dim Err_Message As String
On Error Resume Next
If ActMsg < MAXMSG Then
ActMsg = ActMsg + 1
End If
l = lstrlen(msg)
Err_Message = Space$(l + 1)
lstrcpy Err_Message, msg
Err_Message = Left(Err_Message, l)
Messages(ActMsg) = Err_Message
MessageHandler = 1
End Function
However, when the "xputs" function in GLPK tries to return, the code
bombs. The "xputs" does call the "MessageHandler", and it seems to pass
in the correct string, and xputs does see the correct return. I believe
that somehow the stack gets messed up a bit, but I haven't figured out
any workaround.
Any ideas on how to successfully invoke the call-back function for the
terminal hook?
-Marc
-----Original Message-----
From: Xypron [mailto:address@hidden
Sent: Tuesday, March 18, 2008 10:53 AM
To: Meketon, Marc
Cc: address@hidden
Subject: Re: [Help-glpk] VBA/dll for Excel
Hello Marc,
couldn't You use the DLL produced by
w32/Build_GLPK_with_VC6_MT_DLL.bat
with Visual C++ 7.0 or 6.0?
(see ftp://glpk.dyndns.org/glpk/glpk_4_27.dll.tar.gz)
Best regards
Xypron
Meketon, Marc wrote:
>
> A while back there was a version of GLPK for VBA applications (such as
> in Excel). That was based on version 10 of GLPK. Does anyone work with
> GLPK in VBA with a recent version of the software? If so, can you
> please provide links? It appears that the original folks (Informatik
> Fuchs) do have a version 23, but it's on a CD for 50 euros, and there
> is no English page for it, so I'm not sure how possible it will be for
> me to get the CD.
>
> FYI, the German web page for the version 10 VBA implementation is:
> http://www.informatikfuchs.de/Software/GLPK/glpkVBDownload.htm (and
> there is a link for the English version of this web page on this
page).
>
> -Marc Meketon
>
>
------------------------------------------------------------------------
----
>
> This e-mail and any attachments may be confidential or legally
> privileged. If you received this message in error or are not the
> intended recipient, you should destroy the e-mail message and any
> attachments or copies, and you are prohibited from retaining,
> distributing, disclosing or using any information contained herein.
> Please inform us of the erroneous delivery by return e-mail.
>
> Thank you for your cooperation.
>
------------------------------------------------------------------------
----
>
>
------------------------------------------------------------------------
>
> _______________________________________________
> Help-glpk mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-glpk
>
----------------------------------------------------------------------------
This e-mail and any attachments may be confidential or legally privileged. If
you received this message in error or are not the intended recipient, you
should destroy the e-mail message and any attachments or copies, and you are
prohibited from retaining, distributing, disclosing or using any information
contained herein. Please inform us of the erroneous delivery by return e-mail.
Thank you for your cooperation.
----------------------------------------------------------------------------
- [Help-glpk] VBA/dll for Excel, Meketon, Marc, 2008/03/17
- Re: [Help-glpk] VBA/dll for Excel, Xypron, 2008/03/18
- RE: [Help-glpk] VBA/dll for Excel,
Meketon, Marc <=
- Re: [Help-glpk] VBA/dll for Excel, Andrew Makhorin, 2008/03/18
- Re: RE: [Help-glpk] VBA/dll for Excel, glpk xypron, 2008/03/18
- [Help-glpk] Hook needed in xfault(), glpk xypron, 2008/03/18
- Re: [Help-glpk] Hook needed in xfault(), Andrew Makhorin, 2008/03/19
- Re: [Help-glpk] Hook needed in xfault(), glpk xypron, 2008/03/19
- Re: [Help-glpk] Hook needed in xfault(), Andrew Makhorin, 2008/03/19
- Re: [Help-glpk] Hook needed in xfault(), glpk xypron, 2008/03/19
- Re: [Help-glpk] Hook needed in xfault(), Andrew Makhorin, 2008/03/19
RE: [Help-glpk] VBA/dll for Excel, Meketon, Marc, 2008/03/18