Simulating VB Nothing variant in Delphi
- From: "Ian Hinson" <pparagon@xxxxxxxxxxxxxx>
- Date: Wed, 21 Jun 2006 22:56:28 +1000
Often in VB code you see statements like:
Set cmd.ActiveConnection = Nothing
or
Set dbs = Nothing
To simulate Nothing in Delphi use:
var
vntNothing: OLEVariant;
begin
TVarData(vntNothing).VType := varDispatch;
TVarData(vntNothing).VDispatch := Nil;
// then you can do things like..
cat.Set_ActiveConnection(vntNothing);
without getting a data type mismatch.
Ian.
.
- Follow-Ups:
- Re: Simulating VB Nothing variant in Delphi
- From: Mike Shkolnik
- Re: Simulating VB Nothing variant in Delphi
- Prev by Date: Re: ADOX - Create new query in Access Database
- Next by Date: Re: Simulating VB Nothing variant in Delphi
- Previous by thread: Problem with date time editing
- Next by thread: Re: Simulating VB Nothing variant in Delphi
- Index(es):