Re: translating more stuff from C

Tech-Archive recommends: Fix windows errors by optimizing your registry



Ok, I've placed

/////
Public Delegate Sub GM_MessageCallbackFunc(ByVal aMessageText As String)

Public Declare Sub GM_SetMessageCallback Lib "GlobalMapperInterface" _
( _
ByVal aCallbackFunc As GM_MessageCallbackFunc _
)
/////

into a module. On a Form I've placed

/////
Private Sub HandleLoadError(ByVal sError As String)
Debug.Print(sError)
End Sub

Private Sub Load()
Dim MessageDelegate As GM_MessageCallbackFunc
MessageDelegate = AddressOf HandleLoadError
(...Attempt Data Loading...)
End Sub
/////

but my handling sub is never called. It should be, because unmanaged DLL that I'm making
calls to displays it's Load Error dialog box - which is what the Sub above is supposed to
supress and let the client handle instead. What have I done incorrectly?

Lance




"Mattias Sjögren" <mattias.dont.want.spam@xxxxxxxx> wrote in message
news:eaWTT6uxGHA.1300@xxxxxxxxxxxxxxxxxxxxxxx
how do I translate this to VB2005 and then actually use it?

Try this:

Delegate Sub GM_MessageCallbackFunc(aMessageText As String)

Declare Sub GM_SetMessageCallback Lib "your.dll" (aCallbackFunc As
GM_MessageCallbackFunc)


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.


.



Relevant Pages

  • Re: Playing an AVI video
    ... You'd use the "window avi handle" MCI command string. ... Dim mlRet As Long ... Private Sub CenterObject ...
    (microsoft.public.vb.general.discussion)
  • Re: Multi-image Bitmap Extraction
    ... Private Sub Form_Load ... cFileName As String * MAX_PATH ... Dim WFD As WIN32_FIND_DATA, hFile As Long ...
    (microsoft.public.vb.general.discussion)
  • Re: Working Transactions somehow started not to work
    ... ÖA> Private Sub Form_Open ... ÖA> Dim strSqlMain As String ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Custom textbox in Userform
    ... Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ... Function IsValid(strText As String) As Boolean ...
    (microsoft.public.excel.programming)
  • Project Error
    ... Private Declare Sub Sleep Lib "Kernel32" ... Dim strDataSrc As String ...
    (microsoft.public.vb.bugs)