View Issue Details

IDProjectCategoryView StatusLast Update
0023089FPCFCLpublic2019-09-20 18:00
ReporterRenato RicciAssigned ToMarco van de Voort 
PrioritynormalSeveritymajorReproducibilitysometimes
Status resolvedResolutionnot fixable 
Platformx64OSWindowsOS Version7
Product Version2.4.4Product Build 
Target VersionFixed in Version 
Summary0023089: Error with CreateOleObject
DescriptionHi, I'm trying to use a DLL resource, but having no success..

The DLL accepts 2 " out" parameters. for exemple: PegaNomeCertificado(name, msgresult); Both parameters are 'Out parameters'. Whitch means if I call it, I will get the certificate name on the first parameter.

procedure TForm1.Button1Click(Sender: TObject);
var
UtiL: OleVariant;
i:integer;
nome, msgResultado: widestring;
begin
  nome := '';
  msgResultado :='';
  Util := CreateOleObject('NFe_Util_2G.util');

  i:= Util.PegaNomeCertificado(nome, msgResultado);
  ShowMessage('Nome: ' + nome);
end;

The line with: CreateOleObject('NFe_Util_2G.util') works fine.. but when calling:
i:= Util.PegaNomeCertificado(nome, msgResultado);

the application returns a '' result in the variable 'nome';
Steps To Reproduce1) Save attachment to the disk;
2) Unpack and open the folder. Run Register_DLL_NFe_2G.bat to register the DLL on your "Windows" OS.
3) Compile the project and run.. Click the button Button1. It will call the "Open Certificates" from your browser. After selecting the certificate, it was supposed to give its name.. which is not occurring..
Additional InformationI also tried with Lazarus 1.0 fpc 2.6.0, but whe application raise an Access Violation when calling the CreateOleObject('NFe_Util_2G.util');

I tried to use the same code with Delphi, and it is working perfectly.
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget-
Attached Files

Activities

2012-10-08 18:25

 

BugReport.rar (1,104,385 bytes)

Marco van de Voort

2012-10-08 21:22

manager   ~0063011

Some questions:
- You say "x64", is the program that you generate 32-bit or 64-bit?
- What is the origin of the DLL, the below quick test seems to indicate that it is not a native DLL, but a .NET assembly?

D:\testing> file NFe_Util_2G.dll
NFe_Util_2G.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows

Renato Ricci

2012-10-08 22:10

reporter   ~0063012

Yes, it is a .NET assembly..

The sample I mentioned before I was compiling with Lazarus x64..(did not work)

Right now I just downloaded the lazarus 1.0 x32 and everything is working perfectly..

It may be something related to lazarus x64..

FYI: My Operation System is a Windows 7 64 bits.

Thanks

Marco van de Voort

2013-05-05 00:14

manager   ~0067439

If I run it I get an exception that the class isn't registered.

Probably you need to register the assembly the 64-bit registry of components with a 64-bit version of regasm.

If you decide to retest, could you do tests with trunk? (some things changed there, hopefully for the better)

Marco van de Voort

2019-09-20 18:00

manager   ~0118137

Closing report, no feedback, no details about assembly.

Issue History

Date Modified Username Field Change
2012-10-08 18:17 Renato Ricci New Issue
2012-10-08 18:25 Renato Ricci File Added: BugReport.rar
2012-10-08 21:22 Marco van de Voort Note Added: 0063011
2012-10-08 22:10 Renato Ricci Note Added: 0063012
2013-05-05 00:14 Marco van de Voort Note Added: 0067439
2013-05-05 00:14 Marco van de Voort Assigned To => Marco van de Voort
2013-05-05 00:14 Marco van de Voort Status new => feedback
2019-09-20 18:00 Marco van de Voort Status feedback => resolved
2019-09-20 18:00 Marco van de Voort Resolution open => not fixable
2019-09-20 18:00 Marco van de Voort FPCTarget => -
2019-09-20 18:00 Marco van de Voort Note Added: 0118137