Application Fails when executable is clicked, but runs fine in IDE

J

jr

I've built an app that uses the Groupwise (email client) API. It will
perform as expected when I hit F5, everything is good, when I use
ctrl+F5 it fails with an access violation (see below). I tried to used
JIT debugging, but I never get to see the source code, just the
assembly. The app *never* fails with this error when run in the IDE.
Groupwise documentation is sparse.

Also the Groupwise API is referenced through a dll which is a COM
object which I added into the project 'references'.


What gives, how can I get past this? Let me know if there's any other
info I can post. Many Thanks-

************** Exception Text **************
System.AccessViolationException: Attempted to read or write protected
memory. This is often an indication that other memory is corrupt.
at groupwise.Form1.Form1_Load(Object sender, EventArgs e) in
C:\Documents and Settings\jriggs\My Documents\Visual Studio
2005\Projects\groupwise\groupwise\Form1.vb:line 22
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
groupwise
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase:
file:///C:/Documents%20and%20Settings/jriggs/My%20Documents/Visual%20Stu
dio%202005/Projects/groupwise/groupwise/bin/Release/groupwise.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f
5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/Sy
stem.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5
c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d
50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5
f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e08
9/System.Xml.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b7
7a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
Interop.GroupwareTypeLibrary
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase:
file:///C:/Documents%20and%20Settings/jriggs/My%20Documents/Visual%20Stu
dio%202005/Projects/groupwise/groupwise/bin/Release/Interop.GroupwareTyp
eLibrary.DLL
----------------------------------------
 
K

kimiraikkonen

I've built an app that uses the Groupwise (email client) API. It will
perform as expected when I hit F5, everything is good, when I use
ctrl+F5 it fails with an access violation (see below). I tried to used
JIT debugging, but I never get to see the source code, just the
assembly. The app *never* fails with this error when run in the IDE.
Groupwise documentation is sparse.

Also the Groupwise API is referenced through a dll which is a COM
object which I added into the project 'references'.

What gives, how can I get past this? Let me know if there's any other
info I can post. Many Thanks-

************** Exception Text **************
System.AccessViolationException: Attempted to read or write protected
memory. This is often an indication that other memory is corrupt.
at groupwise.Form1.Form1_Load(Object sender, EventArgs e) in
C:\Documents and Settings\jriggs\My Documents\Visual Studio
2005\Projects\groupwise\groupwise\Form1.vb:line 22
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
groupwise
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase:
file:///C:/Documents%20and%20Settings/jriggs/My%20Documents/Visual%20Stu
dio%202005/Projects/groupwise/groupwise/bin/Release/groupwise.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f
5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/Sy
stem.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5
c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d
50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5
f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e08
9/System.Xml.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b7
7a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
Interop.GroupwareTypeLibrary
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase:
file:///C:/Documents%20and%20Settings/jriggs/My%20Documents/Visual%20Stu
dio%202005/Projects/groupwise/groupwise/bin/Release/Interop.GroupwareTyp
eLibrary.DLL
----------------------------------------

What do you mean by calling runs fine in IDE? Have you run in debug
mode?
 
J

jr

kimiraikkonen said:
What do you mean by calling runs fine in IDE? Have you run in debug
mode?

If I open Visual Studio, open the project, and click the Green Arrow in
the top toolbar, the application will run fine. But when I build the
app and try to run the .exe in the bin directory, I get the above
error. Does that explain?

--
 
K

kimiraikkonen

If I open Visual Studio, open the project, and click the Green Arrow in
the top toolbar, the application will run fine. But when I build the
app and try to run the .exe in the bin directory, I get the above
error. Does that explain?

--

This green arrow does mean that the app's being"debugged". You should
be able to see the same error in debug mode if you didn't edit within
your app something unsual during runtime.

Your error message says:"Attempted to read or write protected
memory. This is often an indication that other memory is corrupt." I
have no point-idea on this message which may mean more than one thing.
Maybe you'd better Googling the message or API doumentation, faq.
 
A

Armin Zingler

jr said:
at groupwise.Form1.Form1_Load(Object sender, EventArgs e) in
C:\Documents and Settings\jriggs\My Documents\Visual Studio
2005\Projects\groupwise\groupwise\Form1.vb:line 22

What's in line 22 in Form1.vb?


Armin
 
J

jr

Dim oFolders As GroupwareTypeLibrary.Folders

Dim oMessages As GroupwareTypeLibrary.Messages
Dim oMessage As GroupwareTypeLibrary.Message

Dim oAttachments As GroupwareTypeLibrary.Attachments
Dim oAttachment As GroupwareTypeLibrary.Attachment

Dim oAcct As GroupwareTypeLibrary.Account
Dim oGW As New GroupwareTypeLibrary.Application <--errors here
I think


oAcct = ogw.Login
oFolders = oAcct.AllFolders

For Each fld As GroupwareTypeLibrary.Folder In oFolders
'etc
next



interestingly, using generic objects will give a different error

Dim oFolders As Object

Dim oMessages As Object
Dim oMessage As Object

Dim oAttachments As Object
Dim oAttachment As Object

Dim oAcct As Object

Dim ogw As Object
ogw = CreateObject("NovellGroupWareSession")

gives me:

System.Exception: Cannot create ActiveX component.

Also I tried to use regsvr32 to register the dll, but it was unable
'the DllServerEntryPoint' was not found

Armin said:
What's in line 22 in Form1.vb?


Armin



--
 
A

Armin Zingler

jr said:
Dim oFolders As GroupwareTypeLibrary.Folders

Dim oMessages As GroupwareTypeLibrary.Messages
Dim oMessage As GroupwareTypeLibrary.Message

Dim oAttachments As GroupwareTypeLibrary.Attachments
Dim oAttachment As GroupwareTypeLibrary.Attachment

Dim oAcct As GroupwareTypeLibrary.Account
Dim oGW As New GroupwareTypeLibrary.Application <--errors
here I think

Hmm.. I have no idea currently.


Armin
 
J

jr

Yeah, the API is pretty sketchy in general, I suppose something to do
the fact that it's a COM object, I'm probably going to post something
over on novell's server, but they seem pretty windows unfriendly..

I did manage to find a work around for now. If I put the variable
initializations in the form_load event in a try/catch block (they will
throw an error when run as an .exe), ignore the error and use the same
vars later on in the app it works no problems. Weird huh? Thanks for
reading!

-jr

Hmm.. I have no idea currently.


Armin



--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top