mIRC Home    About    Download    Register    News    Help

Print Thread
/comclose doesn't free up the com object file. #61388 22/11/03 02:27 AM
Joined: Jul 2003
Posts: 33
B
Bilge Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Jul 2003
Posts: 33
/comclose closes the connection to the COM object, but the file which exports that COM object progid remains locked. I presume that mIRC has locked the file, although it might be MSDTC... however closing mIRC unclocks the file. The big problem here is that mIRC has to be closed every time I need to recompile, and it would also mean that for each upgrade version that is released, users would have to close mIRC to upgrade.

/comclose means that mIRC is finished with this COM object, so there is no reason to lock the source file. If it really is mIRC's fault, then this should definitely be rectified.

Re: /comclose doesn't free up the com object file. #61389 23/11/03 01:55 AM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
I believe your problem is related to what I've encountered. This VBScript creates an Access 97 MDB file
  • Set a = CreateObject("ADOX.Catalog")
    a.Create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=test.mdb;Jet OLEDB:Engine Type=4;"
    Set a = Nothing
The "Create" method makes a locked "test.mdb" file, that becomes unlocked once the object is released. After the code runs, you can do whatever you want with the newely created "test.mdb".

I "converted" this code to a mIRC script...
  • .comopen a ADOX.Catalog
    !.echo -q $com(a,Create,3,bstr,Provider=Microsoft.Jet.OLEDB.4.0;Data Source=test.mdb;Jet OLEDB:Engine Type=4;)
    .comclose a
and surprisingly, "test.mdb" is still locked after the script finishes, and can't be removed until mIRC is restarted.

Maybe /comclose is broken.

Re: /comclose doesn't free up the com object file. #61390 23/11/03 02:10 PM
Joined: Jul 2003
Posts: 33
B
Bilge Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Jul 2003
Posts: 33
An interesting observation. Thanks for confirming this problem. I hope it is acknowledged in an update for the next version.