|
Yes, it's installed on 30+ different machines.
The spec of my machine is pretty high. I have a feeling it's either a Windows or .Net issue.
Cheers
|
|
|
|
|
I followed a simple tutorial from microsoft to use a simple function puts in msrcrtdll.dll. I created a console application (C#) and copied the code as it is given. The program runs fine but dees not print as it is supposed to do. I am using VS2008. Please help. Here is the code
<br />
using System;<br />
using System.Runtime.InteropServices;<br />
<br />
class PlatformInvokeTest<br />
{<br />
[DllImport("msvcrt.dll")]<br />
public static extern int puts(string c);<br />
[DllImport("msvcrt.dll")]<br />
internal static extern int _flushall();<br />
<br />
public static void Main() <br />
{<br />
puts("Test");<br />
_flushall();<br />
}<br />
}<br />
<br />
http://msdn.microsoft.com/en-us/library/aa288468(VS.71).aspx#pinvoke_example1[^]
|
|
|
|
|
Stick a Console.Read() after the call to _flushall(); and then run the exe directly from the debug or bin folder.
Not sure why it doesn't appear in the VS console window, though - possibly because it isn't the stdout target?
modified on Monday, May 12, 2008 1:31 PM
|
|
|
|
|
Thank you so much. It worked by directly running the .exe file. Also i created a simple DLL which implements a sum function. When i implement it in C#, it says it can not load the dll. I copied the DLL to the current folder. I do not know why it is not loading the DLL. Do you know why?
Thanks again
|
|
|
|
|
I'm sorry, I don't - if the usual rules of dll's is being followed it would need to be in the release/debug folder or in the System directory, but this goes beyond my experience with P/Invoke.
|
|
|
|
|
The problem was with my 64 bit windows (Vista). I have a couple of issue with it and this is one of them. The code runs fine on another machine (32 bit vista). Thanks for the help though.
|
|
|
|
|
If you wrote it in C++, the name of the function as seen by other tools will have been 'decorated' (some people say 'mangled') with extra characters indicating the types of the parameters. This is to support overloading, that is, multiple functions with the same name.
To suppress name mangling for a function, put extern "C" before the function declaration.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
hello,
while i am making an update to my software,i display a progress bar that run in another thread?
i don't know why but in some case the value of my progress stop from increasing?
any idea
dghdfghdfghdfghdgh
|
|
|
|
|
Nope, you'll have to be more specific for us to help you. Could be a coding issue, networking issue, any kind of issue.
I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder
|
|
|
|
|
ellllllllie wrote: while i am making an update to my software,i display a progress bar that run in another thread?
i don't know why but in some case the value of my progress stop from increasing?
Your Question Does not make any sence. Please be specific.
ellllllllie wrote: while i am making an update to my software
I Think you want to mean , you want some update operation and you want you progress bar moving !!! isnt It ?
ellllllllie wrote: any idea
If yes, Try to use BackgroundWorker Components in C# . because Progress bar run on Foreground thread and with low priority where as your background jub run with high priority. Thats why, you are getting your progress bar Stop Increasing, because your UI is not refreshing. . So Try to understand Background worker and work with it.
Best Regards
-----------------
Abhijit Jana
"Success is Journey it's not a destination"
|
|
|
|
|
yes abhijit jana
thats what i mean. also the form created by that thread will be totally white after a minimize action
plz i need ur help
best regards
dghdfghdfghdfghdgh
|
|
|
|
|
ellllllllie wrote: totally white after a minimize action
Because the thread is not Refreshing you UI . So Try to use BackgroundWorker .
It will resolve your problem.
Best Regards
-----------------
Abhijit Jana
"Success is Journey it's not a destination"
|
|
|
|
|
My idea - You're not doing it right.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Pls i need help, 'm kinda new 2 this.
i make an mdi container, then a button is pressed, then i call out a form and make it a child like this:
frmOne frm = new frmOne();<br />
frm.MdiParent = this;<br />
frm.Show();
Already, in the properties of frmOne i set it's WindowState Property to Maximized but when it comes out it is normal.
pls how else can i achieve this.
thanx.
He who goes for revenge must first dig two graves.
|
|
|
|
|
Try
frm.Size = frm.MaximumSize
?
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Im trying to pass a Class I have created to a button and am having some trouble finding where to overload the call function.
Here is the buttons code.
private void btnCalcLife_Click(PumpTest pTest, EventArgs e)
{
intgrav(pTest);
lblLife.Enabled = true;
lblLife.Text = lblLife.Text + pTest.tlife + " Hours";
}
The error is taking place in my designer window
this.btnCalcLife.Click += new System.EventHandler(this.btnCalcLife_Click);
|
|
|
|
|
The event handler of your button click must take object as a first argument. That's why you are getting error.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
I changed it to several different overloads, but still getting an error. Here is what it is now
private void btnCalcLife_Click(object sender, PumpTest pTest, EventArgs e)<br />
{<br />
intgrav(pTest);<br />
lblLife.Enabled = true;<br />
lblLife.Text = lblLife.Text + pTest.tlife + " Hours";<br />
}
I think I need to change this statement but dont know what to change it too
this.btnCalcLife.Click += new System.EventHandler(this.btnCalcLife_Click);
|
|
|
|
|
Why don't you have a look at documentation of button click event? You can't add additional parameter to the event handler.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
As Giorgi said, you cannot change the parameters of the event handlers. For the Click event, you get the first object sender parameter, which is always a reference to the Button sending the event (you can cast it), and EventArgs e which is useless. Other events pass arguments (eg. location where mouse was clicked) in an EventArgs -derived second parameter.
If you create your own event, you should derive from EventArgs to create your own class for passing parameters to the event handler. But you can only do this for events you define, not for system-defined events.
|
|
|
|
|
Yea thanks for the help, I found an article online about setting up a ridiculous way to send something to a button through a wierd method but found it easier to just set up another Public instance of the class and set it equal to the class passed by the parent form.
|
|
|
|
|
Hi sir.. i am trying to create a peer-to-peer application for my practice in c#.. i was wondering if any one could tell about the concept of peer-to-peer.. only.. thank you so much in advance..
|
|
|
|
|
pdoy0708 wrote: i was wondering if any one could tell about the concept of peer-to-peer
No, nobody knows anything about it, and if they did they certainly would not create a Wikipedia page on that subject, and if they did you certainly would not be able to find it by searching with google.[^]
Good luck, you're going to need it.
led mike
|
|
|
|
|
|
The unfortunately reality is that a truly anonymous peer-peer application used to be possible through the use of Broadcast packets however the potential abuse is too high.
Read up on Tor and Onion routers for a good look at anon. Peer to Peer.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|