Posted: Wed Oct 01, 2003 4:42 am Post subject: MQe connection array problem
Newbie
Joined: 19 Sep 2003 Posts: 2
Hi!
I'm trying to use the native C API mqeAdministrator_Connection_create to create a connection and then create a async remote queue
To do so a struct (MQeConnectionDefinitionParms) has to be set and sent as a parameter
In the struct there is a pointer to an array (hAdapterClass) which should contain the ipaddress and the port
My problem is that I try to do this from C# and I get an native exception (probably because of the array...?)
Exception code 0xc0000005
And so, what is the proper way of creating a hAdapterClass array in C#?
This is my attempt:
int[] address = new int[2] { hIPAddress, hPort };
IntPtr addressPtr = Memory.AllocHLocal(Marshal.SizeOf(address));
Marshal.Copy(address, 0, addressPtr, Marshal.SizeOf(address));
The I set hAdapterClass = addressPtr
These are the global variables values I use to set the struct
public const string MQE_CHANNEL_CLASS = "com.ibm.mqe.MQeChannel";
public const string MQE_HTTP_ADAPTER = "com.ibm.mqe.adapters.MQeTcpipHttpAdapter";
public const string MQE_HTTP_COMMAND = "?Channel";
Is it a way to send the ipaddress, port info without the array?
Along with the MQE_HTTP_ADAPTER perhaps? (something like "Network:111.222.33.444:8080")
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