A runnig example of runnig Activex and scripts from PB !!

Developed or developing a new product in PureBasic? Tell the world about it.
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

A runnig example of runnig Activex and scripts from PB !!

Post by ricardo »

Hi,

Maybe some of you already knows that im developing a dll that let us call almost any ActiveX and run vbs, jscript, etc. scripts all in runtime from PB.

This dll will be Shareware with a very special price to PB users!

Take a look of this running example of an PB executable that uses my dll.

There are 5 examples in one executable:

1.- Let you see that you can run vbs functions in runtime and get the result (its a powerfull parser!)

2.- Let you see how we can go INSIDE the html page loaded in the webgadget.

3.- Let you see the MSAgent interacting with PB.

4.- Let you change the ico of any folder

5.- Let you CREATE a swf file (Flash) in runtime!! (not send parameters to an existing one, create one from cero!!)

READ the 'readme' file before trying to run the executable please :wink:

http://www.getafile.com/cgi-bin/merlot/ ... xample.zip
ARGENTINA WORLD CHAMPION
benny
Enthusiast
Enthusiast
Posts: 465
Joined: Fri Apr 25, 2003 7:44 pm
Location: end of www
Contact:

Post by benny »

Hey ricardo ...

damn .. that's OUTSTANDING!!! Couldn't imagine all the thousands possibilities available with your dll. :D 8O 8)

All examples run perfectly here on my machine (win xp) !!!

Regardz, benny!
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

script is running perfect. :)
More Tests at home and weekend.

To get my copy for free, here is my contribution to eliminate the need of Regsvr32:

Code: Select all

;
;RegSVR32 Sample
Procedure RegSVR32(File$,Flag)

 hLib = LoadLibrary_(File$) ;Load the DLL into memory
 If hLib =0 
  ProcedureReturn 0
 EndIf
 
 If Flag=1 
    RegProcName.s = "DllRegisterServer"
 Else
    RegProcName.s = "DllUnregisterServer"
 EndIf
 
 ; Find And store the DLL entry point, i.e. obtain the address 
 ; of the “DllRegisterServer” or "DllUnregisterServer" function 
 ; (to register or deregister the server’s components in the registry)

lpDLLEntryPoint = GetProcAddress_(hLib, RegProcName) ;Find Procedure in DLL

If lpDLLEntryPoint = 0
     FreeLibrary_(hLib)
     ProcedureReturn -1 ;This is not a ActiveX
EndIf

;Create a thread To execute within the virtual address space of the calling process
hThread = CreateThread_(0, 0,lpDLLEntryPoint, 0, 0, lpThreadID)

If hThread = 0 
    FreeLibrary_(hLib)
    ProcedureReturn -2 ;failed threading
EndIf

;Use WaitForSingleObject To check the Return state (i) when the specified object is in 
;the signaled state Or (ii) when the time-out interval elapses. This function can be 
; used To test Process And Thread.
mResult = WaitForSingleObject_(hThread, 10000)
If mResult <> 0 
   FreeLibrary_(hLib)
   lpExitCode = GetExitCodeThread_(hThread, lpExitCode)
   ExitThread_(lpExitCode)
   ProcedureReturn -3 ;failed threading
EndIf       

;We don't call the dangerous Terminate Thread(); after the last handle to an object 
;is closed, the object is removed from the system.

CloseHandle_(hThread)
FreeLibrary_(hLib)
ProcedureReturn 1 ;failed threading
EndProcedure

MessageRequester("INFO","REGSVR32:"+Str(RegSVR32("c:\test.dll",0)),0)
SPAMINATOR NR.1
ebs
Enthusiast
Enthusiast
Posts: 561
Joined: Fri Apr 25, 2003 11:08 pm

Post by ebs »

Ricardo,

Wonderful!

It works great for me, and I've wanted this capability since I got PureBasic.
I'll be first in line to get mine, even if I have to pay for it! :wink:

Eric
Froggerprogger
Enthusiast
Enthusiast
Posts: 423
Joined: Fri Apr 25, 2003 5:22 pm
Contact:

Post by Froggerprogger »

WOWIWOWIWOW !!

Sorry for this spam, but I get crazy ! :D
%1>>1+1*1/1-1!1|1&1<<$1=1
Cor
Enthusiast
Enthusiast
Posts: 124
Joined: Fri Apr 25, 2003 7:52 pm
Location: Netherlands
Contact:

Post by Cor »

@Ricardo

samples won't run on my system (Win98se)

I have dragged the *.dll files over the regsvr32.exe

I looked in wordpad for the objects, but I can't see them.
So it seems they are not registered.
Cor de Visser

Registered PureBasic user

Author of ChordPlanet
Made with PureBasic
http://www.chordplanet.com
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

Cor wrote:@Ricardo

samples won't run on my system (Win98se)

I have dragged the *.dll files over the regsvr32.exe

I looked in wordpad for the objects, but I can't see them.
So it seems they are not registered.
Hi,

Thanks all for the comments.

Cor,

Did you get some prompt when dragged to the regsvr32.exe?

If the registration was succesfully you should get a prompt (in fact, if it wasn't succesfully you get a warning prompt too).
ARGENTINA WORLD CHAMPION
Cor
Enthusiast
Enthusiast
Posts: 124
Joined: Fri Apr 25, 2003 7:52 pm
Location: Netherlands
Contact:

Post by Cor »

I get no prompt, nothing happens , no message at all.

also tried at command box
regsvr32 xobjects.dll

also here no message at all, no error report

Should this normaly run on win98se?

Tried on 2 different win98se computers.

add:

I copied from system regsvr32.exe and then xobects.dll is loading correctly and xobjects1.dll adn xobjects2.dll both gives error return code
0x80020009

xobjects.dll demo is not working
seems that regsvr32 which is included is not correct
I have IE 6

[/code]
Cor de Visser

Registered PureBasic user

Author of ChordPlanet
Made with PureBasic
http://www.chordplanet.com
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

Then use your own regsvr32.exe in the windows/system folder.
Just register like any other component.
ARGENTINA WORLD CHAMPION
Cor
Enthusiast
Enthusiast
Posts: 124
Joined: Fri Apr 25, 2003 7:52 pm
Location: Netherlands
Contact:

Post by Cor »

But then it gives the errors as mentioned above.
Cor de Visser

Registered PureBasic user

Author of ChordPlanet
Made with PureBasic
http://www.chordplanet.com
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

Cor wrote:But then it gives the errors as mentioned above.
Yes, sorry.

I compress the dll and thats why it was failing in W98SE now its corrected, please download it again from the same url mentioned before.

BTW, Tomorrow i will release the dll. This is, you can try it in your own projects. Im just finishing the documentation and when i finish i will release it as trialware.
ARGENTINA WORLD CHAMPION
Cor
Enthusiast
Enthusiast
Posts: 124
Joined: Fri Apr 25, 2003 7:52 pm
Location: Netherlands
Contact:

Post by Cor »

@Ricardo

sorry to say but same problem win98se

Do have more users the same problem?

I really want to the the dll. I think it's great :D
Cor de Visser

Registered PureBasic user

Author of ChordPlanet
Made with PureBasic
http://www.chordplanet.com
Froggerprogger
Enthusiast
Enthusiast
Posts: 423
Joined: Fri Apr 25, 2003 5:22 pm
Contact:

Post by Froggerprogger »

I tested it on Win98 now (before it was Win 2000):

If I try to use ricardo's regsvr32, nothing happens, not even a message.
If I use my own regsvr32.exe from win98/system for it, the registration of xObjects.dll succeeds, but the registration of xObjects1.dll and xObjects2.dll fails. (Returncode 0x80020009 both times)

When I start the example then, none of the examples work.

hmmmmm. :?:
%1>>1+1*1/1-1!1|1&1<<$1=1
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

Froggerprogger wrote:When I start the example then, none of the examples work.
hmmmmm. :?:
*Corrected now in the download.

Yes, its because i compress the COM objects.
Now i learn that must be carefull compressing COM objects, some w98 won't be able to use it.

Well, now you can download the dll itself and test it on your own app.

http://www.getafile.com/cgi-bin/merlot/ ... eX2Dll.zip
ARGENTINA WORLD CHAMPION
Cor
Enthusiast
Enthusiast
Posts: 124
Joined: Fri Apr 25, 2003 7:52 pm
Location: Netherlands
Contact:

Post by Cor »

Still does not work.

regsvr says it is registered, but sample programs do not work :cry:

win98 se
Cor de Visser

Registered PureBasic user

Author of ChordPlanet
Made with PureBasic
http://www.chordplanet.com
Post Reply