Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Communications > serial communication with netcomm.ocx from several forms


Reply
 
Thread Tools Display Modes
  #1  
Old 11-02-2006, 07:06 AM
Boris22 Boris22 is offline
Newcomer
 
Join Date: Oct 2006
Posts: 2
Question serial communication with netcomm.ocx from several forms


Hello,
I'm using the serial communication tool NETCOMM.OCX written by Dick Grier. In the explanation there's written:
"This places the control in the Toolbox. Now, drop it on a Form (...you must use it from the form. Visual Studio now builds a wrapper DLL, which takes a few seconds -- and it is ready to use."
That works very good, I've got it on a form.

But now I want to use it from other forms too.
It didn't help to declare it as public. I also tried to work with the SetFocus, but that would work only if the ocx is set to visible, what is not possible.
And I think it is not a good idea to put it on several forms, because I want to
avoid double access to the com port.

best regards,
Boris
Reply With Quote
  #2  
Old 11-02-2006, 10:05 AM
DougT's Avatar
DougT DougT is offline
Ultimate Antique

Administrator
* Expert *
 
Join Date: Sep 2005
Location: Maldon,Essex, UK
Posts: 3,939
Default

Hi and welcome,

I'm not too sure what your question actually is.

You have a 3rd party control on your Form that is in some way emulating MSComm - fine. What do you mean by 'But now I want to use it from other forms too.' ?

Regards
Doug
__________________
semel insanivimus omnes
S Data in context = Information, S Information in context = Knowledge, S Knowledge in context = Experience
S Experience in context = Wisdom= Data
Reply With Quote
  #3  
Old 11-02-2006, 04:34 PM
866JR 866JR is offline
Regular
 
Join Date: Sep 2002
Location: Guntown, Mississippi
Posts: 87
Default

I normally put my com routines in one form with mscomm, and call the routine, first filling public variables with any needed data then calling the routine like: form1.comtalk. This works well.





Quote:
Originally Posted by Boris22
Hello,
I'm using the serial communication tool NETCOMM.OCX written by Dick Grier. In the explanation there's written:
"This places the control in the Toolbox. Now, drop it on a Form (...you must use it from the form. Visual Studio now builds a wrapper DLL, which takes a few seconds -- and it is ready to use."
That works very good, I've got it on a form.

But now I want to use it from other forms too.
It didn't help to declare it as public. I also tried to work with the SetFocus, but that would work only if the ocx is set to visible, what is not possible.
And I think it is not a good idea to put it on several forms, because I want to
avoid double access to the com port.

best regards,
Boris
Reply With Quote
  #4  
Old 11-07-2006, 01:32 AM
Boris22 Boris22 is offline
Newcomer
 
Join Date: Oct 2006
Posts: 2
Default it works!

Hi,
I made some changes in my code.
Now I use the concept as follows:
I have my com routine in one form with mscomm. (in this form only the com routines and nothing else).
These routines are timer triggered.
I fill then the public variables as you wrote from other forms. And the action I want is just controlled by these variables.
E.g. I have the public variables:
oSendDataString As boolean
oWaitForDataStrings As boolean

This part is working fine now, the complete one will take some days or weeks...
Thanks for your hints.
Boris

Quote:
Originally Posted by 866JR
I normally put my com routines in one form with mscomm, and call the routine, first filling public variables with any needed data then calling the routine like: form1.comtalk. This works well.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->