Bookstore

Recent

Author Topic: TAutoObjectFactory.Create causes A/V under Win64  (Read 30069 times)

dmitry

  • New Member
  • *
  • Posts: 32
    • Outlook Developer Tools
Re: TAutoObjectFactory.Create causes A/V under Win64
« Reply #15 on: March 10, 2010, 08:40:50 pm »
No, TLB has no bitness associated with it.
From the compiler point of view, you can link any binary file as a TLB resource.
Have you tried to explicilty speicfy the TLB file name?
{$R MyFile.TLB}
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

jagorath

  • New Member
  • *
  • Posts: 34
Re: TAutoObjectFactory.Create causes A/V under Win64
« Reply #16 on: March 10, 2010, 09:15:51 pm »
I tried putting in the whole filename, and also the whole path, same error.

After the compilation fails a dialog shows:

Unable to find file "".
If it belongs to your project, check search path in Project..Compiler options
etc etc

I can send the tlb if that would help at all to debug it.

dmitry

  • New Member
  • *
  • Posts: 32
    • Outlook Developer Tools
Re: TAutoObjectFactory.Create causes A/V under Win64
« Reply #17 on: March 10, 2010, 09:19:43 pm »
Again, there is nothing to debug *in* the TLB file. It is just a blob.
Does it live in the same folder where yo uhave dpr and pas files?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

jagorath

  • New Member
  • *
  • Posts: 34
Re: TAutoObjectFactory.Create causes A/V under Win64
« Reply #18 on: March 10, 2010, 09:33:23 pm »
Yes, and if I change the filename slightly to make it obviously invalid the compiler indicates it can't find the file rather than just "Error".

I have tried compiling in a different binary, a random exe and I get the same error.  So it is not specific to tlb files.  It is able to link in .res and .rc files however.

Could be my lazarus installation is messed up somehow.  It also fails if I use Project Options/Test.

dmitry

  • New Member
  • *
  • Posts: 32
    • Outlook Developer Tools
Re: TAutoObjectFactory.Create causes A/V under Win64
« Reply #19 on: March 10, 2010, 11:41:37 pm »
Can you try to create a resources.rc file with the following content

1 typelib FileName.tlb

and include it using

{$R 'resources.res' 'resources.rc'}
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

jagorath

  • New Member
  • *
  • Posts: 34
Re: TAutoObjectFactory.Create causes A/V under Win64
« Reply #20 on: March 11, 2010, 12:20:20 am »
I used Lazres to make the res file, called libresources.res.  Still the compiler fails - here's the detailed output.

Quote
Compiling resource C:\Users\Alan\Documents\Projects\MarketBuilder\MarketBuilder Lib\lib\x86_64-win64\MarketBuilderLib.obj
MarketBuilderLib.lpr(20,1) Error: Error while compiling resources
Linking C:\Users\Alan\Documents\Projects\MarketBuilder\Exe\MarketBuilderLib\MarketBuilderLib.dll
MarketBuilderLib.lpr(20,1) Fatal: There were 1 errors compiling module, stopping

dmitry

  • New Member
  • *
  • Posts: 32
    • Outlook Developer Tools
Re: TAutoObjectFactory.Create causes A/V under Win64
« Reply #21 on: March 11, 2010, 12:49:12 am »
Can you create a dummy empty TLB file in Delphi and try to use it insteda?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

Paul Ishenin

  • Sr. Member
  • ****
  • Posts: 274
Re: TAutoObjectFactory.Create causes A/V under Win64
« Reply #22 on: March 11, 2010, 02:48:31 am »
Update your compiler to r15002 and try simple {$R *.tlb} - now it is supported.

dmitry

  • New Member
  • *
  • Posts: 32
    • Outlook Developer Tools
Re: TAutoObjectFactory.Create causes A/V under Win64
« Reply #23 on: March 11, 2010, 03:31:19 am »
Man, you are quick! :-)
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

Paul Ishenin

  • Sr. Member
  • ****
  • Posts: 274
Re: TAutoObjectFactory.Create causes A/V under Win64
« Reply #24 on: March 11, 2010, 07:32:57 am »
Resource support in lazarus/fpc is my priority.

jagorath

  • New Member
  • *
  • Posts: 34
Re: TAutoObjectFactory.Create causes A/V under Win64
« Reply #25 on: March 11, 2010, 10:51:22 am »
Great success!

I must have misused LazRes somehow because the resulting res file was only 1k.  I then tried using Delphi's rc which produced a proper res file.  Using the {$R 'libresources.res' 'libresources.rc'} it now works, 100%.

I tried the {$R *.tlb} after updating the source and it manages to link it, but it can't register the tlb as regsvr32 A/Vs on it still, not sure why.

On the COM side of thing I've noticed that server-side exceptions don't bubble up nicely as they do in Delphi, you just get an A/V on the client.  I can live with that though.

Thank-you Paul and Dimitry for your help and patience!  I am off to the races.

Paul Ishenin

  • Sr. Member
  • ****
  • Posts: 274
Re: TAutoObjectFactory.Create causes A/V under Win64
« Reply #26 on: March 11, 2010, 01:17:50 pm »
I need to know what is the difference between {$R 'libresources.res' 'libresources.rc' and {$R *.tlb} in your application. Can upload small example somewhere?

Without more info I can't fix properly {$R *.tlb}. At the moment I'm adding that tlb as is as TYPELIB resource type and they have indentifiers which start from 1. I looked that delphi do the same. So it is interesting what more needs to be done there.

jagorath

  • New Member
  • *
  • Posts: 34
Re: TAutoObjectFactory.Create causes A/V under Win64
« Reply #27 on: March 11, 2010, 06:51:23 pm »
I will do it, where can I upload it to?

Paul Ishenin

  • Sr. Member
  • ****
  • Posts: 274
Re: TAutoObjectFactory.Create causes A/V under Win64
« Reply #28 on: March 11, 2010, 11:32:10 pm »
To the bug tracker.

jagorath

  • New Member
  • *
  • Posts: 34
Re: TAutoObjectFactory.Create causes A/V under Win64
« Reply #29 on: March 12, 2010, 11:05:12 pm »
Bug 0015982