Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

VB6 - Creating controls @ runtime

Thread Tools
 
Search this Thread
 
Old 23 February 2003, 06:07 PM
  #1  
dsmith
Scooby Regular
Thread Starter
 
dsmith's Avatar
 
Join Date: Mar 1999
Posts: 4,518
Likes: 0
Received 0 Likes on 0 Posts
Post

Can I create a winsock control @ run-time ?

Have some SNMP code running but dont want the code to have to be able to see a form with the winsock control on.

I kind of feel this should be obvious but I'm still feeling my way....

Thanks

Deano
Old 23 February 2003, 06:27 PM
  #2  
Fosters
Scooby Regular
 
Fosters's Avatar
 
Join Date: Jul 2000
Location: Islington
Posts: 2,145
Likes: 0
Received 0 Likes on 0 Posts
Post

if you're not going to use forms, then reference WSOCK32.DLL.

google searches usually bring up lots of info.
Old 23 February 2003, 06:29 PM
  #3  
Fosters
Scooby Regular
 
Fosters's Avatar
 
Join Date: Jul 2000
Location: Islington
Posts: 2,145
Likes: 0
Received 0 Likes on 0 Posts
Post

http://www.carterszoo.com/vb0001/vb_winsock.html for isntance
Old 24 February 2003, 08:21 PM
  #4  
Mr.M
Scooby Regular
 
Mr.M's Avatar
 
Join Date: Feb 2002
Posts: 483
Likes: 0
Received 0 Likes on 0 Posts
Post

Don't show the form !
Old 24 February 2003, 09:05 PM
  #5  
SiDHEaD
Scooby Regular
 
SiDHEaD's Avatar
 
Join Date: Apr 2002
Location: Birmingham
Posts: 9,196
Likes: 0
Received 0 Likes on 0 Posts
Post

As said, the simplest way is to use:

Load frmWinsock (or whatever) rather than frmWinsock.show

All the code/controls get initialised but it doesn't automatically show.

Andy
Old 24 February 2003, 10:21 PM
  #6  
dsmith
Scooby Regular
Thread Starter
 
dsmith's Avatar
 
Join Date: Mar 1999
Posts: 4,518
Likes: 0
Received 0 Likes on 0 Posts
Post

Ta

The invisible form method had occurred to me and is in fact how I'm currently doing it. I'll spend some time reading and googling to try the "proper" way this week. I was amazed at easy the winsock control is to use, all the winsock.dll decalrations look a bit scary for my novice skills at the moment

Deano
Old 25 February 2003, 02:49 PM
  #7  
SiDHEaD
Scooby Regular
 
SiDHEaD's Avatar
 
Join Date: Apr 2002
Location: Birmingham
Posts: 9,196
Likes: 0
Received 0 Likes on 0 Posts
Post

There are various open source winsock classes/modules that you can just sling straight in to refrence the dll without using a control on a form.

Have a look on one of the source-code sites.

Andy
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
JimBowen
ICE
5
02 July 2023 01:54 PM
KAS35RSTI
Subaru
27
04 November 2021 07:12 PM
Mattybr5@MB Developments
Full Cars Breaking For Spares
12
18 November 2015 07:03 AM
Sam Witwicky
Engine Management and ECU Remapping
17
13 November 2015 10:49 AM
Ganz1983
Subaru
5
02 October 2015 09:22 AM



Quick Reply: VB6 - Creating controls @ runtime



All times are GMT +1. The time now is 09:20 PM.