Page 1 of 1

Module ComatePlus with X64 compiler

Posted: Tue Sep 17, 2024 5:02 am
by loulou2522
I received this message
[05 :54 :10] [ERREUR] module COMatePLUS.pbi (Ligne: 1503)
[05 :54 :10] [ERREUR] Procedure stack has been corrupted.
[05 :54 :26] Le programme a été arrêté.
Using comateplus module when opening

Code: Select all

DeclareModule Excelfile
  Declare Excelpartie(indicateur.s)      
  EndDeclareModule
    
  Module Excelfile      
  Gobal.comate::COMateObject ExcelObject, WorkBook,Sheet,Workbook3
  
      
      Procedure Excelpartie(indicateur.s)
        ;  ExcelObject = comate::COMate_CreateObject("Excel.Application")
         ExcelObject = comate::COMate_CreateObject("Excel.Application")
         ExcelObject\SetProperty("Visible= #false") 
  ExcelObject\SetProperty("ScreenUpdating= #false")
  ExcelObject\SetProperty("DisplayAlerts= #False")  
  fichier$=GetCurrentDirectory()+"cerfa2050.xlsx"
ExcelObject\Invoke("ActiveWorkbook\Close(0)")
 ExcelObject\SetProperty("Visible = 1")
ExcelObject\SetProperty("ScreenUpdating = 1")
 ExcelObject\SetProperty("DisplayAlerts= 1")
  ExcelObject\Invoke("Application\Quit")
  sheet\release()
  WorkBook3\Release()
  ExcelObject\Release()  
endprocedure 
endmodule 
thanks in advance to help me solving this problem
Little precision with x86 compiler all is good and no error is detected

Re: Module ComatePlus with X64 compiler

Posted: Tue Sep 17, 2024 11:19 am
by spikey
The fact that you're invoking methods on the workbook and sheet objects after you've told the host application object to quit isn't a good idea. But which line was 1503 in the actual test run? The line number will be dependent on which version of COMate you are using.

Oh, and you know 'Global' is mistyped on line 6, right?

Re: Module ComatePlus with X64 compiler

Posted: Tue Sep 17, 2024 1:07 pm
by loulou2522
Here is the line 1503 result = iDisp\Invoke(dispID, ?IID_NULL, #LOCALE_USER_DEFAULT, invokeType, dp, *ret, excep, @uiArgErr)
Comateplus.pbi! is date from 26042020
In my program the instruction wich generate this error is
fichier$=GetCurrentDirectory()+"cerfa2050.xlsx"
workbook = ExcelObject\invoke("Workbooks\Open('"+fichier$+"')")
if i change by and save the file like a model
fichier$=GetCurrentDirectory()+"cerfa2050.xltx"
workbook = ExcelObject\invoke("Workbooks\Open('"+fichier$+"')")
all is working

Re: Module ComatePlus with X64 compiler

Posted: Thu Sep 19, 2024 9:13 am
by loulou2522
I finally find the problem which come from purifier when using comate plus

Re: Module ComatePlus with X64 compiler

Posted: Thu Sep 19, 2024 2:11 pm
by jacdelad
Was already discussed and solved more than once. First Google result for "purebasic comateplus stack corruption": viewtopic.php?t=82698