Thank you, Bob! I was enlightened much through your words.
But I run into another problem. When I replaced that statement with "Set
MyComm = New MSComm",
the error changed to "Compile error: Invalid use of New keyword"
Why??
"Bob O`Bob" <filterbob@yahoogroups.com>
??????:%23GBzVmG5IHA.4344@TK2MSFTNGP03.phx.gbl...
> Thank you, Bob! I was enlightened much through your words.
> But I run into another problem. When I replaced that statement with "Set
> MyComm = New MSComm",
> the error changed to "Compile error: Invalid use of New keyword"
> Why??
That's a harder question.
I didn't actually check earlier, but I was pretty sure MSComm
was one of the controls you can't easily use that way.
What you ought to do is put the control on your form
at design time, and then you won't need "New" at all.
Since you're building a user control, there is probably
no reason /not/ to have it there all the time.
As for why that's really so, I don't think I actually know
well enough to explain. There probably are replacement
classes you could install to completely replace MSComm,
if you were building something which had no UI at all,
but I wouldn't recommend that to any beginner.
Bob
--
Adrian Chen - 13 Jul 2008 10:09 GMT
Bob, I've found the mistake! I was such a fool!
When I design the axtivex, I drag the MSComm control from control panel onto
usercontrol, a MSComm object has been generated automatically, so I needn't
define a object myself.
Sorry to cause you a lot of trouble! Thanks a lot!
"Bob O`Bob" <filterbob@yahoogroups.com>
??????:u5Yu1eK5IHA.3804@TK2MSFTNGP03.phx.gbl...
>> Thank you, Bob! I was enlightened much through your words.
>> But I run into another problem. When I replaced that statement with "Set
[quoted text clipped - 19 lines]
>
> Bob
Bob O`Bob - 13 Jul 2008 19:55 GMT
> Bob, I've found the mistake! I was such a fool!
>
> When I design the axtivex, I drag the MSComm control from control panel onto
> usercontrol, a MSComm object has been generated automatically, so I needn't
> define a object myself.
> Sorry to cause you a lot of trouble! Thanks a lot!
It's no trouble.
This is exactly what some of us enjoy and choose to do,
more or less as a hobby.
To see the learning process take place is more than enough
reward for the tiny bit of time I invested.
Bob
--