please please please Specified Cast is not valid error

R

redwebgeek

Please help me. ANY guess or ideas welcome
I am trying to list the types of coverpages available in winfax 10. I
have the imports at the top of the page.
Every time I run this I get a "Specified Cast is not valid" error. I
guess this makes sense since the .count item is a short, but I have
dimed x as short. Any ideas. please :roll:
Dim x As Short

Dim objWinfaxSend As New wfxctl32.COleCoverPages
x = objWinfaxSend.Count()

It should hurt to be a programmer
 
H

Herfried K. Wagner [MVP]

* (e-mail address removed)-spam.invalid (redwebgeek) scripsit:
I am trying to list the types of coverpages available in winfax 10. I
have the imports at the top of the page.
Every time I run this I get a "Specified Cast is not valid" error. I
guess this makes sense since the .count item is a short, but I have
dimed x as short. Any ideas. please :roll:
Dim x As Short

Dim objWinfaxSend As New wfxctl32.COleCoverPages
x = objWinfaxSend.Count()

Are you really sure the exception occurs on this line? Maybe it occurs
in the implementation of the 'Count' property/method. Can you post the
complete exception text and/or callstack?
 
R

redwebgeek

Hi,

I appreciate you looking at this. It definately occurs on the
x =
objWinfaxSend.Count() line, when I
comment this out it runs. Doesn't do anything, but runs.

The Error in a messagebox that is called form 1 and say "Specified
Cast is not valid" then has an OK button. I opened the Callstack
window as you suggested and its empty. Both during the error and
after I hit OK.

when I do
[code:1:ab8216d443]MsgBox(TypeName(objWinfaxSend))[/code:1:ab8216d443]
I get a box saying
[quote:ab8216d443]COleCoverPagesClass[/quote:ab8216d443].

Thanks. Let me know if I can provide any other info.
 
C

Chris Dunaway

Please help me. ANY guess or ideas welcome
I am trying to list the types of coverpages available in winfax 10. I
have the imports at the top of the page.
Every time I run this I get a "Specified Cast is not valid" error. I
guess this makes sense since the .count item is a short, but I have
dimed x as short. Any ideas. please :roll:
Dim x As Short

Dim objWinfaxSend As New wfxctl32.COleCoverPages
x = objWinfaxSend.Count()

It should hurt to be a programmer

You've defined x as Short. What is the return type of the
objWinfaxSend.Count method?

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
R

redwebgeek

When I mouse over
[quote:4e4bc92ace]objWinfaxSend.Count()[/quote:4e4bc92ace] I get the
yellow help text that say [quote:4e4bc92ace]Public Overridable
property Count () As Short[/quote:4e4bc92ace]

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top