Home > other >  Consult the Python call fastreport DLL
Consult the Python call fastreport DLL

Time:10-01

I'd like to call in python fastreport. DLL, says below my several attempts,
1, the first to find the CLR example is used to import, in this sentence the from FastReport import * error: ImportError: No module named 'FastReport'
Is 2, and later began with DLL encoding (ANSI/unicode) and release (32/64), 64, found that python is indeed a DLL is 32-bit, later changed python3.5.4 32 bit, but still won't do
3, finally tried MSVCRT DLL can be successful, that environment should be no problem, may be obtain right
4, try ctypes way of obtaining or not, here is my code

The import ctypes
LibHandle=ctypes. Windll. Kernel32. LoadLibraryW (' MSVCRT. DLL)
Lib=ctypes. CDLL (None, handle=libHandle)
Lib. Printf (b "hello world!" )

LibHandle=ctypes. Windll. Kernel32. LoadLibraryW (' FastReport. DLL)
Lib=ctypes. WinDLL (None, handle=libHandle)
The from FastReport import *
The report=report ()
Report. The Load (" bq. Usd ")
Report. The Show ()
The result is

Result or not, I look at the others will easily tuned out, why I always say there is no this fastreport this module? Now really is no way out, want to see any friends encountered similar problems, help to raise a point of thinking, first thank you

CodePudding user response:

Why don't you look at other people how to adjust?

CodePudding user response:

The
reference at the 1st floor response:
why don't you take a look at other people how to adjust?

Ah, I here can't use the same code, check the methods are tried, still won't do

CodePudding user response:

refer to the second floor for chestnut GCQ response:
Quote: reference at the 1st floor response:

Why don't you look at other people how to adjust?

See ah, I here can't use the same code, check the methods are tried, or no

Do you know FastReport. DLL in the function definition? Is a pure C language

CodePudding user response:

Try that?
When used, parameters to agree with C function declaration type, in addition to None, int, long, Byte String, Unicode String, can not directly use Python data types, must transform

 
The import ctypes

DLL=ctypes. CDLL (" MSVCRT DLL ")
DLL. Printf (" hello world "b)

The report=ctypes. CDLL (" FastReport. DLL ")
Report. The report ()
Report. The Load (" bq. Usd ")
Report. The Show ()

CodePudding user response:

reference administrator reply: 3/f
Quote: refer to the second floor for chestnut GCQ response:

Quote: reference at the 1st floor response:

Why don't you look at other people how to adjust?

See ah, I here can't use the same code, check the methods are tried, or no

Do you know FastReport. DLL in the function definition? Is a pure C language

Thank you for reminding me, fastreport. DLL is c # types of DLL, use the method of pythonnet CLR inside is more, but I is the CLR, or an error: ImportError: No module named 'fastreport'
Also, I tried the second method, you said there is no the from FastReport import * this sentence, not introduced, the inside of the Report should not be used

CodePudding user response:

The
reference at the 4th floor response:
try that?
When used, parameters to agree with C function declaration type, in addition to None, int, long, Byte String, Unicode String, can not directly use Python data types, must transform

 
The import ctypes

DLL=ctypes. CDLL (" MSVCRT DLL ")
DLL. Printf (" hello world "b)

The report=ctypes. CDLL (" FastReport. DLL ")
Report. The report ()
Report. The Load (" bq. Usd ")
Report. The Show ()


I the printf is used, the example to prove that I am in front of the environment should be no problem

CodePudding user response:

refer to 6th floor for chestnut GCQ response:
[/code]

I the printf is used, the example to prove that I am in front of the environment should be no problem


The from FastReport import *
It sure is wrong, the environment there is no FastReport this module, you sure others use the same with you?

CodePudding user response:

reference at the 7th floor response:
Quote: refer to the 6th floor for chestnut GCQ response:

[/code]

I the printf is used, the example to prove that I am in front of the environment should be no problem


The from FastReport import *
It sure is wrong, the environment there is no FastReport this module, you sure others use the same with you?


Well well, sure, fastreport. DLL kao. I am py the same directory, affirmation is some, but I had been in the following example, always import the DLL is not successful, at just tried again succeeded, but this fault,

The process of the link mentioned in my here, https://blog.csdn.net/zhuoyue008/article/details/82178182
Thank you friend, you are my lucky star!

The following is to solve the problem of dragDrop registration failure
  • Related