| Main > Software Forum |
| If you would like to build multi LED-Wiz support into your software... |
| << < (8/9) > >> |
| loadman:
Thanks Youki, I Think I did successfully Import the Active X controll in VB6 and in Delphi using the GUI's I have no problem controlling the Wiz under VB6. My problem is now how to issue it commands in Delphi Format/syntax as obviously it differs from VB6 . The instructions from GGG it only has VB6 type command examples. I emailed you the OCX and its pdf instructions etc. If you have time if you could show me how to issue commands using Delphi 7 and I will make a donation to the Atomic fund ~~ even though I use MaLa :-) Is there a chance that this OCX does not work with Delphi 7? Thanks in advance (if/when you have time) |
| youki:
For All willing control LED-Wiz from delphi with the OCX. This is how to do : Add in the uses clause : ComObj --- Code: ---uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,OleCtnrs,ComObj; --- End code --- then in your code. (here an example, that init the Ocx , and just light on all leds : --- Code: ---procedure TForm1.Button1Click(Sender: TObject); var LedwizObject: Variant; MyString : Variant; begin LedwizObject := CreateOleObject('LEDWiz_Control.LED_Wiz'); LedwizObject.DeviceNumber:=1; MyString := LedwizObject.Detected; LedwizObject.Command:='SBA:255,255,255,255,2'; end; --- End code --- I just tested that with Delphi 7 , it works. It will be the same method for all other language. (Variant and CreateObject or a kind of) The OCX , need to be previously regiestered by the command : regsvr32 <path>\LEDWIZM.OCX ;) --- Quote ---I will make a donation to the Atomic fund ~~ even though I use MaLa --- End quote --- I don't want a Donation from a Mala user , i don' t accept dirty money!! ;) (i'm joking) But thank for the proposition, but you can use that money to have a drink offered by me! :cheers: |
| loadman:
--- Quote ---I don't want a Donation from a Mala user , i don' t accept dirty money!! (i'm joking) --- End quote --- And they say you don't have a sense of Humor ;) :P Thanks Again, !!!! As they say in Australia, 'You are a good sport' But I will Donate! >:D [LATER] That indeed does work. I am already on my way building my first real Delpi Prog. Note: I did not need to register the OCX using the method you described to get it to work. It probably already was. Thanks Again |
| youki:
--- Quote ---[LATER] That indeed does work. I am already on my way building my first real Delpi Prog. Note: I did not need to register the OCX using the method you described to get it to work. It probably already was. Thanks Again --- End quote --- As you already used in VB6 or tried to import it in Delphi using the U.I , it has already been registered. But in general case, the OCX need to be registered in the registry to works. Thanks for the donation, It wasn't really necessary , but i 've really appreciated!. :cheers: |
| loadman:
Thanks again Here is my crappy test code. 4 Buttons to change 4 RGB Leds. 3 are on Wiz one, 1 is on Wiz Two unit LedWiz2; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,ComObj, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton; Button4: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); procedure Button4Click(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } m_LedwizObject: Variant; end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var LedwizObject: Variant; MyString : Variant; begin m_LedwizObject.DeviceNumber:=1; m_LedwizObject.Command:='RDC:1,1'; end; procedure TForm1.Button2Click(Sender: TObject); var LedwizObject: Variant; MyString : Variant; begin m_LedwizObject.DeviceNumber:=1; m_LedwizObject.Command:='RDC:4,1'; end; procedure TForm1.Button3Click(Sender: TObject); var LedwizObject: Variant; MyString : Variant; begin m_LedwizObject.DeviceNumber:=1; m_LedwizObject.Command:='RDC:7,1'; end; procedure TForm1.Button4Click(Sender: TObject); var LedwizObject: Variant; MyString : Variant; begin m_LedwizObject.DeviceNumber:=2; m_LedwizObject.Command:='RDC:1,1'; end; procedure TForm1.FormCreate(Sender: TObject); begin m_LedwizObject := CreateOleObject('LEDWiz_Control.LED_Wiz'); end; end. |
| Navigation |
| Message Index |
| Next page |
| Previous page |