Problem with TCollection and DLLs 
Author Message
 Problem with TCollection and DLLs

Hello,

  I've got this problem about collections and DLLs. I've made a collection
in my program and operations runs correctly. But when I give as a parametr
to a procedure into a DLL's procedure and then run any method of that
collection, it stops on a General protection fault.
  Does anybody know about this problem, and about some way how to
run correctly? I'm afraid there's a problem about the way main program
and DLLs use the memory, but I've got no knowledge about it.
  The DLLs are made corectly, without this it runs OK.

        Thank you
                  Honza

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  The way the program runs is:

---

unit Coll;
(...)
PDataColl = ^TDataColl;
TDataColl = object (TCollection)

(...)

var  Coll1 : TDataCollection;

---

library WinCom;

procedure GetData (var t : TDataCollection);
  with t do
   (...)           {here it falls down}

---

program JCW;

  with Coll1 do
    (...)          {runs OK}
  XX (Coll1);

-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-

        |^^^|                     Jan Kohout (HoK)

     <        \_____/__           http://www.*-*-*.com/ ~xkohout2
       \          / \             snail : Armenska 1, Brno, Czech Republic
        \_______/                 tel : 00420 - 5 - 47 24 08 29
          |   |
         /|\ /|\        
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
  Pomozte vymytit smrt z nasich silnic - jezdete po chodniku!



Wed, 18 Jun 1902 08:00:00 GMT  
 Problem with TCollection and DLLs

Quote:

> Hello,

>   I've got this problem about collections and DLLs. I've made a collection
> in my program and operations runs correctly. But when I give as a parametr
> to a procedure into a DLL's procedure and then run any method of that
> collection, it stops on a General protection fault.

Where is the collection being instantiated? If it is in
the calling program, than you will have problems passing it as a
parameter to a DLL. You can try using a pCollection parameter
in the DLL, instead of a TCollection "var" parameter (i.e, pass a
pointer to a TCollection, or, pass the address of a TCollection instance)-
but I am not sure that even this will work.

Best regards, The Chief
--------
Dr. A{*filter*}la A. Olowofoyeku (The African Chief)

Homepage: http://www.*-*-*.com/
Author of: Chief's Installer Pro v5.00 for Win32
     ftp://ftp.simtel.net/pub/simtelnet/win95/install/chief500.zip



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. FPC: Wrong behavior in nested use of TCollection.ForEach

2. How to make TCollection that sorts on demand?

3. What are TCollection's accessor methods?

4. TCollection and XMS

5. ??C++ analog of TCollection ??

6. Tcollection into Clipboard

7. Bug in tCollection.ForEach?

8. Hashing data container object (TCollection?) wanted

9. ABO problems from ISAPI dll.

10. ADO problems from ISAPI dll.

11. BDE PROBLEM WHEN DEBUGGING AN ISAPI DLL WITH IIS5 / WINDOWS 2000

12. DLL Problem

 

 
Powered by phpBB® Forum Software