|
You can subscribe the Panel to the child Thumb s' Click event. Then, when the Thumb get clicked, the Panel will know about it and you can call its OnClick method.
Note, to do this, you'll need to subclass Panel .
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi! I need to display math equations in C# application. Unfortunately, seems like Microsoft Equation editor files (EXE and DLL) are not COM components, so i can't add it in VS controls toolbox. Does anyone have idea how to acomplish this?
Any other idea (not using Microsoft Equation)?
Thanks in advance!
|
|
|
|
|
Ive got a problem. i have made a classlibrary with dataclasses and a classlibary with data-accessorclasses (in which i use sqlqueries to get data from an sqldatabase). i try to import these classes in a webservice.
When i type "using DataClasses" (the dataclasses library), there isno problem at all.
But when i type "using DataAccessors" it doesnt recognises it. I've added the references, so that's not the problem. I also tried changing the name, but thats no problem either...
Any ideas?
Thx, Peter
|
|
|
|
|
how i chang culture in control panel in runtime in my program
I WANT chang clender type and short date format
22222222222
22222222222
-- modified at 8:40 Sunday 22nd January, 2006
|
|
|
|
|
Are you really sure that you want to do that? I would be pretty pissed if I ran a program and found out that it had changed my user settings.
Isn't it the default culture of the current thread that you want to change?
---
b { font-weight: normal; }
|
|
|
|
|
When program loads I start new thread which tries to connect some DB server.
this.Load += new EventHandler(Labels_Load);
private void Labels_Load(object obj, EventArgs ea)
{
Thread th = new Thread(new ThreadStart(myconnect));
th.Start();
}
And I need to load some data to comboBox lastBookings. Is it possible to access some form controls from Threads ?
private void myconnect()
{
mysql.mySqlConnect("localhost", "mydb", "usr", "psw");
lastBookings.DataSource = new string[] { "dsdf", "dsfsd ", "dsfa" };
}
I make a new thread because often there is no connection to DB server. And all net operations (if server is not availiable) slow up programm very much.
|
|
|
|
|
And why would you not be able to do that?
Try and see; the only way to learn...
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
no, dont work, but if I do the same:
lastBookings.DataSource = new string [] { "dsdf", "dsfsd ", "dsfa" };
not from a thread all works good.
|
|
|
|
|
The core rule is that you are not allowed to modify UI elements from outside the thread they were created in.
The way to go is to use Invoke or BeginInvoke in this case. Invoke performs the method call synchronously, BeginInvoke is asynchronous.
Regards,
mav
|
|
|
|
|
thank you very much! It helped me very much.
In my example it must be so (if someone will have the same question):
private void UpdateBookings(string[] str)
{
lastBookings.DataSource = str;
}
public delegate void UpdateBookingsCallback(string[] str);
private void myconnect()
{
string[] comboElements = {"el1", "el2", "el3" };
lastBookings.Invoke(new UpdateBookingsCallback(this.UpdateBookings), new object[] { comboElements });
}
-- modified at 6:35 Sunday 22nd January, 2006
|
|
|
|
|
Well I am sorry for missinforming you
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Anyway thanks for your attention to my question
|
|
|
|
|
Hi I have a function in unmanaged(VC++) dll which is accepting a refernce parameter
void check(UInt32& c)<br />
{<br />
c=20;<br />
}
I want to call this function from my managed code(C#)
so i used the following code
class Program<br />
{<br />
[DllImport("samp.dll")]<br />
public static extern void check(ref UInt32 c);<br />
static void Main(string[] args)<br />
{<br />
<br />
UInt32 s = 0;<br />
check(ref s);<br />
<br />
Console.WriteLine(s.ToString ());<br />
Console.ReadLine(); <br />
}<br />
<br />
}
but it shows me the error"Unable to find an entry point named 'check' in DLL 'samp.dll'."
is there any way to call a unmanaged dll's function(which has reference parameter) from managed code without using DLL import?? if yes please send me a sample code.
Thanks in advance
Srini
|
|
|
|
|
You can try using out :
[DllImport("samp.dll")]
public static extern void check(out ref UInt32 c);
Dunno if it works though (maybe only out, no ref?) ...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick || Fold With Us! || Pensieve || VG.Net ||
|
|
|
|
|
I believe both out and ref will work, but ref will cause the compiler to complain if the parameter hasn't been initialized before calling check() .
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
ok, so i know it's some sort of permission problem i'm having, but i can't quite figure out what exactly i need to do to get this working. my windows service is starting a new Process object and launching an EXE. this exe is not getting called, but as a test i confirmed that i am able to launch things like notepad and perfmon from this service.
i think i know what the problem is, but i just can't figure out how to fix it. my service is set to run under local system, and i believe the EXE i'm running is not running correctly because it needs resources that can only be accessed from the user account. is this correct? i've confirmed my code works by running the same code in a console app, and the exe successfully is called. it just won't get called from my exe!
any ideas?
thax!
|
|
|
|
|
Have you tried setting up the service to run as a specific user account, for instance the account you used to confirm that the EXE would start successfully?
You should only do that as a test, by the way. If it does turn out to be a permission issue, a new account or group should be created with the least necessary permission(s) to use the EXE.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
yeah, i tried running it as the user that i run the exe manually successfully from. still doesn't work. i even tried setting it to networkservice, and that didn't even run at all cuz of permission issues...
what else is there to try??
|
|
|
|
|
Well, are you logging events on the service? If so, are there errors getting logged?
Do you know for certain that the executable is not getting started? I don't know what it is you're trying to do, or what the executable is, so it's hard to make suggestions, but if you don't have some form of logging in place, then I would recommend adding some and seeing if anything comes of it.
Good luck.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
i saw some winsock errors in the eveentlog associated with my service.
theh exe i'm running is an exe that communicates with a server. so it opens up a tcp connection to a remote macine and sends some data...
the fact that this is not easy to get working seems to be a GOOD thing, since this is typical action of some malicious service i would assume...
i've spent a lot of time on this and i'm thinking it might be just easier to communicate with the natice c++ written in win32 code directly. then this way i would avoid haveing to spawn a new process and execute it, which is what's causing these security problems, right?
so i can either covert this win32 exe into a DLL or a com object and talk to it using .net's com interop or dill importing attributes. which one is easier?
-- modified at 11:00 Sunday 22nd January, 2006
|
|
|
|
|
In Tab Control the Tab Dialogs change their position automatically whenever I do a change. Sometimes they change at design time and sometimes at runtime. A very strange behaviour I am experiencing.
Help required.
The Phantom.
|
|
|
|
|
Hi, i'm a newbie at C#, how can i know if a child form was terminated? Let's say that there are 10 child forms and I closed 2 child forms, how can I know that these forms were closed? Thanks
|
|
|
|
|
hello, for those who didnt know an answer to this, i have found an answer, refer to this site, it's really helpful http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=181891&SiteID=1
ciao
|
|
|
|
|
my application closes a a few other applications which have system tray icons using the Process.Kill method. The application is closed succesfully, however they leave thier icons behind in the system tray. Is there any way i coould flush or refresh the system tray of useless icons.
|
|
|
|
|
You shouldn't kill other process except in extreme circumstances. Doing so doesn't give the process a chance to do any cleanup - like remove its tray icons - or worse. The normal way to close another application is to post a WM_CLOSE message to its main window.
Steve
|
|
|
|