• Welcome to Theos PowerBasic Museum 2017.

PowerBasic and ActiveLock

Started by Gheorghe Duca, March 19, 2010, 03:27:31 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Gheorghe Duca

I wanted to use ActiveLock (http://www.activelocksoftware.com/) in PowerBasic.
I created the file "inc" attached and the test file:
#COMPILE EXE
#DIM ALL
#include "ActiveLock.inc"
FUNCTION PBMAIN () AS LONG
    DIM pIActiveLock AS ActiveLock3IActiveLock
   pIActiveLock = NEWCOM CLSID $CLSID_ActiveLock3IActiveLock
   IF ISOBJECT(pIActiveLock) THEN
      msgbox "Conected"
   ELSE
      msgbox "Not conected"
   END IF
END FUNCTION

The message is "Not conected"
Can you help me.
Thank you!

José Roca

 
If it is properly registered it should work. Anyway, try using pIActiveLock = NEWCOM "ActiveLock3.IActiveLock".

Gheorghe Duca

It is properly registered (regsvr32.exe  Activelock3.6.dll)  because the Visual Basic application work without any problem.
I tried  pIActiveLock = NEWCOM "ActiveLock3.IActiveLock" but still not work.

Thank you anyway

Peter Weis

Hello Gheorghe Duca,

I tried it out for me too it is not. Maybe someone even knows why it does not work?
I try it again later on a different computer with windows XP. Maybe I have a blockhead! ??? ??? ???
Regards Peter

Peter Weis

Hello,
I looked at the matter again. that looks like ActiveLock3IActiveLock is not a base class you need first to create a different class to call, what a I do not know yet. Because the one in Visual Basic is often not seen and is often automatically invoke the base classes. Who do I have time I look at the VB Net or C + + in there you can see it better. Perhaps it is also one knows the call in PowerBASIC! But you could also again in the help of ActiveLock3 look in there maybe is the right order.

Regards Peter

Peter Weis

Hi,
I found it ;D. The base class is Int__Globals' the call must first.

Regards Peter




#COMPILE EXE
#DIM ALL
#INCLUDE "ActiveLock.inc"
FUNCTION PBMAIN () AS LONG
   DIM GlobalS          AS Int__Globals
   DIM pIActiveLock     AS Int__IActiveLock
   
   GlobalS = NEWCOM $PROGID_ActiveLock3_GlobalsGlobals
   IF ISOBJECT(GlobalS) THEN
        pIActiveLock = GlobalS.NewInstance()
       
        IF ISOBJECT(pIActiveLock) THEN
       
            MSGBOX "Conected"
        END IF
   ELSE
        MSGBOX "Not conected"
   END IF
END FUNCTION
                       



Gheorghe Duca

Thank you Peter! It works.

Regards,
Duca Gh.

Peter Weis

Hello Gheorghe Duca,
it's nice that I could help you. If you need anything re-register with me. :D

Regards
Peter

Gheorghe Duca

OK, Peter!

Regards,
Duca Gheorghe

Peter Weis

#9
Hello,
Here is the new include ActiveLock of 3.6 for PowerBASIC 10

Demo:

#COMPILE EXE
#DIM ALL
#INCLUDE "ActiveLock3.inc"
FUNCTION PBMAIN () AS LONG
   DIM pGlobalS          AS Globals
   DIM pIActiveLock     AS IActiveLock

   pGlobalS = NEWCOM CLSID $CLSID_Globals             ' LIB "\activelock3.6.dll"
   IF ISOBJECT(pGlobalS) THEN
        pIActiveLock = pGlobalS.NewInstance()

        IF ISOBJECT(pIActiveLock) THEN

            MSGBOX "Conected"
            pIActiveLock = NOTHING
            pGlobals = NOTHING
        END IF
   ELSE
        MSGBOX "Not conected"
   END IF
END FUNCTION
                           



regards
Peter