Go Premium for a chance to win a PS4. Enter to Win

x
?
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
Medium Priority
?
2,081 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 500 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

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

971 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