Page 1 of 2

DLLCALL() error

Posted: Fri Dec 23, 2016 5:04 am
by ampandya
HI

I have a dll which can be used to get the hardware serialnumbers from the PC.

I am using the DllCall() to call the dll.

when i use : DllCall( nDll, DLL_STDCALL,"DllGetClassObject")
i am getting "Internal data structure corrupted"
when i use any params : DllCall( nDll, DLL_STDCALL,"DllGetClassObject","UniqueId","_UniqueId")
i am getting : "Access to the mothod not allowed in this context"

can you please help me with this?

thanks

Re: DLLCALL() error

Posted: Fri Dec 23, 2016 5:31 am
by ampandya
Hi
these are list of the function in the dll, i want the value of the _UniqueId::Value!

Thanks

Re: DLLCALL() error

Posted: Fri Dec 23, 2016 11:43 am
by Auge_Ohr
ampandya wrote:these are list of the function in the dll, i want the value of the _UniqueId::Value!
is this a DotNet DLL ? have you register DLL ?

if you want any Info about Hardware i recommend to use WMI e.g. Win32_Processor.

Re: DLLCALL() error

Posted: Fri Dec 23, 2016 12:44 pm
by ampandya
HI
I used WMIC command to get Bios Serialnumbers but some of our till do not have serialnumbers updated.
it gives blank result.

this dll is c#. and there is a function to get the HDV code which is combination of the hardware serialnumbers of the pc.

Thanks

Re: DLLCALL() error

Posted: Sat Dec 24, 2016 2:30 pm
by ampandya
Hi

I have been reading the other forums and blogs but couldnt find the answer to this question?
there are others who have asked the question but not solved.

this .net DLL which has function with COM Method type.

even the DllInfo( nDllHandle, DLL_INFO_FUNCLIST ) - > {} gives blank array?

has anyone Idea or work around? most of the time the error message is the function is not declared!!

Thanks

Re: DLLCALL() error

Posted: Sat Dec 24, 2016 2:54 pm
by Auge_Ohr
ampandya wrote:has anyone Idea or work around? most of the time the error message is the function is not declared!!
hi,

as i say a DotNet DLL as COM must be registered by

Code: Select all

"regasm /codebase YourCOM.dll"
use lates Version e.g.
c:\Windows\Microsoft.NET\Framework\v4.xxxx\RegAsm.exe
marry Xmas :occasion-xmas:

Re: DLLCALL() error

Posted: Sun Dec 25, 2016 4:33 am
by ampandya
Thanks Jimmy

I tried this and it kept saying is not .net Assembly.

I think the dll is not .net dll?

I know someone use this dll in c# and he can call UniqueId.Value from the dll.

when i try the function is not found, using the dllexport i can see the function name is _UniqueID::Value, is this the correct name for the function?

Re: DLLCALL() error

Posted: Mon Dec 26, 2016 1:00 pm
by patito
Hi
You need to implement DllGetClassObject in (and export it from) DLLs that support COM

Notes to Callers

You should not call DllGetClassObject directly. When an object is defined in a DLL, CoGetClassObject calls the CoLoadLibrary function to load the DLL, which, in turn, calls DllGetClassObject


Best Regard
Hector

Re: DLLCALL() error

Posted: Tue Dec 27, 2016 4:34 pm
by ampandya
Hello Hector

Do you have any sample code to call these types of class - functions from the dll?

Thanks

Re: DLLCALL() error

Posted: Tue Dec 27, 2016 6:13 pm
by Auge_Ohr
ampandya wrote:I used WMIC command to get Bios Serialnumbers but some of our till do not have serialnumbers updated.
it gives blank result.
BIOS now is UEFI ...
ampandya wrote:this dll is c#. and there is a function to get the HDV code which is combination of the hardware serialnumbers of the pc.
as i say you can e.g. use CPU
http://bb.donnay-software.com/donnay/vi ... f=7&t=2066
see for more Hardware Info with S/N