|
Has anyone got info on this?
I'm looking for code snippetts and some white papers ideally.
Cheers,
Simon
"Sign up for a chance to be among the first to experience the wrath of the gods.", Microsoft's home page (24/06/2002)
|
|
|
|
|
Never heard of it, can you give some more details?
|
|
|
|
|
You need to write a Managed C++ wrapper, and then call from other .NET assemblies. MQSeries headers are in C/C++.
Gaul
|
|
|
|
|
Thanks, Gaul.
Can you give me more info though.
How does one communicate with MQSeries normally (pre-.NET)?
Cheers,
Simon
"Sign up for a chance to be among the first to experience the wrath of the gods.", Microsoft's home page (24/06/2002)
|
|
|
|
|
Although I shall not venture into these waters, it seems there is a MSMQ MQSeries bridge. You could have a look into the System.Messaging namespace.
|
|
|
|
|
From a C++ app, include MQ Series header: imqi.hpp to get the MQI class declarations
#include "imqi.hpp" // MQSeries header file.
This provides a definition of MQ Series functions that enable you to connect to a queue, send message, etc.
Typical functions include things like:
connect()
open();
setOptions();
get();
close()
Also link with the lib file. You need to have MQ Series developer edition installed to get the Lib files. Assuming you have installed under Program Files, normally they can be found in:
"C:\Program Files\IBM\MQSeries\Tools\Lib"
Under the ..\Tools directory, you have samples for cplus, cobol, vb, etc.
You may want to take a look at IBM's developerworks site for MQ Series examples:
http://www-106.ibm.com/developerworks/
Gaul
|
|
|
|
|
I have by "accident" added a null value to an arraylist, but i cant seem to remove it...There is a hole in it! I guess some things dont work better with holes in it
Any suggestions?
|
|
|
|
|
Get the index of the null reference and use removeAt(index).
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
jan larsen wrote:
Get the index of the null reference and use removeAt(index).
Nope, I tried that and Remove(object). This is totally baffling me. I now check for null before it gets added, so it wont happen again, but I had to transfer all the data.
It will add the null even if I do a try catch for a NullReferenceException. Is this possibly a bug?
|
|
|
|
|
You are making some kind of mistake when you are trying to remove the item, try this:
ArrayList list = new ArrayList();
list.Add("item0");
list.Add("item1");
list.Add(null);
list.Add("item3");
Console.WriteLine("With null value at index 2:");
foreach (string str in list)
{
Console.WriteLine(str);
}
Console.WriteLine("");
list.RemoveAt(2);
Console.WriteLine("Without null value at index 2:");
foreach (string str in list)
{
Console.WriteLine(str);
}
It shows that removeAt() DOES work...
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
jan larsen wrote:
You are making some kind of mistake when you are trying to remove the item, try this:
Nope, i double checked...
This is my code:
for (int i = 0; i < list.Count; i++)
{
if (list[i] == null) { list.RemoveAt(i); i--; continue;}
}
I must also state that the arraylist get serialized/deserialized with the BinaryFormatter. Not sure if that can have an effect. Im going try recreate it, seeing that I had to "fix" it quickly...
|
|
|
|
|
OK i tried to resimulated this (after reboot) and it work Maybe my system just needed a reboot or maybe VS.NET was drunk again, it been behaving really badly after XP SP1.
Thanx for the help
|
|
|
|
|
jan larsen wrote:
For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
That's great - I laughed out loud - I think people are staring...
|
|
|
|
|
|
The even cooler thing is that, from what I understand, they plan on giving out the source to the entire site
|
|
|
|
|
Ray Cassick wrote:
The even cooler thing is that, from what I understand, they plan on giving out the source to the entire site
Seeing they have the right too all software hosted there, I would expect something in return.
|
|
|
|
|
leppie wrote:
I would expect something in return.
Attidues like this annoy me.
Microsoft is giving out free hosting for your projects, providing free tools and even planning on releasing all the source code for this app. Hosting costs serious money and not too mention the email subscriptions to the message boards on Workspaces.
If you don't like their license agreement then don't use it, simple as that. You cannot expect MS to give you a free lunch with Workspaces.
Hell, why don't you setup everything and start your own Workspaces.leppie or something. Maybe then you will see just what it takes to provide a "free" service.
|
|
|
|
|
Paul Watson wrote:
Microsoft is giving out free hosting for your projects, providing free tools and even planning on releasing all the source code for this app. Hosting costs serious money and not too mention the email subscriptions to the message boards on Workspaces.
Nothin stops me to goto SourgeForge or any other existing project solution that actually allow me to keep the right to my own work.
Paul Watson wrote:
If you don't like their license agreement then don't use it, simple as that. You cannot expect MS to give you a free lunch with Workspaces.
I never said I want it, I said I would expect something in return for MY work if they planning on using it. Even if its only recognition.
Paul Watson wrote:
Hell, why don't you setup everything and start your own Workspaces.leppie or something. Maybe then you will see just what it takes to provide a "free" service.
If I had the resources of MS, I would. Plus many more things!
Paul Watson wrote:
Attidues like this annoy me.
I wont comment, thats something every person has to decide for himself.
|
|
|
|
|
I'm not sure if this is the best place to post this or not... Anyway, I'm actually writing my program in VB.NET (no flames please) but the semantics are the same in this case...
This is probably a dumb question (ducks) but I just wrote my first application to actually use a .NET Web Service to retrieve content. It was really very easy to do and I like it alot... but .NET is actually going a step further than I really need it to. In my case, I actually WANT the raw XML response that's coming back from the web service. However, .NET is appropriately using the WDSL to package the response into a member of variable of the specified return type... which is really nice... if I needed that. Can anyone help me get at the XML response itself?
|
|
|
|
|
Sorry I cant help you
But you would get a quicker response in the Web Development forum
|
|
|
|
|
Matt Philmon wrote:
In my case, I actually WANT the raw XML response that's coming back from the web service. However, .NET is appropriately using the WDSL to package the response into a member of variable of the specified return type... which is really nice... if I needed that. Can anyone help me get at the XML response itself?
This is actually easier than you think, but it also baffled me for awhile.
Basically it is very easy: You use the the XMLTextReader and pass it the full URL of the web service. Not as a SOAP packet or anything, just the URL. You naturally need to pass the parametres through in the URL.
e.g. In my CP+ article I do exactly what you want like so: xtrBriefs = new XmlTextReader ("http://www.codeproject.com/webservices/latest.asmx/GetLatestArticleBrief?NumArticles=2");
It is C# but you can easily do it in VB.NET too. Have a look at my article, it explains how to retrieve the XML data and how to save it.
|
|
|
|
|
Thanks ALOT! That's perfect and exactly what I need. Sniff, sniff.. getting emotional. Heh.
|
|
|
|
|
ok, now before i go mad, can someone help me out here. below is what i have to change privileges.
public static bool SetPrivilege(string privilege, bool enabled)
{
if (Environment.OSVersion.Version.Major >= 4)
{
IntPtr tknPtr = IntPtr.Zero;
Process pr = Process.GetCurrentProcess();
OpenProcessToken(pr.Handle, 0, out tknPtr);
TOKEN_PRIVILEGES tp = new TOKEN_PRIVILEGES();
LUID luid = new LUID();
StringBuilder privString = new StringBuilder(privilege);
if (!LookupPrivilegeValue(null, privString, out luid ))
return false;
tp.PrivilegeCount = 1;
tp.Privileges[0].Luid = luid;
tp.Privileges[0].Attributes = enabled ? 0x00000002L : 0;
int sz = Marshal.SizeOf(typeof(long))*2;
sz += Marshal.SizeOf(typeof(int))*2;
return AdjustTokenPrivileges(tknPtr, false, tp, sz, null, 0);
}
else
return false;
}
[StructLayout(LayoutKind.Auto)]
private class TOKEN_PRIVILEGES
{
public int PrivilegeCount;
public LUID_AND_ATTRIBUTES[] Privileges = new LUID_AND_ATTRIBUTES[1];
}
[StructLayout(LayoutKind.Sequential)]
private struct LUID_AND_ATTRIBUTES
{
public LUID Luid;
public long Attributes;
}
[StructLayout(LayoutKind.Sequential)]
private struct LUID
{
public int LowPart;
public long HighPart;
}
and the marshaller complains about param #5:
AdjustTokenPrivileges(tknPtr, false, tp, sz,null, 0);
saying about how it cannot be marshalled no because it has no layout information. btw i get the same error even when i dont use null, and use a TOKEN_PRIVILEGE instead.
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
Nnamdi Onyeyiri wrote:
[StructLayout(LayoutKind.Auto)]private class TOKEN_PRIVILEGES { public int PrivilegeCount; public LUID_AND_ATTRIBUTES[] Privileges = new LUID_AND_ATTRIBUTES[1];}
That MUST be Sequential as well.
BOOL AdjustTokenPrivileges(
HANDLE TokenHandle, // handle to token
BOOL DisableAllPrivileges, // disabling option
PTOKEN_PRIVILEGES NewState, // privilege information
DWORD BufferLength, // size of buffer
PTOKEN_PRIVILEGES PreviousState, // original state buffer
PDWORD ReturnLength // required buffer size
);
Param #5:
PreviousState
[out] Pointer to a buffer that the function fills with a TOKEN_PRIVILEGES structure that contains the previous state of any privileges that the function modifies. This parameter can be NULL.
If you specify a buffer that is too small to receive the complete list of modified privileges, the function fails and does not adjust any privileges. In this case, the function sets the variable pointed to by the ReturnLength parameter to the number of bytes required to hold the complete list of modified privileges.
That is the keyword. Normally these ype of functions need to be called twice. First to find the size of the buffer that is to be allocated (Marshalled in your case) and then to perform the actual function.
I came across these types too in the RASAPI, and I assume they are everywhere
See ms-help://MS.VSCC/MS.MSDNVS/rras/rasclnt_88j7.htm[^] for more info. Have a look at the C++ example and things will become clear.
UPDATE: oi that link dont work, funny links from Visual Studio help works... Just copy shortcut then.
Hope this helps
|
|
|
|
|