Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dll issue
#1
I practice to use one external dll as attached file.
and the code as below:
Macro Macro2
Code:
Copy      Help
typelib QMPlugin "D:\Bkgnd.dll"
QMPlugin.Bkgnd a._create

and QM shows that error message:

Dynamic-link library (DLL) initialization routine failed

and the code as below:

Macro Macro2
Code:
Copy      Help
typelib QMPlugin "D:\Bkgnd.dll"
QMPlugin.Bkgnd a.GetPixelColor(0 0 0)

and QM shows that error message:
interface pointer variable is 0

This is my first time to practice to use dll function, and I don't know how to solve them...


Attached Files
.dll   Bkgnd.dll (Size: 40 KB / Downloads: 76)
#2
Is the dll registered as a COM component on your PC?
The code is correct, and usually works without registration, but maybe this dll wants to be registered anyway.
#3
I use Tools/Type Libraries and register component and library again, it shows that results : Component :failed Library:Success (I remember the results : Component :Success Library:Success for first time ?)
Is correct?
#4
Try to register with regsvr32.exe, it probably has a "verbose" option that may give more info why it fails.
Before, exit QM to make sure that the dll is not loaded.
#5
I try to use other dll file , it can successfully run, I think the root cause is "class name".
Because, the other dll file , I know the class name.

BTW, if I don't know the "class name" for some dll files, whether any methods can get it or not?
#6
Don't need to specify class name with _create if you use type library.
#7
Yes, you are right. I don't specify any class name for other dll file , and it can run successfully.
But, the code can not work for previous dll file , I think that it should not be used for QM.

Thanks again.


Forum Jump:


Users browsing this thread: 2 Guest(s)