|
Thanks a lot for the sample!!!
But I think, that I can not copy some C-files (*.c, *.h) to the project CLib without any changes on the files...
or, do you have any idea?
|
|
|
|
|
strizi wrote: But I think, that I can not copy some C-files (*.c, *.h) to the project CLib without any changes on the files...
Have you tried it? If it does not compile then there's cause for concern. If it does then all well and good.
|
|
|
|
|
Sorry, but on looking through the code I havened seen (unerstand) the NativeMethods.cpp
Now I understand the Porgram, and this is exact the program, what I am looking for.
MANY THANKS
|
|
|
|
|
Hello All,
I have an unmanaged dll (xxx.dll). I want to use the methods of this dll in a c# windows application. But I'm getting the following error while executing the code:
Unable to load DLL '...'. The specified module could not be found. [Exception from HRESULT: 0x8007007E]
I have also placed the dll in System32 folder.
Any ideas to solve this issue?
Thanks in advance
Shahtech
|
|
|
|
|
Hi,
I found the solution. Earlier I have not added the supporting dlls to C:\WInNT\System32 folder and Bin folder of application.
This solved my problem.
Thanks,
shahtech
|
|
|
|
|
Many times i c people use Type.missing and sometimes null . are they same or have any difference.
|
|
|
|
|
Hi Mogaambo,
Type.Missing indicates that you want to use the default value for the specified parameter.
Null basically means empty.
Cheers,
|
|
|
|
|
How to Chenge MESSEGE BOX font.
|
|
|
|
|
You can't change most aspects of the standard messagebox directly. You could always create a custom form class that mimics the messagebox in order to do this. There is a really good custom messagebox class in the form of an article. I suggest you search for it.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
i m using SQL server 2005.in this i have a field "Place". i have made a form in which i have used drop down list in which these Place field is shown.in C# i want a code so that if user select the particular place from that drop down list, that should be entered in the database of SQL server 2005.i have made a add button on the form for the user to add the selected place in the database.the required coding i have to write in this add button.Please reply me urgently........
|
|
|
|
|
What have you tried doing so far? Show what code you have tried.
Preeti1979 wrote: reply me urgently........
That is considered rude. Please refrain from that
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Seeking help with the last blocks of codes numbered 1 and 2 on the forme1.cs and queue.cs shown below.? It all working well. Stack on the last blocks.
FORM 1.CS
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Queuebuilder
{
public partial class Form1 : Form
{
public Form1()
{
myQueue = new queue();
myQueue.queue_init();
InitializeComponent();
}
queue myQueue;
// making a queue empty
private void initbutton_Click(object sender, EventArgs e)
{
myQueue.queue_init();
displayQueue();
}
// enqueueing an item
private void enqueuebutton_Click(object sender, EventArgs e)
{
int val;
try
{
val = Convert.ToInt32(inputBox.Text);
inputBox.Clear();
}
catch
{
MessageBox.Show("Please enter an integer.");
inputBox.Focus();
return;
}
myQueue.enqueue(val);
displayQueue();
inputBox.Focus();
}
//
private void dequeuebutton_Click(object sender, EventArgs e)
{
myQueue.dequeue();
displayQueue();
//displayBox.Focus();
}
// displaying queue contents
private void displayQueue()
{
string displayString;
displayString = myQueue.printQueue();
displayBox.Clear();
displayBox.AppendText(displayString);
displayBox.AppendText("\n");
}
1. // Trying to remove every second item
private void evenitemsbutton_Click(object sender, EventArgs e)
{
myQueue.dequeue();
displayQueue();
}
2. // Trying to reverse the queue
private void reversebutton_Click(object sender, EventArgs e)
{
}
}
}
------------------------------------------------------------
QUEUE.CS
using System;
using System.Collections.Generic;
using System.Text;
namespace Queuebuilder
{
class queuenode
{
public int nodedata;
public queuenode next;
}
class queue
{
queuenode front; // referencing to front of queue
queuenode rear; // referencing to rear of queue
// initialising a queue
public void queue_init()
{
front = null;
rear = null;
}
// testing for an empty queue
public Boolean empty()
{
return(front == null);
}
// adding a value to the rear of a queue
public void enqueue(int val)
{
queuenode temp;
temp = new queuenode();
temp.nodedata = val;
temp.next = null;
if (empty())
front = temp;
else rear.next = temp;
rear = temp;
}
// building a string that represents queue contents
public string printQueue()
{
string nextItem;
string queueContents;
queuenode queueRef;
queueContents = " ";
queueRef = front;
while (queueRef != null)
{
nextItem = queueRef.nodedata.ToString();
queueContents = queueContents + nextItem + " ";
queueRef = queueRef.next;
}
return queueContents;
}
// adding a code to dequeue an item from the front of a queue
public void dequeue()
{
//front = front.next;
if (empty())
front = null;
else
front = front.next;
}
1. // Trying to add code to remove every second item from a queue
public void even_items()
{
delete(front);
front = front.next;
}
}
2. // Trying to add code to reverse a queue
public void reverseQueue()
{
}
}
}
modified on Wednesday, August 6, 2008 5:20 AM
|
|
|
|
|
Why cant you go for a Queue<t>[^] class?
For reversing you may have to make use of Array.Reverse method.
*jaans
|
|
|
|
|
How do I do that?
|
|
|
|
|
1. You can use the ToArray method of Query class to get the array of items.
2. Use Array.Reverse method for reversing it.
3. Create a new queue instance with the reversed array.
Note: I won't be giving the code as it seems to be a home work
*jaans
|
|
|
|
|
It is actually not a homework. It is a code question from past exam papers. I would appreciate so much if you could show the code structures just for the last blocks only as is seen.
modified on Thursday, August 7, 2008 3:20 AM
|
|
|
|
|
Hi,
I need to change some settings / values of the resource file (ini / XML) that I have added at runtime to my project.
How can I achieve this???
Thanks in advance,
Vaibhav
|
|
|
|
|
how can LogOff the computer in c# ?
can anybody help me ?
H.R
|
|
|
|
|
|
hi,
i just starting using C#, and i am trying to use login box, however when i tried to compile, theres an eror that come out like the title of this thread.
i tried to save my database file in that path, and also tried to make new file in other path, but the same error keeps coming out.
I am lookin forward for your help
Regard,
eQyZ
|
|
|
|
|
It seems the Jet Engine isn't installed on your system.
|
|
|
|
|
Hi
I am just starting c#. I am trying to build login box using c#. However, I got a problem that frustated me a lot
I use microsoft access for my database. and I always get following error Syntax error in string in query expression 'UserName= fds' Password = sdf'.
I have used oledb connection, oledb command, oledbdatareader. I think I have an error in my query in database
here is my querry
------------------------------------------------------------------------------------------
String sqlCommand = "SELECT Username, Password FROM [logindatabase]" +
"WHERE UserName= "+ username +"' Password = "+ password;
-------------------------------------------------------------------------------------------
I am wondering why I got that message.
but overall, the connection string is working successfully only this code make me stuck
I am really lookig forward for your suggestion .Thanks so much.
|
|
|
|
|
A) You left out the apostrophes.
B) You left out the AND.
C) Don't do it that way; use parameters:
cmd.CommandText = "SELECT Username, Password FROM logindatabase WHERE UserName=@username and Password=@password" ;
cmd.Parameters.Add ( "@username" , username ) ;
cmd.Parameters.Add ( "@password" , password ) ;
Access and the Jet Engine will allow named parameters, but they need to be in the same order as in the statement.
D) Why return the username and password? Why not a COUNT(*) or the user's ID or something? Returning a single value with ExecuteScalar is likely to be quicker.
E) I prefer not to use concatenation to split long strings of SQL; I use verbatim strings (note the @):
cmd.CommandText =
@"
SELECT Username
,Password
FROM logindatabase
WHERE UserName=@username
and Password=@password
" ;
And why do so many people use a separate local string variable?
F) Are you storing the plain-text password? I suggest using at least a hash of the password.
|
|
|
|
|
|
From within the project server 2007 event handler when i try creating the MS Project COMponent I get this error. I'm running application on windows 2003 server, using C# on VS2005. I've already configured the security settings of dcom, giving rights to "Network Service" user for launching/activating the MS project component. There is no issue in creating the COMponent if I do so using simple dialogue based application. The error is reported (Retrieving the COM Class factory for COMponent class factory with the CLSID {36D27C48-A1E8-11D3-BA55-00C04F72F325} failed due to the following error: 80080005) only if creating from within the Project server event handler, which runs as an exe (Microsoft.Office.Project.Server.Eventing ) under the user "Network Service".
Any help plz
Madni
|
|
|
|