DLL Talk / rockey hasp dll comunication error |
| Author | Message | ||
|
lms
User Joined: Tue Nov 3rd 2009 Location: Cyberspace |
hi guys Rockey4ND.dll that i use is made for vb vb example + Code Snippet i tried to make it work in dbpro + Code Snippet the code like this works and i get that retcode = 4 when hasp is on pc and 3 when hasp is off pc thats cool but the problem is that when i put the call dll (12,"Rockey",fcode,handle< a fourth parameter the program crases i get the window with send report) the thing is that the correct full syntaax to work is something like this call dll (12,"Rockey",fcode,handle,lp1,lp2,p1,p2,p3,p4,buffer) the byref commands in vb maby is the key but i dont understand what or how the hell means exactly or how to make it work almost everything i put after dll(12,"Rockey",fcode,crashes the prog i put the dll so if u run the code u should get a 3 means not a hasp on pc if u change value of fcode to 5 u get a 15 > is cant read hasp smthing also passwords has Uint16bit integer &HC44C < how can i convert it to simple integer i cant say p1 = &HC44C ffs thank u in advance all os break |
||
| Back to top |
|||
|
Rudolpho
User Joined: Wed Dec 28th 2005 Location: Sweden |
I'm fairly certain you should substitute long with dword, not double integer ![]() |
||
| Back to top |
|||
|
IanM
Moderator ![]() Joined: Wed Sep 11th 2002 Location: In my moon base |
'byref' variables are actually variable addresses. You need to pass memory addresses where the DLL can write the results to. Use either MAKE MEMORY or MAKE MEMBBLOCK/GET MEMBLOCK ADDRESS for this. |
||
| Back to top |
|||
|
Google Ad
AdBot Joined: Aug 26th 2002 Location: Everywhere |
|||
| Back to top |
|||
|
lms
User Joined: Tue Nov 3rd 2009 Location: Cyberspace |
can u give me a simple example with the make memory command i cant make it work but it stopped crash example. i can take adress of a variable that i create a = make memory(4) i cant take the variable handle adress which is in the hasp memory i always take 0 how to tell take adress handle in the hasp? also make memblock/get memblock address command seems that i dont have it is it from the matrix.dll? thanks in advanced all os break |
||
| Back to top |
|||
|
IanM
Moderator ![]() Joined: Wed Sep 11th 2002 Location: In my moon base |
TBH, that interface is too complex and I'm too out-of-practice in that level of VB6 for me to try and put into an example. &HC44C in VB6 is the same as 0xc44c in DBPro. Make memory does not make a variable. It allocates a small chunk of memory and gives you its address so that you can pass it around into DLLs for example: + Code Snippet Strings are already memory addresses, as long as they contain something, so if you need to pass a string address, simply pass the string instead but make sure it's large enough to accept any changes that the DLL call makes to it. |
||
| Back to top |
|||
|
lms
User Joined: Tue Nov 3rd 2009 Location: Cyberspace |
great thanks for the tips IT WORKED PERFECT here is the code for rockey hasps first steps sample in dbpro 2 points of interest a. use make memblock to get and "connect" a string adress > byref in other language b. &HC44C in VB6 is the same as 0xc44c in DBPro + Code Snippet all os break |
||
| Back to top |
|||
|
IanM
Moderator ![]() Joined: Wed Sep 11th 2002 Location: In my moon base |
I noticed that you didn't initialise the memory for p3, p4, lp1 and lp2 - There's a good chance that initially any memory you allocate will be filled with zeros, but as your program runs and you free and allocate more memory that you will get memory that is not filled with zeros. You also need to make sure that you use DELETE MEMORY on any memory addresses you are finished with so that you don't leak memory. |
||
| Back to top |
|||
You must be logged-in to post messages to this forum. You can register an account for free. Or click here to login.
Forum Search
Enter a word or phrase to search our Forum for:
|
|





