Page 12 of 23

Posted: Mon Jan 28, 2008 10:24 pm
by zikitrake
:D Thank you for your great support (At level of PB team). Tomorrow I'll test it and I'm sure it will work very fine

Posted: Wed Jan 30, 2008 1:45 pm
by zikitrake
Hi Srod, I get an error with PB4.20 beta 2

I added a procedure In your code (egrid5_demo9), and a MenĂº Item

If I comment this line: ;MessageRequester("TEST IN COL1, ROW0", tarea)

the program give me an Invalid Memory Access in the previous line ( tarea.s = egrid_GetCellText(1, 1,0)

but if I uncomment it, program works fine un it exits of this proc :roll:

(I don't know if is a EGRID error or PB 4.20beta2 error, because in PB4.10 (with previous Egrid version) it works great)

Any help? thank you

Code: Select all

Procedure TEST_PROC()
  Debug egrid_GetCellText(1, 1,0)
  tarea.s = egrid_GetCellText(1, 1,0)
  ;MessageRequester("TEST IN COL1, ROW0", tarea)
EndProcedure

Procedure.l MyCellCallBack(egrid, uMsg, *cellinfo.egridCellInfo)
  Protected result, width, height
  Select uMsg

    Case #egrid_NotifyCellType
      If *cellinfo\column = 0
          *cellinfo\celltype=#egrid_CustomCell
      EndIf
    Default 
      result = #True; This accounts for all messages we have decided not to process.
  EndSelect
  ProcedureReturn result
EndProcedure
;******************************************************************************************

;*************************************WINDOW + GADGET LIST*********************************
If OpenWindow(0,0,0,640,300,"EsGRID demo 9.",#PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_Maximize|#PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
  ;******************************************************************************************
  CreateMenu(0,WindowID(0))
  MenuTitle("test")
  MenuItem(1, "testing")
  ;********************************************EGRID*****************************************
  ;Create an egrid with resizable columns.
    egrid_CreateGrid(1, WindowWidth(0)/4, WindowHeight(0)/8, WindowWidth(0)/2, WindowHeight(0)/2,48,#egrid_GridLines|#egrid_HeaderDragDrop|#egrid_AlwaysShowSelection, #egrid_ResizeColumnsTrue|#egrid_MultiLineText)


  ;**********************************SET CELLCALLBACK FUNCTION*******************************
  ;Set the callback early to avoid massive flickering when populating the egrid with initial data.
    egrid_CreateCellCallback(1, @MyCellCallBack())
  ;******************************************************************************************
  ;***************************************ADD DATA TO EGRID**********************************
  egrid_AddColumn(1,0,"CUSTOM CELLS",120)
  For i = 1 To 10
    egrid_AddColumn(1,-1,"",80) ;Some dummy columns.
  Next
  egrid_AddRows(1,-1, 20) ;20 rows.

  ;******************************************************************************************
  
  ;*****************************************EVENT LOOP***************************************

  egrid_SetCellText(1, 1,0, "Hi, Im a test")
  
  Repeat
    EventID = WaitWindowEvent()
    
    If EventID=#PB_Event_Menu And  EventMenu()=1
        MessageRequester("hello", "go to TEST_PROC")
        TEST_PROC()
    EndIf
      
  Until EventID = #PB_Event_CloseWindow
  MessageRequester("info", "end program")
EndIf
  
End

Posted: Wed Jan 30, 2008 1:58 pm
by srod
Confirmed.

The problem only seems to occur when using the compiled library version of EsGRID. When I use EsGRID as a source code include, it works fine with PB 4.2 beta 2.

I thus suspect a problem with Tailbite and am therefore unsure that I'll be able to resolve this any time soon.

I'll keep investigating however.

Posted: Wed Jan 30, 2008 2:16 pm
by zikitrake
Thank you Srod, I'm sure you will solve it ;)

Posted: Wed Jan 30, 2008 2:24 pm
by srod
The problem is the call to egrid_GetCellText() in your TEST_PROC() procedure. I've even altered the function in the EsGRID library itself to return a simple string and it still crashes. Some kind of stack corruption therefore seems likely.

As you say, it works with PB 4.1 okay, it works when I use EsGRID as a source code include. The only possibilities are a problem with PB 4.2 beta 2 itself or Tailbite; I now suspect PB 4.2.

My next test is to create a really simple user library, and set up a simple program similar to demo 9. Let us see if this crashes (I hope it does!) If it does crash then I'll have a look at the generated asm code to see if anything looks amis.

I'll keep testing but I reckon that if some kind of fix is not forthcoming, the only way out is for me to provide you with the EsGRID source, which, whilst a last resort, I am prepared to do this.

Posted: Wed Jan 30, 2008 2:34 pm
by zikitrake
Don't worry Srod I'm sure you can solve it.

With the DLL version it crash too??

Posted: Wed Jan 30, 2008 2:35 pm
by srod
I have tested with the following userlib compiled with Tailbite :

Code: Select all

ProcedureDLL.s HeyHo(a)
  Protected a$
  a$=Str(a)
  ProcedureReturn a$
EndProcedure
Now the client program :

Code: Select all

Procedure TEST_PROC() 
  tarea.s = HeyHo(100) 
  MessageRequester("Bloody hell's bells!", tarea) 
EndProcedure 

If OpenWindow(0,0,0,640,300,"Tally bally ho!",#PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_Maximize|#PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0)) 
  CreateMenu(0,WindowID(0)) 
  MenuTitle("test") 
  MenuItem(1, "testing") 
  Repeat 
    EventID = WaitWindowEvent() 
    If EventID=#PB_Event_Menu And  EventMenu()=1 
      TEST_PROC() 
    EndIf 
  Until EventID = #PB_Event_CloseWindow 
EndIf 
And it crashes!

Proof it is not an EsGRID problem. :)

Now to figure out if it is Tailbite or PB 4.2 beta 2! :wink:

Posted: Wed Jan 30, 2008 2:36 pm
by srod
REMOVED.

Posted: Wed Jan 30, 2008 2:38 pm
by zikitrake
:D you are fast man. Thank you

Posted: Wed Jan 30, 2008 2:40 pm
by srod
REMOVED.

Posted: Wed Jan 30, 2008 2:44 pm
by srod
REMOVED.

Posted: Wed Jan 30, 2008 11:38 pm
by srod
zikitrake wrote:Don't worry Srod I'm sure you can solve it.

With the DLL version it crash too??
I've just tested the DLL version and it runs fine. It could thus still be a problem with Tailbite?

Posted: Wed Jan 30, 2008 11:51 pm
by zikitrake
I just try DLL version an it works great :D .

I can wait until Tailbite make compatible PB.4.2 libs.

Thank you Srod for effort

Posted: Thu Jan 31, 2008 9:13 am
by zikitrake
:? Srod, the DLL version don't get my registered user/pass of egrid. Can you help me?. Thanks

Posted: Thu Jan 31, 2008 12:05 pm
by srod
The dll version is a separate purchase and uses different registration/derestriction codes. The dll version is actually more expensive.

I did this because I wanted non-PB users to pay a little more (still very cheap though) and thus I couldn't use the same registration codes etc. else non PB users would simply purchase the cheaper PB version etc.

As a PB user, however, I will be happy to give you a set of reg codes for the dll version.

To be honest, I think I will move away completely from releasing user libraries, they are more hassle than they are worth when new versions of PB are released. I am thus thinking of discontinuing support for the static lib versions of EsGRID and instead only supporting the dll version AND/OR only releasing EsGRID in source code form. I just need to give this a little more thought.

Whatever I decide, I will ensure that all existing customers (gulp, there's quite a few!) receive either the dll codes or the full source code.

Yes, I think source code is the best way in this case. Give me today to make my mind up.