Solved

'Could not convert variant of type (Dispatch) into type (Boolean)' >..pops up after splash has splashed > how to get rid of it?

Posted on 2004-03-31
15
1,957 Views
Last Modified: 2012-06-21
Hi all Experts!! In my applications popupmenu clicking the menuitem 'About' splashes my splashscreen > so far it works perfect > only right after (at least I pressume the 'splash1.free' frees the splash) it's freed (or perhaps before or while or in an attempt to > I'm not sure...;( it pops up the above messagedialog and it's fellow errormessage. I haven't got a clue as to where I should begin in order to trace down this 'feature' of my application but could do without the message ofcourse > IMHO > when all goes well I shouldn't be bothered by this visual pollution of my application > and since 1+1=2 I think > 'when' doesn't go all too well;)

But how do I 'free' my application from that message? (or simply have it stashed somewhere invisible for all I care > in case solving the problem which causes this message seems too illusive I might as well 'carry' it with me but then preferrably somewhere deep down in my pocket 'stead of on top of my application or the like...)

Tnx in advance I hope I described the problem accurate enough > if not then  JustSaySo; ok?

Regards and max respect to this forum!!

Peter
0
Comment
Question by:PeterdeB
  • 8
  • 7
15 Comments
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10724096
do you have something like this?


 frmSPlash:= TfrmSplash.Create(Application);
 frmSplash.Update;
 if frmSplash.ShowModal = mrOK then
  frmSplash.free;


SHane
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10724274
As for the error message, it could be from many things...

"Could not convert variant of type (Dispatch) into type (Boolean)' >..pops up after"

do you use any type of Type Lybrary in your application? OCX? ActiveX?

How about any type of Interface?

Shane
0
 

Author Comment

by:PeterdeB
ID: 10724805
Hi Shane! (again you astonish me with your rapid response;)

Yes I do use any type of Type Library > ActiveSplashLib_TLB > resulting from the import of activesplash.ocx > I only ran into this message after implementing a procedure which doesn't seem related to the d*mn thing at all, from there it got me worrying;(
Then your next Q > type of Interface > must confess I'm not sure about that one although I guess using OCX or the like involves using 'any type of Interface'?

Peter
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 11

Expert Comment

by:shaneholmes
ID: 10724875
OK, you are not using the standard about splash screen, therefore the code I posted above is not valid.

1.) you should have mentioned you were using this type of control, that way experts aren't wasting their time coding unneccessary code for you. How is anyone to know you were using that control unless you tell them. I surmised you were using something out of the ordinary, thats why i asked about the type library.

2.) anyway, the only way we could help, is if you were to post your code on how you are calling this control  and displaying it the the user...

3.) What is it about this control that you need to use it versus creating your own splash (simple task) in delphi.


I can send you an example on how to create your own splash screen

Shane
0
 

Author Comment

by:PeterdeB
ID: 10724900
And once again EE tricked me with it's stubborn and persistent 'attitude' regarding the refreshing of pages cause your first message only came bubbling up after I answered your (apparently >) second.....nevertheless here's my code > (bear in mind that it probably is messed up to the max cause whenever I run into error message I can't seem to circumvent 1-2-3 > me tampers nearly the entire project prior to sending my error message in a bottle to EE > apart from that it should be obvious it isn't 'Rocket Science' or the like but hey it (used to;) work(s);)

procedure TfrmMain.About1Click(Sender: TObject);
var spl: string;
begin  try
spl:= 'mysplash2.spl';
if not FileExists(spl) then
MessageDlg('Het bestand '+spl+' kon niet '+#13+#10+'worden geladen omdat het niet '+#13+#10+'werd gevonden.', mtError, [mbOK], 0)
else
Splash1.LoadSplash(spl);
Splash1.Visible:= True;
Splash1.ShowModal(1000);
Splash1.Hide(False);
finally
Splash1.FreeMemory(splash1.oleobject); // < this dude I added after catching a glimp of the activesplashlib_tlb and it seems
                  //it brought the ugly message along > but prior to that my splash only splashed once and every second about1.click crashed my entire app thus removing this piece of code results in crashing rather than errormessaging > out of
//which I chose the second......
Splash1.Free;
end;

//end of fun;(

Regards Peter
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10724932
3.) What is it about this control that you need to use it versus creating your own splash (simple task) in delphi.
0
 
LVL 11

Accepted Solution

by:
shaneholmes earned 125 total points
ID: 10724938
Seems aliitle much for something as simple as an about screen.

Shane
0
 

Author Comment

by:PeterdeB
ID: 10724952
Oh ok > you made a (good) point there > it wasn't my intention to provide 'sloppy' information or incomplete details > but uptil now I didn't consider this to be the case, so my appreciation for your remark Shane;)
Then regarding the custom made splash screen > I already have a custom made splash screen (which pops up after launching my app) but creating a splash isn't exactly right up my alley > I can't seem to satisfy myself when it comes to the graphics > so I have to use others ideas and the like......(but reading this does ring a bell as to whether I'd choose for custom and considered-not-to-be-satisfactory OR invented-and-causing-severe-problems > so you got me thinking.......)

Peter
0
 

Author Comment

by:PeterdeB
ID: 10724988
Oh ok I see;( > it should check whether the spl is present prior to splashing > and apart from that it should ofcourse 'splash' > but you may be right in what you stated regarding my own splash.......(so I might even rid my app from the imported type lib > although I made my own splash > would you please send your demo splash app addressed Holland a s a p??)

Peter
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10725011
Yes,   - EMAIL?


The best part of your own splash, is the fact that you dont have to ditribute an OCX, with your app

Shane
0
 

Author Comment

by:PeterdeB
ID: 10725055
Hi Shane > I followed up to your advice regarding 'it seems a little much...' and cut away several lines of code and now guess what? > it WORRRUKSSS!!!

I changed the above into:
//
else
Splash1.LoadSplash(spl);
Splash1.Visible:= True;
Splash1.ShowModal(1000);

finally
Splash1.Free;
end;
//

And voila! So you get the points but hopefully I still get the demo splash app??

Regards Peter ( using this control also involves distribution of the ocx so I still might alter the app and use the technique  you advised......for your information)
0
 

Author Comment

by:PeterdeB
ID: 10725068
I must resemble a Parrot right? (regarding the comment on the ocx;)

f.vanbommel1@chello.nl or pdbiel@hotmail.com

Tnx in advance!!

Peter from Holland
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10725091
<I emailed it to you> <both addresses>

SHane
0
 

Author Comment

by:PeterdeB
ID: 10725594
Hi Shane tnx for the demo you mailed > unlike many demos it just does what it should > like the other app you sent me recently. I often bump into so called demos that require modifications prior to being successfully compiled and perhaps that may seem challenge to some > it may be obvious that it seems a waste of time to me or even worse;)

One Q however > you simply 'cooked' this app in like a blink of an eye just to support the problem I posted? (and if so the other app you sent would originate from the same 'circumstances' right?;)

Geeeez.....that's pretty fast........perhaps you are entitled to claim you write rocket-science-code then;)

Regards and 'bedankt' ........Peter
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10725645
What was so rocket science about it.

1.) Creat a new application

2.) Save it as Project1.dpr, & Unit1.pas

3.) Drop a TMainMenu on the main form

4.)  create Two new menu items (file, help) then under help, a sub menu item - about

5.) create new form

6.)Set its caption property to  'About' - save it as Unit2 - Change form name property to frmAbout

7.) set its border style to bsDialog

8.) drop a TPanel on the form - set its align property to alBottom

9.) drop a button on that pane1, set its caption to OK, its modalresult property  to mrOK

10.) save it as frmABout

11.) go back to the first forms unit

12.) choose from delphi main menu - Use unit

 make unit1 uses unit 2

13.) now in the MainMenu component of the main form, set the about menu items OnCLick event to say

frmAbout.ShowModal;


Now that is all beginner level delphi stuff - nothing advanced or intermediate for that matter involved here.

ANd yes, i created right after I mentioned to you i would send and example....\


Shane
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Dev Express grid collapse 2 45
Convert MS Word document to a PDF file 9 91
Firemonkey android show image from resource ? 1 46
Wincontrol not (correctly) drawn 15 40
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question