|
Nooredin wrote: I think i have problem when the argument of the function is of pointer type. I checked functions with no pointer and there was no problem. That does not make sense, it just means that your function call does not match the function definition.
As to the remaining issue, if you have a problem with the code then you need to show us the code and any error messages you receive. If you need help in understanding how to use P/Invoke then I would suggest reading this white paper[^].
Use the best guess
|
|
|
|
|
hi dear Richard MacCutchan
you have helped me a lot with this. I appreciate it.
the most unbelievable problem with that dll was some functions did not included in the dll but described in manual and unfortunately i was focused on them
I have mostly done with this except introducing char array pointer to dll.
I wish I can do it soon.
By the way, thanks for your kind help.
|
|
|
|
|
Hi All,
My application is hosted in four servers. I wanted to create a tool that will be installed in any one of those servers. Purpose of this tool is to monitor App pool crash in each server and trigger a mail.
Could someone let me know how we can write this code in .Net?
Cheers
A.M.Jegan
|
|
|
|
|
|
amjegan wrote: Could someone let me know how we can write this code in .Net?
The application does something.
Your app periodically verifies that it is continuing to do something. If it isn't then send the email.
The specifics of that depends on what the application does.
And if the servers are load balanced and you really want to test each then you need a way to specifically kick off the task in each. So if each responds to some IP trigger then you need a way to independently send that trigger to each. Router/firewall and dns resolution might be involved to get that to work.
|
|
|
|
|
I have created xml file with node element and child elelement. I have created asp.net application using VS2008 and am unable to write to that XML file. Its giving already another process is using. Access dinied.
How to do this.
If anybody knows please reply me.
Thanks in advance.
|
|
|
|
|
Do not post your question in different places.
|
|
|
|
|
If the file is locked by amnother process you can't write to it. It's that simple. You have to wait for the other process to let go of the file.
If the process is the very same one you're writing, well, then you've done something wrong where you didn't close the file. You can't have more than one exclusive writer to the same file.
|
|
|
|
|
NO I have created application that displays a message on desktop always using that XML file and I need to change that XML message so that application keeps message changing on desktop.
how to do that
|
|
|
|
|
By disposing of the StreamWriter perhaps that has the file locked? It's obviously your app that's keeping it locked. That means you're probably not disposing something correctly.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
That's not at all what you described.
If the desktop application is only reading the file, then you can open it with a FileStream[^], specifying a Share.ReadWrite, allowing the ASP.NET application to Write to the file.
After you get the FileStream, you pass that object to your Xml reader.
The problem is that while you're reading it, the ASP.NET might write to it at the same time, corrupting the data you read, so you'll have to handle this case.
The ASP.NET code will have to be modified to open the file with Shared Read access so your desktop app can open it at the same time.
|
|
|
|
|
Good explanation.
Previous -> Read "CLR via C#" by Jeffrey Ritcher.
Current -> Exploring WCF thru Apress' "Pro WCF" by Chris Peiris and Dennis Mulder.
Next -> Need to read "The Art of Computer Programming" by Donald E. Knuth.
|
|
|
|
|
Hello guys, I have a prob with my typed DataSet, applying its query on SQL it makes fraction of second, running the program and since the query embedded in the DataSet it gives TIMEOUT!!!!
here is my query:
SELECT i.item_id, i.sequence, i.item_name, od.buy_price, od.sell_price,
SUM(od.quantity) AS sum_qty,
l.location_name, oh.usr_login,
CASE i.is_composite_item WHEN 1 THEN "anything" WHEN 0 THEN "something" END AS remarks
FROM item i, operation_detail od,operation_header oh,location l
WHERE
i.item_id=od.item_id and i.sequence=od.sequence and
od.operation_header_id=oh.operation_header_id and
oh.location_id=l.location_id and
(oh.operation_type_id = "anything") AND
(oh.operation_date >= @date_from ) AND
(oh.operation_date <= @date_to ) AND
(i.item_id >= @item_id_from OR @item_id_from = 0)
AND (i.item_id <= @item_id_to OR @item_id_to = 0)
AND (l.location_id = @location_id OR @location_id = '0')
AND (i.is_raw_item = 0)
GROUP BY i.item_id, i.sequence, i.item_name, l.location_name,
oh.usr_login, od.buy_price, od.sell_price,i.is_composite_item
order by i.item_id, i.sequence,l.location_name
|
|
|
|
|
The fact that it runs under a typed dataset will not make it that much slower. What's your timeout set to? Are you sure you're querying the same database from code as you're executing directly? How much data is there in the resultset?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
nagham_4ng wrote: FROM item i, operation_detail od,operation_header oh,location l
WHERE
i.item_id=od.item_id and i.sequence=od.sequence and
od.operation_header_id=oh.operation_header_id and
oh.location_id=l.location_id and
You should try to avoid this old-style join syntax; use an INNER JOIN instead:
FROM
item As i
INNER JOIN operation_detail As od
ON i.item_id = od.item_id And i.sequence = od.sequence
INNER JOIN operation_header As oh
ON od.operation_header_id = oh.operation_header_id
INNER JOIN location As l
ON oh.location_id = l.location_id
WHERE
...
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
It didn't work guys, I guess that the prom from the date field but cant figure out how to solve it
|
|
|
|
|
nagham_4ng wrote: I guess that the prom
No, don't guess, verify.
All you've shown is a query; try answering the questions and show us how you load it into a dataset.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Guys can't figure out how will I post the Typed DataSet here, I created a Typed Dataset, right click add new DataTable and than I paste this query, than from my from what I wrote:
TableAdapter.Fill(DataSet.DataTable,datetimepicker1.value,datetimepicker2.value,textbox.value,textbox.value)
|
|
|
|
|
Now I removed the date parameters and no time out anymore, so now am sure that my prob is with the datetime parameter, can anybody help me on this
|
|
|
|
|
There's little one can help with; how much options does the wizard have?
Can you post the query?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi, I want to use message queues to send a class, which includes a bitmap. Creating, connecting and sending is no problem and receiving in the same application works just as well. But the same code in an other application throws a "SerializationException"
The code I use for the server application:
private void MainLoad(object sender, EventArgs e)
{
MessageQueue.Create(@"MYPC\MyQueue", false);
MessageQueue queue = new MessageQueue(queueName);
queue.BeginPeek(TimeSpan.FromDays(10.0),messagenumber++, new AsyncCallback(MyPeekCompleted));
}
private void MyPeekCompleted(IAsyncResult asyncResult)
{
MessageQueue queue = new MessageQueue(@"MYPC\MyQueue");
queue.Formatter = new BinaryMessageFormatter();
System.Messaging.Message msg = queue.Receive(TimeSpan.FromDays(10.0));
Protocol p = (Protocol)msg.Body;
queue.BeginPeek(TimeSpan.FromDays(10.0), messagenumber++, new AsyncCallback(MyPeekCompleted));
}
private void ButtonSendClick(object sender, EventArgs e)
{
MessageQueue queue = new MessageQueue(@"MYPC\MyQueue");
Bitmap bmp = new Bitmap(@"D:\lena.gif");
Protocol p = new Protocol();
p.text = "test";
p.sender = senderID;
p.receiver = "Client";
p.bitmap = bmp;
System.Messaging.Message m = new System.Messaging.Message(p, new BinaryMessageFormatter());
queue.Send(m);
}
Protocol is a class:
[Serializable()]
public class Protocol
{
public string sender;
public string receiver;
public string text;
public System.Drawing.Image bitmap;
}
The code I use for the client application:
private void MainLoad(object sender, EventArgs e)
{
MessageQueue queue = new MessageQueue(@"MYPC\MyQueue");
queue.BeginPeek(TimeSpan.FromDays(10.0),messagenumber++, new AsyncCallback(MyPeekCompleted));
}
private void MyPeekCompleted(IAsyncResult asyncResult)
{
MessageQueue queue = new MessageQueue(@"MYPC\MyQueue");
queue.Formatter = new BinaryMessageFormatter();
System.Messaging.Message msg = queue.Receive(TimeSpan.FromSeconds(10.0));
Protocol p = (Protocol)msg.Body;
queue.BeginPeek(TimeSpan.FromDays(10.0), messagenumber++, new AsyncCallback(MyPeekCompleted));
}
modified 4-Jul-13 4:51am.
|
|
|
|
|
A colleague of mine solved it today, if the protocol is in a DLL, there no problem anymore.
|
|
|
|
|
I want to know how to connect in LAN and use the Message Queue to send messaged to the connected Pcs. I am working in C# language and OS is Win 7.
|
|
|
|
|
Well, the ?NET framework has this[^] available.
|
|
|
|
|
Thanks for the article. And you should respect elders ! It will be good for you.
|
|
|
|