Re: Automation controller Variant problem
Paul wrote:
I am now learning how to set up an automation controller in Delphi. I
would like to be able to connect, perform some operations, and
disconnect.
I declared the Variant here (it also worked with the commented type)
private
MyPADS: Variant; //IPowerPCBApp;
On FormCreate, I initialize it:
MyPADS := Unassigned;
This is probably not necessary, as it seems to be that by default.
My problem occurs here (Connect):
procedure TForm1.BtnConnectClick(Sender: TObject);
begin
if( VarType(MyPADS) = Unassigned ) then begin
This implies a variant conversion, as "Unassigned" is a variable, not a
variable state. Do rather try
if (VarType(MyPADS) = varEmpty) then begin...
--
Bjørge
bjorge@xxxxxxxxxxxx
.
Relevant Pages
- RE: Function behaviour, can someone explain please?
... All functions and sub procedures are by default public scope. ... private, unless it has to be public. ... Private MyFunctionsas Variant ... ont intended to be called outside of this sheet or modue) and let me know how ... (microsoft.public.excel.programming) - RE: Open an Access Form based on a class
... Private frm_detail As Form_frm_detail ... Property Let CallingName(vValue As Variant) ... Dim lngOne As Long ... I'd like to open the detail form using an ID from the search ... (microsoft.public.access.modulesdaovba) - Re: Internet Explorer object
... > have a private function related to the article. ... Public WithEvents Web2 As SHDocVw.InternetExplorer ... Private Sub WebBrowser1_NewWindow2 ... Private Sub Web2_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData ... (microsoft.public.vb.general.discussion) - Re: UDTs
... UserColour As String ... Private mUsers() As MDIMainform.NewUser ... Public Property Let Users(ByVal values As Variant) ... (microsoft.public.vb.general.discussion) - Re: disable CTRL + P
... Well, if you subclass the webbrowser, this works... ... Private Declare Function WindowFromPoint _ ... Private Sub Form_Unload ... , URL As Variant, Flags As Variant, TargetFrameName As Variant _ ... (microsoft.public.vb.general.discussion) |
|