 |

11-02-2006, 07:06 AM
|
|
Newcomer
|
|
Join Date: Oct 2006
Posts: 2
|
|
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
|
|

11-02-2006, 10:05 AM
|
 |
Ultimate Antique
Administrator * Expert *
|
|
Join Date: Sep 2005
Location: Maldon,Essex, UK
Posts: 3,939
|
|
|
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
|

11-02-2006, 04:34 PM
|
|
Regular
|
|
Join Date: Sep 2002
Location: Guntown, Mississippi
Posts: 87
|
|
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
|
|
|

11-07-2006, 01:32 AM
|
|
Newcomer
|
|
Join Date: Oct 2006
Posts: 2
|
|
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.
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|