I am having difficulty implimenting WinSparkle into my
vb.net
application (VS 2010 professional,
Window 7 Enterprise on a 64bit Dell).
I have created a WinSparkle class to expose the WinSparkle.dll (see
below).
Then, call the WinSparkle functions in the main_load subroutine (see
below).
When the "WinSparkle.win_sparkle_set_appcast_url(<url name>) is
executed,
a "PInvokeStackImbalance was detected" error occurs.
I have exausted all my ideas to solve the problem and am guessing it
is a very simple
solution.
Thank you
Mark Hansen
------------------------------------- WinSparkle Class
---------------------------
Imports System
Imports System.Runtime.InteropServices
Public Class WinSparkle
<DllImport("WinSparkle.dll")> _
Public Shared Function win_sparkle_init() As Boolean
End Function
<DllImport("WinSparkle.dll")> _
Public Shared Function win_sparkle_cleanup() As Boolean
End Function
<DllImport("WinSparkle.dll")> _
Public Shared Function win_sparkle_set_appcast_url(ByVal url As
String) As Boolean
End Function
<DllImport("WinSparkle.dll")> _
Public Shared Function win_sparkle_set_app_details(ByVal
company_name As String, ByVal app_name As String) As Boolean
End Function
<DllImport("WinSparkle.dll")> _
Public Shared Function win_sparkle_set_registry_path(ByVal path As
String) As Boolean
End Function
<DllImport("WinSparkle.dll")> _
Public Shared Function win_sparkle_check_update_with_ui() As
Boolean
End Function
End Class
---------------------------------------------------------------------------------
----------------------------
MAIN_Load--------------------------------------
Option Strict Off
Option Explicit On
Imports System.IO.Ports
Imports System.IO.Ports.SerialPort
Imports VB = Microsoft.VisualBasic
Friend Class CO2calcMain
Inherits System.Windows.Forms.Form
Public comm As New CommManager()
Dim frmM As frmMain
Dim bDMS, BtPAdjust As Boolean
Dim GGAs As String
Private Sub CO2AppMain_Load(ByVal eventSender As System.Object,
ByVal eventArgs As System.EventArgs) Handles MyBase.Load
Try
Dim SparkUrl As String = "
http://coastal.er.usgs.gov/
appcast/CO2calc_win_appcast.xml"
Dim bTF As Boolean
bTF = WinSparkle.win_sparkle_set_appcast_url(SparkUrl)
bTF = WinSparkle.win_sparkle_init()
bTF = WinSparkle.win_sparkle_check_update_with_ui()
' ... more code would go here...
' ... somewhere as you leave your app
bTF = WinSparkle.win_sparkle_cleanup()
...
-------------------------------------------------------------