|
If you are missing the GDI+ dll, that would explain why the error only happens with GUI apps. GDI+ is the whole drawing library thing that c# uses.
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|
|
The Undefeated wrote: If you are missing the GDI+ dll, that would explain why the error only happens with GUI apps. GDI+ is the whole drawing library thing that c# uses.
Found this article which seemed to explain at least one of the errors above:
http://www.mono-project.com/DllNotFoundException[^]
It didn't fix my problem though, because even though there was a GDI+ library at "/usr/lib", it was called "libgdiplus.so.0" and "libgdiplus.so.0.0.0" (wrong folder and wrong name).
I tried to reinstall the GDI+ library, but the machine froze and I had to reboot to get it back.
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
DigiOz Multimedia wrote: If I run console applications, everything runs fine, but if I try to run a simple GUI application, I get the following exception
Finally found the solution to my problem. There was nothing wrong with GDI+, Mono or any other package on the system. The problem was Fedora 8s new Security System!! If I log in as root (not a good practice) and run the same application the GUI Application executes fine. So I think their new security system needs some more work.
Thank you everyone who tried to help.
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
Is there a way to convert a string type into a variable type: "string" > this."string"?
The effect I am looking for would be like the dynamic at runtime statement"this.'string' = 'the strings value'" sets a vaulue for the static compile time value "this.stringName"
Any comments or help?
Class MyClass
{
private string cn;
private string sn;
///I know.....not correct syntax
string this.cn = cn;
string this.sn = sn;
public void GetADObjectInfo(string dn)
{
DirectoryEntry entry = new DirectoryEntry("LDAP://"+ dn);
foreach (string strAttrName in entry.Properties.PropertyNames)
{
try
{
this.cn = (string)result.Properties[cn][0];
//I want the above to become something like this
//this.strAttrName = (string)result.Properties[strAttName][0];
}
catch
{
}
}
}
}
with Regards,
shwa guy
-- modified at 12:18 Friday 23rd November, 2007
|
|
|
|
|
shwaguy wrote: Is there a way to convert a string type into a variable type: "string" > this."string"?
??? huh?
Can you rephrase your question?
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
"There is no wealth like knowledge, no poverty like ignorance." Ali ibn Abi Talib
"Animadvertistine, ubicumque stes, fumum recta in faciem ferri?"
|
|
|
|
|
have a look at the System.Reflection namespace.
There are several articles about reflection here on CP.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
you actually understood what was meant? what was it?
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
"There is no wealth like knowledge, no poverty like ignorance." Ali ibn Abi Talib
"Animadvertistine, ubicumque stes, fumum recta in faciem ferri?"
|
|
|
|
|
the question was: "If I have the name of an existing field/method/property in a string,
how can I access that particular field/method/property?"
or something completely different.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
ah! Well, I'm glad you were able to understand what was wanted, because I sure didn't!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
"There is no wealth like knowledge, no poverty like ignorance." Ali ibn Abi Talib
"Animadvertistine, ubicumque stes, fumum recta in faciem ferri?"
|
|
|
|
|
I have added a DataReceived event to COM3 (the IrDA port) on my PPC. However, this event is never fired. If I use a short Sleep function and then do a Read, the expected data is there. Does anyone have an idea of what is wrong here? My code follows.
public partial class Form1 : Form
{
private SerialPort m_gIrDA;
private Byte[] sendbuf;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
void m_gIrDA_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
MessageBox.Show("This never happens");
}
private void button1_Click(object sender, EventArgs e)
{
try
{
if (m_gIrDA != null)
{
m_gIrDA.Close();
}
m_gIrDA = new SerialPort("COM3", // string portName,
57600, // baudRate
Parity.None,
8, // int dataBits,
StopBits.One);
m_gIrDA.Handshake = Handshake.RequestToSend;
m_gIrDA.ReceivedBytesThreshold = 3;
m_gIrDA.DataReceived += new SerialDataReceivedEventHandler(m_gIrDA_DataReceived);
m_gIrDA.DtrEnable = true;
m_gIrDA.Handshake = Handshake.RequestToSend;
m_gIrDA.Open();
sendbuf = new byte[10];
sendbuf[0] = 0x0a;
sendbuf[1] = 0x00;
sendbuf[2] = 0x01;
sendbuf[3] = 0x20;
sendbuf[4] = 0x35;
sendbuf[5] = 0x38;
sendbuf[6] = 0x30;
sendbuf[7] = 0x30;
sendbuf[8] = 0xf9;
sendbuf[9] = 0xec;
m_gIrDA.Write(sendbuf, 0, 10);
}
catch (System.IO.IOException)
{
m_gIrDA.Close();
MessageBox.Show("IOException");
}
}
}
Steven L Berntsen
Montreal QC Canada
sberntsen@kim.kaba.com
|
|
|
|
|
Hi,
i like to know how can i know if the table exsits in a "FILE".mdb
using Odbc or OleDb.
THNKS
Have Fun
Never forget it
|
|
|
|
|
simplest way is to use the table name in select statement and catch the exception for FILE DOES NOT EXIST...
-----
|
|
|
|
|
THANKS, i Figured It Out
But THANKS For Answering
Have Fun
Never forget it
|
|
|
|
|
NotifyIcon Click Problem
I setup my NotifyIcon named "sysTray" as
<br />
class MainForm : Form<br />
{<br />
void setUpTrayIcon()<br />
{<br />
sysTray.Icon = Icon.ExtractAssociatedIcon("App.ico");<br />
<br />
this.Shown += delegate(object o, EventArgs ev)<br />
{<br />
sysTray.Visible = true;<br />
};<br />
sysTray.Click += new EventHandler(doSysClick);<br />
<br />
MenuItem[] itm = {new MenuItem("Prev", new EventHandler(doPrev)),<br />
new MenuItem("Next",new EventHandler(doNext)),<br />
new MenuItem("Stop", new EventHandler(doStop))};<br />
this.trayMenu = new ContextMenu(itm);<br />
<br />
sysTray.ContextMenu = this.trayMenu;<br />
}<br />
}<br />
The Icon showsup correctly in System Tray Area. When I Right Click on it the Menu also shows up. But once the Menu is Poped Up then It does not matter if I click on the Menu or My App's Tray Icon the sysTray.Click Item still gets Fired and my EventHandler, doSysClick is called.
What I expect is that Only when I click on the App Icon in the System Tray should my doSysClick method be called.
If My System Tray Menu is Visible then if I click anywhere outside it, then it should just hide itself (that is the usual behaviour).
So what am I missing?
Thanks...
|
|
|
|
|
Use the MouseClick, MouseDoubleClick etc... events instead of the general click event.
|
|
|
|
|
the Pronblem is i have a table of employeeinfo having attribuyes
EmpID
EmpName
EmpFatherName
GenID
now GenID is a primary key of a separate table having two attributes that is
GenID
Gender
the problem is when the form runs displaying 3 textboxes and one combobox the user must select the entry from gender and click save the values must be stored in the table of sql that is Employeeinfo i saved the first three attributes by the following code
datarow.["EmpID"] = EmpID.text;
but on GenID it gives problem bcoz i want to relate the Gender attribute to the GenID Attribute in the EmployeeInfo table and must be saved in the sql data table
|
|
|
|
|
You asked the same question only a few minutes ago? Why have you posted it again?
Don't you know that this is rude?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Posting the same question minutes apart is not going to get it answered any faster. That is rude.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hi! All
I 've a storeprocedure that insert data into a table and return current id of that. record is succefully inserted but i couldnnot get that id, so how do i. any suggestion regarding this will be anticipated.
Bye.
id is not output paramater but it is return with 'return' keyword by store procedure.
-- modified at 11:09 Friday 23rd November, 2007
|
|
|
|
|
|
the Pronblem is i have a table of employeeinfo having attribuyes
EmpID
EmpName
EmpFatherName
GenID
now GenID is a primary key of a separate table having two attributes that is
GenID
Gender
the problem is when the form runs displaying 3 textboxes and one combobox the user must select the entry from gender and click save the values must be stored in the table of sql that is Employeeinfo i saved the first three attributes by the following code
datarow.["EmpID"] = EmpID.text;
but on GenID it gives problem bcoz i want to relate the Gender attribute to the GenID Attribute in the EmployeeInfo table and must be saved in the sql data table
sas
|
|
|
|
|
Mr.Sajid
In ur case:
I suppose ur not populating combobox with from a table; that's why u r facing the problem.
Regards
|
|
|
|
|
hi all,
I'm new user and beginner programmer . I want to ask about the way that I can shut down the pc ? I mean what is the library and function or methods that can help me to do this ?
thanks
|
|
|
|
|
|
And an even easier way (assuming your using XP, and probably Vista, but who knows) is to use:
Process.Start("shutdown", "some arguments");
And the arguments are:
-i Display GUI interface, must be the first option
-l Log off (cannot be used with -m option)
-s Shutdown the computer
-r Shutdown and restart the computer
-a Abort a system shutdown
-m \\computername Remote computer to shutdown/restart/abort
-t xx Set timeout for shutdown to xx seconds
-c "comment" Shutdown comment (maximum of 127 characters)
-f Forces running applications to close without warning
so:
Process.Start("shutdown", "-s");
Would shut down the machine.
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|