DLLCALL() error

This forum is for general support of Xbase++
Message
Author
ampandya
Posts: 58
Joined: Tue Apr 19, 2016 4:48 am

DLLCALL() error

#1 Post 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

ampandya
Posts: 58
Joined: Tue Apr 19, 2016 4:48 am

Re: DLLCALL() error

#2 Post by ampandya »

Hi
these are list of the function in the dll, i want the value of the _UniqueId::Value!

Thanks
Attachments
Capture.JPG
Capture.JPG (38.58 KiB) Viewed 19345 times

User avatar
Auge_Ohr
Posts: 1406
Joined: Wed Feb 24, 2010 3:44 pm

Re: DLLCALL() error

#3 Post 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.
greetings by OHR
Jimmy

ampandya
Posts: 58
Joined: Tue Apr 19, 2016 4:48 am

Re: DLLCALL() error

#4 Post 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

ampandya
Posts: 58
Joined: Tue Apr 19, 2016 4:48 am

Re: DLLCALL() error

#5 Post 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

User avatar
Auge_Ohr
Posts: 1406
Joined: Wed Feb 24, 2010 3:44 pm

Re: DLLCALL() error

#6 Post 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:
greetings by OHR
Jimmy

ampandya
Posts: 58
Joined: Tue Apr 19, 2016 4:48 am

Re: DLLCALL() error

#7 Post 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?

patito
Posts: 121
Joined: Tue Aug 31, 2010 9:01 pm

Re: DLLCALL() error

#8 Post 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

ampandya
Posts: 58
Joined: Tue Apr 19, 2016 4:48 am

Re: DLLCALL() error

#9 Post by ampandya »

Hello Hector

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

Thanks

User avatar
Auge_Ohr
Posts: 1406
Joined: Wed Feb 24, 2010 3:44 pm

Re: DLLCALL() error

#10 Post 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
greetings by OHR
Jimmy

Post Reply