AOA AOA AOA Folding For Team 45 AOA Files Home Front Page Become an AOA Subscriber! UserCP Calendar Memberlist FAQ Search Forum Home


Go Back   AOA > Software > Programming and Assembly Language

Programming and Assembly Language Please read this Topic's rules!!

Reply
 
LinkBack Thread Tools Rate Thread
  #1 (permalink)  
Old 19th December, 2007, 01:45 PM
beno-the-baron's Avatar
Member
 
Join Date: July 2005
Posts: 9

VB-error with some CPP Dll methods in IDE but not compiled

Hi,
I've written a cpp dll to read/write encrypted files containing password and user data. Some of the contained functions are called by a VB programme which acts as a GUI. However, the Dll (or possibly VB) procedures somehow 'misbehave' and cause the VB IDE to CTD, but only when the programme is run by the IDE. I think it could be some file-access restriction, although I had a similar problem with a different method of the same Dll which went away after a few subtle changes.

Before I go into details, does anyone have any ideas how I could find out what this problem is, or debug the dll whilst calling it from the IDE? An explaination as to why VB might be more restrictive in IDE mode would also be helpful.

Thanks.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 19th December, 2007, 04:23 PM
Gizmo's Avatar
Chief BBS Administrator
BassTeroids Champion, Global Player Champion, Aim & Fire Champion, Puzzle Maniax Champion, Othello Champion, Canyon Glider Champion, UFO Shoot Out Champion, Unicycle Challenge Champion, Zed Champion
 
Join Date: May 2003
Location: Webb City, Mo
Posts: 14,940
Send a message via ICQ to Gizmo Send a message via AIM to Gizmo Send a message via MSN to Gizmo Send a message via Yahoo to Gizmo Send a message via Skype™ to Gizmo

Are you using the debug build of the dll, or the release build? You can sometimes have issues if you try to debug a VB application when you are using debug versions of the dlls you are calling as well (there are changes in how the stack gets allocated).
__________________
Avatar and sig graphic by Pitch. Subscribers!
Ask about a custom graphic or avatar today!
 
Later,
Gizmo
Thermal Diode Mod and Direct-Die Water Block
8-Cheetah 18GiB U-2 SCSI
MegaRAID Enterprise 1500/128MiB
Samsung SyncMaster 955DF
TTGI/Superflower TTS-520 PSU
 

 
AOA Team filesAOA Team wcgAOA Team fah
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 21st December, 2007, 12:23 PM
beno-the-baron's Avatar
Member
 
Join Date: July 2005
Posts: 9

I have been using the debug version of the DLL but changing to the release version does not stop an error occurring. However, the error is no longer a CTD event, but a vb 'Overflow' error of a loop counter which can only be the result of the DLL function repeatedly returning 0 at the wrong time. But this obvioulsy doesn't happen running the vb from an exe, otherwise that would crash as well.

It doesn't matter all that much, unless there is some underlying problem with the cpp, as I have finished adding password functionality and I'm ready to start adding some more useful methods.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 21st December, 2007, 12:57 PM
Gizmo's Avatar
Chief BBS Administrator
BassTeroids Champion, Global Player Champion, Aim & Fire Champion, Puzzle Maniax Champion, Othello Champion, Canyon Glider Champion, UFO Shoot Out Champion, Unicycle Challenge Champion, Zed Champion
 
Join Date: May 2003
Location: Webb City, Mo
Posts: 14,940
Send a message via ICQ to Gizmo Send a message via AIM to Gizmo Send a message via MSN to Gizmo Send a message via Yahoo to Gizmo Send a message via Skype™ to Gizmo

I'm guessing since you wrote the DLL that you probably have the Visual Studio C++ IDE as well.

If you will build the debug version of the DLL and put it into the Path so that the VB application opens it when run, you can then tell VS to launch the debugger on the DLL code as soon as the DLL is loaded.

For VS 2K5, you just need to configure VS to launch the VB application in your debugger session. If you open the DLL project properties, in the left pane of the Property Pages dialog that pops up you will see 'Configuration Options' and under than an item labeled 'Debugging'. Click on that, and the right pane will then contain your debugging options.

Set the 'Command' parameter to be the full path + name of the VB app that you want to run which will load this DLL. If it requires any command-line arguments, provide those in the 'Command Arguments' parameter. If it needs to be launched from a particular working directory in order to load any supporting files, then set the 'Working Directory' parameter as appropriate.

Once that is done, you can launch the debugger for the DLL. It will load your VB app, which you can then use like normal, except that now any calls from the VB app into the DLL will be run under your debugger, so that you can see what is happening.
__________________
Avatar and sig graphic by Pitch. Subscribers!
Ask about a custom graphic or avatar today!
 
Later,
Gizmo
Thermal Diode Mod and Direct-Die Water Block
8-Cheetah 18GiB U-2 SCSI
MegaRAID Enterprise 1500/128MiB
Samsung SyncMaster 955DF
TTGI/Superflower TTS-520 PSU
 

 
AOA Team filesAOA Team wcgAOA Team fah
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 22nd December, 2007, 09:39 AM
beno-the-baron's Avatar
Member
 
Join Date: July 2005
Posts: 9

Thanks, I had already tried this, but the problem is, the vb works fine when debugging the dll. The only time the error occurs is when the vb is in debug, which means I can't see what is happenning in the dll, unless there is a way to open the vb IDE and make it run the app using the cpp debug settings. But, like I said don't trouble yourself too much about it.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 22nd December, 2007, 12:16 PM
Gizmo's Avatar
Chief BBS Administrator
BassTeroids Champion, Global Player Champion, Aim & Fire Champion, Puzzle Maniax Champion, Othello Champion, Canyon Glider Champion, UFO Shoot Out Champion, Unicycle Challenge Champion, Zed Champion
 
Join Date: May 2003
Location: Webb City, Mo
Posts: 14,940
Send a message via ICQ to Gizmo Send a message via AIM to Gizmo Send a message via MSN to Gizmo Send a message via Yahoo to Gizmo Send a message via Skype™ to Gizmo

Ouch. That bites.
__________________
Avatar and sig graphic by Pitch. Subscribers!
Ask about a custom graphic or avatar today!
 
Later,
Gizmo
Thermal Diode Mod and Direct-Die Water Block
8-Cheetah 18GiB U-2 SCSI
MegaRAID Enterprise 1500/128MiB
Samsung SyncMaster 955DF
TTGI/Superflower TTS-520 PSU
 

 
AOA Team filesAOA Team wcgAOA Team fah
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to beat the sleep barrier, without 'extreme' methods. skool h8r Random Nonsense! 50 2nd May, 2006 03:54 PM
Have you burned an A64? Methods for testing the IMC.. MrSeanKon 64 Bit computing 1 23rd January, 2006 05:19 AM
What methods do you all use for CPU Burn-in? DragonFlight AMD Motherboards & CPUs 11 27th June, 2003 03:02 AM
Folding 2 connection methods! dimmreaper Samuknow's AOA FOLDING@HOME Team 5 19th October, 2001 02:42 AM


All times are GMT -5. The time now is 10:01 AM.


Copyright ©2001 - 2009, AOA Forums

Search Engine Friendly URLs by vBSEO 3.3.0