Theos PowerBasic Museum 2017

Archive => Discussion - Legacy Software (PBWIN 9.0+/PBCC 5.0+) => Topic started by: Gheorghe Duca on March 19, 2010, 03:27:31 PM

Title: PowerBasic and ActiveLock
Post by: Gheorghe Duca on March 19, 2010, 03:27:31 PM
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!
Title: Re: PowerBasic and ActiveLock
Post by: José Roca on March 19, 2010, 04:29:50 PM
 
If it is properly registered it should work. Anyway, try using pIActiveLock = NEWCOM "ActiveLock3.IActiveLock".
Title: Re: PowerBasic and ActiveLock
Post by: Gheorghe Duca on March 20, 2010, 09:55:34 AM
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
Title: Re: PowerBasic and ActiveLock
Post by: Peter Weis on March 20, 2010, 08:58:00 PM
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
Title: Re: PowerBasic and ActiveLock
Post by: Peter Weis on March 20, 2010, 10:20:45 PM
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
Title: Re: PowerBasic and ActiveLock
Post by: Peter Weis on March 20, 2010, 11:31:04 PM
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
                       


Title: Re: PowerBasic and ActiveLock
Post by: Gheorghe Duca on March 21, 2010, 09:03:23 PM
Thank you Peter! It works.

Regards,
Duca Gh.
Title: Re: PowerBasic and ActiveLock
Post by: Peter Weis on March 21, 2010, 09:12:04 PM
Hello Gheorghe Duca,
it's nice that I could help you. If you need anything re-register with me. :D

Regards
Peter
Title: Re: PowerBasic and ActiveLock
Post by: Gheorghe Duca on March 22, 2010, 04:29:38 PM
OK, Peter!

Regards,
Duca Gheorghe
Title: Re: PowerBasic and ActiveLock for PB 10
Post by: Peter Weis on February 18, 2012, 01:41:19 PM
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