|   | 
	 
  
    | 
RSS Feed - WebSphere MQ Support
 | 
RSS Feed - Message Broker Support
 |   
 
  
	     | 
	 | 
   
 
  
	|  Is MQCONNXAny supported in VB.Net? | 
	« View previous topic :: View next topic »  | 
   
  
  	
	  
		
		
		  | Author | 
		  Message
		 |  
		
		  | kevinf2349 | 
		  
		    
			  
				 Posted: Thu Jun 16, 2005 5:21 am    Post subject: Is MQCONNXAny supported in VB.Net? | 
				     | 
			   
			 
		   | 
		 
		
		    Grand Master
 
 Joined: 28 Feb 2003 Posts: 1311 Location: USA 
  | 
		  
		    
			  
				I am trying to use MQCONNXAny in a VB.Net program and I am having some difficulty in getting it to work. 
 
 
I have searched (Google) the Internet and found only 16 hits, most of them refer to VB rather than VB.Net. 
 
 
I can build the MQCNOCD fine which makes me suspect that support is actually there for this, but when I try the call
 
 
   
	| Code: | 
   
  
	                    Dim CNOCD As MQCNOCD
 
                    Dim co As MQCNOCD
 
                    MQCNOCD_DEFAULTS(CNOCD)
 
                    CNOCD.ConnectOpts.Version = MQCNO_CURRENT_VERSION
 
                    CNOCD.ConnectOpts.Options = MQCNO_NONE
 
                    CNOCD.ChannelDef.ChannelName = "xxx.CL.TCP"
 
                    CNOCD.ChannelDef.ConnectionName = "xxx(1414)" 
 
                    MQCONNXAny("tstqmgr", CNOCD, Hconn, CompCode, Reason)) | 
   
 
 
 
Visual studio barfs saying MQCNOCD cannot be converted to Long. 
 
 
I am sure I am missing something pretty simple but I can't figure out what. Can anyone see what I am doing wrong or even if what I am trying is even supported in VB.Net? 
 
 
VB.Net is fairly new to me...give me good old z/OS assembler anyday!    | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Thu Jun 16, 2005 5:33 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
			  
				This is from amqscnxb.frm in Tools/VB/sampVB6 
   
	| Code: | 
   
  
	  Dim Selector As Long
 
  Dim OpenCode As Long
 
  Dim od As MQOD
 
  Dim CNOCD As MQCNOCD                           ' MQCNO and MQCD
 
  
 
 '******************************************************************'
 
  '* Initialise the client channel definition if required           *'
 
  '******************************************************************'
 
  MQCNOCD_DEFAULTS CNOCD                         ' MQCNO defaults
 
  
 
  If chkUseClientChannelDefiniton.Value = 1 Then ' Checked ?
 
    CNOCD.ChannelDef.ConnectionName = txtConnName.Text
 
    CNOCD.ChannelDef.ChannelName = txtSvrconnChannelName.Text
 
    CNOCD.ChannelDef.Version = MQCD_VERSION_6    ' Compatible 5.2.x
 
  Else
 
    CNOCD.ConnectOpts.Version = MQCNO_VERSION_1  ' No MQCD passed
 
  End If
 
  
 
  '******************************************************************'
 
  '*  Connect to queue manager                                      *'
 
  '******************************************************************'
 
  QmgrNameIn = txtQMgrName.Text                  ' Use fixed length
 
  MQCONNXAny QmgrNameIn, CNOCD, Hcon, CompCode, Reason
 
  checkResult
 
   | 
   
 
 _________________ I am *not* the model of the modern major general. | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | kevinf2349 | 
		  
		    
			  
				 Posted: Thu Jun 16, 2005 5:36 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		    Grand Master
 
 Joined: 28 Feb 2003 Posts: 1311 Location: USA 
  | 
		  
		    
			  
				Jeff
 
 
Thanks. I already took a look at that but it didn't help me much. I 'thought' I had 'converted' it into .Net correctly but it is throwing the error I mentioned. (MQCNOCD connot be converted to Long.
 
 
I shall keep on searching. | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Thu Jun 16, 2005 5:44 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
			  
				Well, you're really not using .NET with the code you have written.  You're using the plain MQ API under essentially plain VB in a .NET runtime.
 
 
The .NET API to MQ is object oriented. 
 
 
Does the amqscnxb compile and run as is in your environment? _________________ I am *not* the model of the modern major general. | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | 
		    
		   | 
		 
	   
	 | 
   
 
  
	     | 
	 | 
	Page 1 of 1 | 
   
 
 
 
  
  	
	  
		
		  
 
  | 
		  You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
  | 
  		 
	   
	 | 
   
 
  	 | 
	  |