Closing form without "Unload me"

Hi!


I have a bunch of controls on the form, and it closes fine with "X". However if i use "Unload me" it crashes. "End" if out of the question, so is unloading form from another form..

Is there and way (API or smth) to call the same procedure as "X" uses it?
LVL 1
coyoteeAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
i see.
Declare Function DestroyWindow Lib "user32.dll" (ByVal hWnd As Long) As Long

should work better (tested).

note however that if that is the unly form of the project, it will NOT end the project running.
0
 
madhurdixitCommented:
When you call one form from another form..do you use javascript's window.open?If yes,  this would be returning a window object. You can call window.close on this object.
e.g

say Form A calls Form B...

  var formBWindow = window.open("blah blah..");
 

 
 function callMeWhenYouWantToExitFormB()
{
 
   formBWindow.close();

}
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
let me guess that you are using VB ?


can you post what error message it gives
can you post what code you have in the form_unload and form_queryunload events
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
coyoteeAuthor Commented:
AngelIII: "Visual basic has encountered a problem and needs to close. We are sorry fr the ininconcenience."


AppName: ccm_client.exe       AppVer: 1.0.0.240       ModName: msvbvm60.dll
ModVer: 6.0.97.82       Offset: 00105e11


There is nothing worth mentioning in the Form_Unload. Remember: THIS WORKS WITH "X".

DEBUG XML DATA:

<?xml version="1.0" encoding="UTF-16"?>
<DATABASE>
<EXE NAME="CCM_Client.exe" FILTER="GRABMI_FILTER_PRIVACY">
    <MATCHING_FILE NAME="CabThing.dll" SIZE="426496" CHECKSUM="0xDCB2D3FD" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="06/19/1992 22:22:17" UPTO_LINK_DATE="06/19/1992 22:22:17" />
    <MATCHING_FILE NAME="CCM_Client.exe" SIZE="2879488" CHECKSUM="0xD370744" BIN_FILE_VERSION="1.0.0.240" BIN_PRODUCT_VERSION="1.0.0.240" PRODUCT_VERSION="1.00.0240" COMPANY_NAME="Developed for Comtech by siWWW.net" PRODUCT_NAME="Archive System Comtech - Client" FILE_VERSION="1.00.0240" ORIGINAL_FILENAME="CCM_Client.exe" INTERNAL_NAME="CCM_Client" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x2C25E4" LINKER_VERSION="0x10000" UPTO_BIN_FILE_VERSION="1.0.0.240" UPTO_BIN_PRODUCT_VERSION="1.0.0.240" LINK_DATE="05/26/2006 11:48:22" UPTO_LINK_DATE="05/26/2006 11:48:22" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="CCM_Client_half_Outlook.exe" SIZE="1978368" CHECKSUM="0x341A56C5" BIN_FILE_VERSION="1.0.0.142" BIN_PRODUCT_VERSION="1.0.0.142" PRODUCT_VERSION="1.00.0142" COMPANY_NAME="Developed for Comtech by siWWW.net" PRODUCT_NAME="Archive System Comtech - Client" FILE_VERSION="1.00.0142" ORIGINAL_FILENAME="CCM_Client.exe" INTERNAL_NAME="CCM_Client" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x1E3AD5" LINKER_VERSION="0x10000" UPTO_BIN_FILE_VERSION="1.0.0.142" UPTO_BIN_PRODUCT_VERSION="1.0.0.142" LINK_DATE="09/28/2005 14:03:00" UPTO_LINK_DATE="09/28/2005 14:03:00" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="FreeImage.dll" SIZE="913408" CHECKSUM="0x3E87A470" BIN_FILE_VERSION="3.6.1.0" BIN_PRODUCT_VERSION="3.6.1.0" PRODUCT_VERSION="3, 6, 1, 0" FILE_DESCRIPTION="FreeImage library" COMPANY_NAME="FreeImage" PRODUCT_NAME="FreeImage" FILE_VERSION="3, 6, 1, 0" ORIGINAL_FILENAME="FreeImage.dll" INTERNAL_NAME="FreeImage" LEGAL_COPYRIGHT="Copyright © 2003-2005 by FreeImage" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="3.6.1.0" UPTO_BIN_PRODUCT_VERSION="3.6.1.0" LINK_DATE="02/20/2005 13:47:50" UPTO_LINK_DATE="02/20/2005 13:47:50" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="lnEncDec.dll" SIZE="408064" CHECKSUM="0xB7F6780" BIN_FILE_VERSION="1.0.1.1" BIN_PRODUCT_VERSION="1.0.1.1" PRODUCT_VERSION="1.0.1.1" FILE_DESCRIPTION="Encryption Decryption dll" COMPANY_NAME="Maverick" PRODUCT_NAME="EncoderDecoder" FILE_VERSION="1.0.1.1" ORIGINAL_FILENAME="lnEncDec" INTERNAL_NAME="lnEncDec" LEGAL_COPYRIGHT="What copy®ight" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.0.1.1" UPTO_BIN_PRODUCT_VERSION="1.0.1.1" LINK_DATE="06/19/1992 22:22:17" UPTO_LINK_DATE="06/19/1992 22:22:17" VER_LANGUAGE="Slovenian [0x424]" />
    <MATCHING_FILE NAME="lnFTP.dll" SIZE="205312" CHECKSUM="0x41912064" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="06/19/1992 22:22:17" UPTO_LINK_DATE="06/19/1992 22:22:17" />
    <MATCHING_FILE NAME="lnWinWorX.dll" SIZE="53248" CHECKSUM="0x9B54752B" BIN_FILE_VERSION="1.0.0.6" BIN_PRODUCT_VERSION="1.0.0.6" PRODUCT_VERSION="1.00.0006" COMPANY_NAME="FailSafe Systems" PRODUCT_NAME="Windows WorX (WinWorX)" FILE_VERSION="1.00.0006" ORIGINAL_FILENAME="WinWorX.dll" INTERNAL_NAME="WinWorX" LEGAL_COPYRIGHT="FailSafe Systems" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x18726" LINKER_VERSION="0x10000" UPTO_BIN_FILE_VERSION="1.0.0.6" UPTO_BIN_PRODUCT_VERSION="1.0.0.6" LINK_DATE="09/22/1999 08:59:14" UPTO_LINK_DATE="09/22/1999 08:59:14" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="_Support_Projects\DB_Tool.exe" SIZE="217088" CHECKSUM="0x5A54F02E" BIN_FILE_VERSION="1.0.0.28" BIN_PRODUCT_VERSION="1.0.0.28" PRODUCT_VERSION="1.00.0028" COMPANY_NAME="Developd for MSD by siWWW.net" PRODUCT_NAME="Gita DB Tool" FILE_VERSION="1.00.0028" ORIGINAL_FILENAME="DB_Tool2.exe" INTERNAL_NAME="DB_Tool2" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x40D72" LINKER_VERSION="0x10000" UPTO_BIN_FILE_VERSION="1.0.0.28" UPTO_BIN_PRODUCT_VERSION="1.0.0.28" LINK_DATE="05/20/2005 11:31:17" UPTO_LINK_DATE="05/20/2005 11:31:17" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="_Support_Projects\Conversion from DOX, XLS to TIFF\LEADTOOLS ePrint 00023536.EXE" SIZE="9093120" CHECKSUM="0xC2892ADE" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="01/09/2001 14:08:41" UPTO_LINK_DATE="01/09/2001 14:08:41" />
    <MATCHING_FILE NAME="_Support_Projects\Conversion from DOX, XLS to TIFF\LEADTOOLSePrintEval.exe" SIZE="16824400" CHECKSUM="0x5474D3A1" BIN_FILE_VERSION="2.1.13.0" BIN_PRODUCT_VERSION="2.1.13.0" PRODUCT_VERSION="4.00.000                                                     " FILE_DESCRIPTION="                                                             " COMPANY_NAME="LEAD Technologies, Inc                                       " PRODUCT_NAME="LEADTOOLS ePrint EVAL                                        " FILE_VERSION="4.00.000                                                     " ORIGINAL_FILENAME="                                                            " INTERNAL_NAME="                                                            " LEGAL_COPYRIGHT="                                                            " VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x10004" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x1015260" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="2.1.13.0" UPTO_BIN_PRODUCT_VERSION="2.1.13.0" LINK_DATE="08/13/1999 16:52:39" UPTO_LINK_DATE="08/13/1999 16:52:39" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="_Support_Projects\Conversion from DOX, XLS to TIFF\libgw32c-0.4.exe" SIZE="964782" CHECKSUM="0x3989CC58" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="06/19/1992 22:22:17" UPTO_LINK_DATE="06/19/1992 22:22:17" />
    <MATCHING_FILE NAME="_Support_Projects\Conversion from DOX, XLS to TIFF\pictplus60 (VB Display).exe" SIZE="932933" CHECKSUM="0x8F4AFC7C" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="02/24/1997 20:25:53" UPTO_LINK_DATE="02/24/1997 20:25:53" />
    <MATCHING_FILE NAME="_Support_Projects\Conversion from DOX, XLS to TIFF\PNETIF6.exe" SIZE="4502016" CHECKSUM="0xC36C30C4" BIN_FILE_VERSION="6.0.0.0" BIN_PRODUCT_VERSION="6.0.0.0" FILE_DESCRIPTION="PEERNET.DRV eTIFF 6.0" COMPANY_NAME="PEERNET Inc." FILE_VERSION="6.0.0" LEGAL_COPYRIGHT="PEERNET Inc." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x10001" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x40000" UPTO_BIN_FILE_VERSION="6.0.0.0" UPTO_BIN_PRODUCT_VERSION="6.0.0.0" LINK_DATE="01/29/2004 06:13:04" UPTO_LINK_DATE="01/29/2004 06:13:04" />
    <MATCHING_FILE NAME="_Support_Projects\Conversion from DOX, XLS to TIFF\tiff-3.6.1-2.exe" SIZE="1823675" CHECKSUM="0xEC19FE24" BIN_FILE_VERSION="3.6.1.1501" BIN_PRODUCT_VERSION="0.0.0.0" PRODUCT_VERSION="" FILE_DESCRIPTION="Tiff Setup                                                  " COMPANY_NAME="GnuWin32                                                    " PRODUCT_NAME="" FILE_VERSION="3.6.1.1501          " ORIGINAL_FILENAME="" INTERNAL_NAME="" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="3.6.1.1501" UPTO_BIN_PRODUCT_VERSION="0.0.0.0" LINK_DATE="06/19/1992 22:22:17" UPTO_LINK_DATE="06/19/1992 22:22:17" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="_Support_Projects\Conversion from DOX, XLS to TIFF\tiffdll50.exe" SIZE="2270600" CHECKSUM="0x8F4AFC7C" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="02/24/1997 20:25:53" UPTO_LINK_DATE="02/24/1997 20:25:53" />
    <MATCHING_FILE NAME="_Support_Projects\Conversion from DOX, XLS to TIFF\neevia e-document software\docuPrinter SDK installer  dpsdk.exe" SIZE="1899554" CHECKSUM="0x3FC8A886" BIN_FILE_VERSION="0.0.0.0" BIN_PRODUCT_VERSION="0.0.0.0" PRODUCT_VERSION="" FILE_DESCRIPTION="docuPrinter SDK Setup                                       " COMPANY_NAME="Neevia Technology                                           " PRODUCT_NAME="" FILE_VERSION="                    " ORIGINAL_FILENAME="" INTERNAL_NAME="" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="0.0.0.0" UPTO_BIN_PRODUCT_VERSION="0.0.0.0" LINK_DATE="06/19/1992 22:22:17" UPTO_LINK_DATE="06/19/1992 22:22:17" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="_Support_Projects\Conversion from DOX, XLS to TIFF\neevia e-document software\dplt.exe" SIZE="4275595" CHECKSUM="0x3FC8A886" BIN_FILE_VERSION="0.0.0.0" BIN_PRODUCT_VERSION="0.0.0.0" PRODUCT_VERSION="" FILE_DESCRIPTION="docuPrinter LT Setup                                        " COMPANY_NAME="Neevia Technology                                           " PRODUCT_NAME="" FILE_VERSION="                    " ORIGINAL_FILENAME="" INTERNAL_NAME="" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="0.0.0.0" UPTO_BIN_PRODUCT_VERSION="0.0.0.0" LINK_DATE="06/19/1992 22:22:17" UPTO_LINK_DATE="06/19/1992 22:22:17" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="_Support_Projects\Conversion from DOX, XLS to TIFF\neevia e-document software\dppro.exe" SIZE="6256110" CHECKSUM="0x3FC8A886" BIN_FILE_VERSION="0.0.0.0" BIN_PRODUCT_VERSION="0.0.0.0" PRODUCT_VERSION="" FILE_DESCRIPTION="docuPrinter Pro Setup                                       " COMPANY_NAME="Neevia Technology                                           " PRODUCT_NAME="" FILE_VERSION="                    " ORIGINAL_FILENAME="" INTERNAL_NAME="" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="0.0.0.0" UPTO_BIN_PRODUCT_VERSION="0.0.0.0" LINK_DATE="06/19/1992 22:22:17" UPTO_LINK_DATE="06/19/1992 22:22:17" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="_Support_Projects\Conversion from DOX, XLS to TIFF\neevia e-document software\dptse.exe" SIZE="7120113" CHECKSUM="0x3FC8A886" BIN_FILE_VERSION="0.0.0.0" BIN_PRODUCT_VERSION="0.0.0.0" PRODUCT_VERSION="" FILE_DESCRIPTION="DocuPrinter Terminal Server Edition Setup                   " COMPANY_NAME="Neevia Technology                                           " PRODUCT_NAME="" FILE_VERSION="                    " ORIGINAL_FILENAME="" INTERNAL_NAME="" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="0.0.0.0" UPTO_BIN_PRODUCT_VERSION="0.0.0.0" LINK_DATE="06/19/1992 22:22:17" UPTO_LINK_DATE="06/19/1992 22:22:17" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="_Support_Projects\Conversion from DOX, XLS to TIFF\printer-driver.com\udc.exe" SIZE="3532670" CHECKSUM="0x7F585BAE" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="11/10/2004 16:05:26" UPTO_LINK_DATE="11/10/2004 16:05:26" />
    <MATCHING_FILE NAME="_Support_Projects\Conversion from DOX, XLS to TIFF\vb6xlibrary\VB6X.dll" SIZE="360448" CHECKSUM="0x20D6EB9A" BIN_FILE_VERSION="1.0.0.101" BIN_PRODUCT_VERSION="1.0.0.101" PRODUCT_VERSION="1.00.0101" COMPANY_NAME="JSoft" PRODUCT_NAME="VB6X" FILE_VERSION="1.00.0101" ORIGINAL_FILENAME="VB6X.dll" INTERNAL_NAME="VB6X" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x645FF" LINKER_VERSION="0x10000" UPTO_BIN_FILE_VERSION="1.0.0.101" UPTO_BIN_PRODUCT_VERSION="1.0.0.101" LINK_DATE="01/08/2002 17:46:28" UPTO_LINK_DATE="01/08/2002 17:46:28" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="_Support_Projects\Conversion from DOX, XLS to TIFF\Viscom Media\crack.exe" SIZE="21504" CHECKSUM="0x32C6C054" BIN_FILE_VERSION="1.0.0.0" BIN_PRODUCT_VERSION="1.0.0.0" PRODUCT_VERSION="1.00" COMPANY_NAME="DSi" PRODUCT_NAME="dsicrack" FILE_VERSION="1.00" ORIGINAL_FILENAME="crack.exe" INTERNAL_NAME="crack" LEGAL_COPYRIGHT="yea rite" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x10000" UPTO_BIN_FILE_VERSION="1.0.0.0" UPTO_BIN_PRODUCT_VERSION="1.0.0.0" LINK_DATE="12/20/2004 01:06:05" UPTO_LINK_DATE="12/20/2004 01:06:05" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="_Support_Projects\Conversion from DOX, XLS to TIFF\Viscom Media\databurnerdemosetup.exe" SIZE="1367598" CHECKSUM="0xA598136C" BIN_FILE_VERSION="0.0.0.0" BIN_PRODUCT_VERSION="0.0.0.0" PRODUCT_VERSION="" FILE_DESCRIPTION="Data Burner ActiveX Control Setup                           " COMPANY_NAME="Viscom Software                                             " PRODUCT_NAME="" FILE_VERSION="                    " ORIGINAL_FILENAME="" INTERNAL_NAME="" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="0.0.0.0" UPTO_BIN_PRODUCT_VERSION="0.0.0.0" LINK_DATE="06/19/1992 22:22:17" UPTO_LINK_DATE="06/19/1992 22:22:17" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="_Support_Projects\Conversion from DOX, XLS to TIFF\Viscom Media\imagethumbnaildemosetup.exe" SIZE="2120658" CHECKSUM="0xA598136C" BIN_FILE_VERSION="0.0.0.0" BIN_PRODUCT_VERSION="0.0.0.0" PRODUCT_VERSION="" FILE_DESCRIPTION="Image Thumbnail CP ActiveX Control Setup                    " COMPANY_NAME="Viscom Software                                             " PRODUCT_NAME="" FILE_VERSION="                    " ORIGINAL_FILENAME="" INTERNAL_NAME="" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="0.0.0.0" UPTO_BIN_PRODUCT_VERSION="0.0.0.0" LINK_DATE="06/19/1992 22:22:17" UPTO_LINK_DATE="06/19/1992 22:22:17" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="_Support_Projects\Conversion from DOX, XLS to TIFF\Viscom Media\imageviewercpprodemosetup.exe" SIZE="2433838" CHECKSUM="0xA598136C" BIN_FILE_VERSION="0.0.0.0" BIN_PRODUCT_VERSION="0.0.0.0" PRODUCT_VERSION="" FILE_DESCRIPTION="Image Viewer CP Pro ActiveX Control Setup                   " COMPANY_NAME="Viscom Software                                             " PRODUCT_NAME="" FILE_VERSION="                    " ORIGINAL_FILENAME="" INTERNAL_NAME="" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="0.0.0.0" UPTO_BIN_PRODUCT_VERSION="0.0.0.0" LINK_DATE="06/19/1992 22:22:17" UPTO_LINK_DATE="06/19/1992 22:22:17" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="_Support_Projects\ImageViewer purchased\imageviewercpprofull12setup.exe" SIZE="2433251" CHECKSUM="0xA598136C" BIN_FILE_VERSION="0.0.0.0" BIN_PRODUCT_VERSION="0.0.0.0" PRODUCT_VERSION="" FILE_DESCRIPTION="Image Viewer CP Pro ActiveX Control Setup                   " COMPANY_NAME="Viscom Software                                             " PRODUCT_NAME="" FILE_VERSION="                    " ORIGINAL_FILENAME="" INTERNAL_NAME="" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="0.0.0.0" UPTO_BIN_PRODUCT_VERSION="0.0.0.0" LINK_DATE="06/19/1992 22:22:17" UPTO_LINK_DATE="06/19/1992 22:22:17" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="_Support_Projects\OutlookBar purchased\71147_OutlookShortcutBar.msi" SIZE="1876480" CHECKSUM="0x588F3A7" />
    <MATCHING_FILE NAME="_Support_Projects\pak\Pak.dll" SIZE="77824" CHECKSUM="0x4B2C479C" BIN_FILE_VERSION="1.2.0.0" BIN_PRODUCT_VERSION="1.2.0.0" PRODUCT_VERSION="1.02" FILE_DESCRIPTION="Packs files into one single file (no compression) and extracts files from packed files." COMPANY_NAME="Forbidden Colours" PRODUCT_NAME="Pak File Manipulation" FILE_VERSION="1.02" ORIGINAL_FILENAME="Pak.dll" INTERNAL_NAME="Pak" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x1752A" LINKER_VERSION="0x10002" UPTO_BIN_FILE_VERSION="1.2.0.0" UPTO_BIN_PRODUCT_VERSION="1.2.0.0" LINK_DATE="09/24/2003 16:50:10" UPTO_LINK_DATE="09/24/2003 16:50:10" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="_Support_Projects\SQL DB Explorer\SQL Server Database Explorer.exe" SIZE="229376" CHECKSUM="0xB0F94AD" BIN_FILE_VERSION="1.0.0.0" BIN_PRODUCT_VERSION="1.0.0.0" PRODUCT_VERSION="1.00" COMPANY_NAME="Mitrovac" PRODUCT_NAME="SQL Server Database Explorer" FILE_VERSION="1.00" ORIGINAL_FILENAME="SQL Server Database Explorer.exe" INTERNAL_NAME="SQL Server Database Explorer" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x416A0" LINKER_VERSION="0x10000" UPTO_BIN_FILE_VERSION="1.0.0.0" UPTO_BIN_PRODUCT_VERSION="1.0.0.0" LINK_DATE="05/20/2005 11:34:23" UPTO_LINK_DATE="05/20/2005 11:34:23" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="_Support_Projects\Xceed.Ultimate.Suite.2005.4.Datecode.20050809-Lz0\XceedComponents.exe" SIZE="40649488" CHECKSUM="0x499E9B87" BIN_FILE_VERSION="10.50.0.125" BIN_PRODUCT_VERSION="10.50.0.0" PRODUCT_VERSION="1.2.5" FILE_DESCRIPTION="Setup Launcher" COMPANY_NAME="Xceed Software Inc.    " PRODUCT_NAME="Xceed Components " FILE_VERSION="1.2.5363." ORIGINAL_FILENAME="Setup.exe" INTERNAL_NAME="Setup" LEGAL_COPYRIGHT="Copyright (C) 2004 - Xceed Software Inc.  " VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x26C616C" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="10.50.0.125" UPTO_BIN_PRODUCT_VERSION="10.50.0.0" LINK_DATE="10/22/2004 08:17:54" UPTO_LINK_DATE="10/22/2004 08:17:54" VER_LANGUAGE="English (United States) [0x409]" />
</EXE>
<EXE NAME="MSVBVM60.DLL" FILTER="GRABMI_FILTER_THISFILEONLY">
    <MATCHING_FILE NAME="msvbvm60.dll" SIZE="1386496" CHECKSUM="0x82BDE88F" BIN_FILE_VERSION="6.0.97.82" BIN_PRODUCT_VERSION="6.0.97.82" PRODUCT_VERSION="6.00.9782" FILE_DESCRIPTION="Visual Basic Virtual Machine" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Visual Basic" FILE_VERSION="6.00.9782" INTERNAL_NAME="MSVBVM60.DLL" LEGAL_COPYRIGHT="Copyright © 1987-2000 Microsoft Corp." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x154E1B" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="6.0.97.82" UPTO_BIN_PRODUCT_VERSION="6.0.97.82" LINK_DATE="02/24/2004 04:15:40" UPTO_LINK_DATE="02/24/2004 04:15:40" VER_LANGUAGE="English (United States) [0x409]" />
</EXE>
<EXE NAME="kernel32.dll" FILTER="GRABMI_FILTER_THISFILEONLY">
    <MATCHING_FILE NAME="kernel32.dll" SIZE="983552" CHECKSUM="0x4CE79457" BIN_FILE_VERSION="5.1.2600.2180" BIN_PRODUCT_VERSION="5.1.2600.2180" PRODUCT_VERSION="5.1.2600.2180" FILE_DESCRIPTION="Windows NT BASE API Client DLL" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Microsoft® Windows® Operating System" FILE_VERSION="5.1.2600.2180 (xpsp_sp2_rtm.040803-2158)" ORIGINAL_FILENAME="kernel32" INTERNAL_NAME="kernel32" LEGAL_COPYRIGHT="© Microsoft Corporation. All rights reserved." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0xFF848" LINKER_VERSION="0x50001" UPTO_BIN_FILE_VERSION="5.1.2600.2180" UPTO_BIN_PRODUCT_VERSION="5.1.2600.2180" LINK_DATE="08/04/2004 07:56:36" UPTO_LINK_DATE="08/04/2004 07:56:36" VER_LANGUAGE="English (United States) [0x409]" />
</EXE>
</DATABASE>
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
is this now vb6 or vb.net?
what OS?
do you have any subclassing in your project?
do you use any 'fancy' controls in that form (ie what controls do you use)?
0
 
coyoteeAuthor Commented:
VB6, Windows XP. No Subclassing, and YES -> Fancy controls (Outlook style bar by Teebo). I've allready sent them an email about this but they seem to be ignorant about this problem.

Since I've given up to solve this, I only need an API funtion (or smth) to call the same procedure that is triggered when clicking "X".

Once more - crashes on "End" or "Unload me", crashes NOT on "X".
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
did you try to setup a test project, 1 form, just that control, and see if it happens also?

you can  try this API:

Private Declare Function CloseWindow Lib "user32" Alias "CloseWindow" (ByVal hwnd As Long) As Long
for the hwnd pass the me.hwnd value
0
 
coyoteeAuthor Commented:
Private Declare Function CloseWindow Lib "user32" Alias "CloseWindow" (ByVal hwnd As Long) As Long

only MINIMIZES the window.
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
You could also try SendMessage() with the WM_CLOSE msg:

Private Const WM_CLOSE = &H10

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Private Sub Command1_Click()
    SendMessage Me.hwnd, WM_CLOSE, 0, 0
End Sub
0
 
lojk.Net and Infrastructure ConsultantCommented:
Hmm, seen this many times before in the world of VB6 it is usually to do with the fact the form has other code running within it and as such this code should be shutdown first before attempting to destroy the container (form). Instead of executing Unload Me, does executing a call to Form_Unload (ie to allow any other operations to happen) cause the same error?

I would suggest trying this also

rather than 'WhateverYourFormClassIsCalled.show '

use

sub main
Dim tForm as new WhateverYourFormClassIsCalled
tform.show vbModal
doevents
set tform=nothing
doevents
end sub

and doing a me.hide in place of the Unload Me, this will force the Form to be closed by the main thread, rather than the request to destroy itself coming from itself...

Also, i know its really boring but if you have done a
Dim SomeVariable as AnyObject
set Somevariable=new AnyObject

you MUST do a
set SomeVariable=nothing
when you have finsihed using it and preferably within the scope that it was intialised (not defined). This will deeply affect VB if you are not doing it. Check all your code and make sure any defintions have corresponding closure defintions as above.

VB6 aint too great at handling external code and memory but adopting both of these policies above will probably fix it. Also ensure that you are running Visual Studio 6 Service Pack *6*, this can make a significant difference to stability.

The obvious answer is just to go straight to .Net where these things rarely happen (but i guess you already knew that)

Hope that gives you a couple more ideas...
0
 
PatrickAdrichemCommented:
you could use me.hide (form.hide)

its not really closed then, but its invisible.
0
 
lojk.Net and Infrastructure ConsultantCommented:
just a me.hide without declaring the form (see my previous comment) in a separate instance still leaves that form allocated within the application memory space and the same problem will manifest when you exit the application (then youll start getting illegal operations on Application Exit)

To summise my previous point too instead of just

unload me
try
Form_Unload
UnloadMe

One other point any object references that are currently defined thus...

Dim myObject as ObjectClass = new ObjectClass

can also be created

Dim myObject as Object  = CreateObject ("ObjectLibrary.ObjectClass")

and this will also aid stability. In my experience LateBinding objects in this way can aid stability in problematic 3rd party components (but then i avoid 3rd party components like the plague anyway, most of this functionality is best created yourself by using your own usercontrols or at least components that you have the source code and therefore capability to debug for)

Cleanly defining, instantiating and destroying object references is always the way to go...
0
 
coyoteeAuthor Commented:
Public Declare Function DestroyWindow Lib "user32.dll" (ByVal hWnd As Long) As Long

DID THE TRICK!

Aparently some control on the form reacted very badly to the unload.me, but this works just like "X" :)


Thanx!
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
"...but this works just like "X"..."

???

DestroyWindow does NOT work just like the "X"...

Consider the code below:

    Option Explicit

    Private Declare Function DestroyWindow Lib "user32.dll" (ByVal hwnd As Long) As Long

    Private Const WM_CLOSE = &H10
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

    Private Sub Command1_Click()
        DestroyWindow Me.hwnd
    End Sub

    Private Sub Command2_Click()
        SendMessage Me.hwnd, WM_CLOSE, 0, 0
    End Sub

    Private Sub Form_Unload(Cancel As Integer)
        MsgBox "Unload"
    End Sub

If you click the first button (which uses DestroyWindow) you don't get the "Unload" message...and the app does not end.

But if you click the second button (which uses SendMessage and WM_CLOSE) you will get the "Unload" message just as if you had clicked on the "X" button directly...and the app closes correctly.

~IM
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.