|
Is the GDIPlus functionalty in .Net threadsafe?
e.g For Bitmap class, the MSDN states "Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe. ".
I am using the GDIPlus functionality inside .Net web services, is that safe?
Thank you,
Amit.
|
|
|
|
|
Hello friends ,
I have a problem with window services, actually i am new to it. and i have to complete few things.
i want my service get started as soon as system boots up. but i want it to perform any task only when any particular system event occurs..
so my question is How can i do this?
Can i add another event with apart from OnStart and OnStop
and if yes then how can i check the any perticular system event has occured..
Thanks in adv
Ravi Kant Srivastava
(System Analyst)
HandsOn Technology & Engineering
Gurgaon
(India)
e-mail:ravikant@hte.co.in
|
|
|
|
|
Hi All,
I'm reasonably new to C# and have recently been coding parts of a C# user interface which operates in tandem with a C/C++ back-end. Things have been going O.K. until I had to make use of a function, whose prototype looks like this:
int functionName (const char* param1, const char* param2, char* nastyParam)
In my C# code, I have been dealing with the const char* params by mapping them to C# strings...that has been working quite well. Now the problem with nastyParam above is the intention is for the function to (possibly) return some string value to the caller via nastyParam. The following is what I have done thus far for the function above:
...<br />
private static extern int functionName(<br />
[MarshalAs(UnmanagedType.LPStr)] param1,<br />
[MarshalAs(UnmanagedType.LPStr)] param2,<br />
[MarshalAs(UnmanagedType.LPArray)] IntPtr nastyParam);
I've been trawling the net for solutions and came across a suggestion which involved mapping the char* to a C# IntPtr (as above)...the explanation in that article made sense to me, so I gave it a go but no luck thus far.
Anyone have any ideas?
cheers!
-- modified at 4:44 Friday 6th April, 2007
|
|
|
|
|
Have a look here [^] (see the author's approach to GetClassName marshaling).
Hope that helps
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi,
you want a StringBuilder of sufficient capacity.
And it would be safer to pass the capacity (of buffer size) as a parameter as well
(so your C/C++ function can be made safe, in order to prevent buffer overflow problems).
|
|
|
|
|
Thanks guys. I'll give it a go and see how it turns out...
|
|
|
|
|
Worked beautifully. Thanks!
|
|
|
|
|
In C# (window application), I want to download a webpage content (ex:"http://codeproject.com") how can I do?
I know about "web browser control" but I don't want to use it.
Please help me!
Thanks!
|
|
|
|
|
Take a look at the HttpWebRequest class.
"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 www.troschuetz.de
|
|
|
|
|
Use DownloadFile method of the System.Net.WebClient Class.
|
|
|
|
|
i m making a window application in dotnet c#.
How can i make exe of my appliction?
Thanking You.
Regards Nekshan.
|
|
|
|
|
An executable is made whenever you compile your application. It resides in the Debug or Release folder of your project.
|
|
|
|
|
hi guys
i have created a schema named evs.xsd,
now i want to create am xml document based on this schma but dont know how to do that?
any help please
hello
|
|
|
|
|
Dear friends,
Im doing a project to my university which is a "LIVE E-LEARNING ENVIRONMENT"I have to find a C# coding for this purpose which i can capture each and every moment of the computer screen.
I have found a software called "camtasia",but lack to edit the screen capturing.
Please help me with a coding to support my need.
thank you
khema
khema
-- modified at 3:14 Friday 6th April, 2007
|
|
|
|
|
You want to know how to capture screen in C#.
Or you want to edit the screen capturing with camtasia?
|
|
|
|
|
Hi,
I have tried out the camtasia software, i dont think it supports .NET and aswell as the file is bulky.
Threrefore i like to know, is there anyother SW to use with .NET.
mainly i want to know about the motion capturing of the mouse moments,and the curser.
I found a free trial version of terbodemo SW 7.5.it captures the screen as screenshots and it plays as a movie clip.
please help me to find a .NET cording to meet my challenges.
Thank you
Khema
Khema
|
|
|
|
|
Hi,
I have already used the Camtasia SW, but the file that create is very bulky, therefore I like to find some coding for .NET compatible SW.
I have found another SW called TerboDemo(7.5 trial version), which captures the screen as an array of screenshots, which also take big capacity. It saves in .tdp format.
Please help me to find a .NET cording.
Thanks and Regards
|
|
|
|
|
i am making a window application in dotnet c#.
There is site, whose information i need to keep in database on local client machine.
If someone visits that site, value '1' must be stored in 'sitehit' column of my database else it must contain '0'.
i have field in my database : 'sitehit'.
how is this possible?
Thanking you in adv.
regards nekshan.
|
|
|
|
|
Hi
im devloping a client server program using C#.
What it basically does is the Server can connect 3,4 clients and they can send messags.
To do this i didnt use threads.
My problem is when client send a message to server it is not receved to the server.
Then it indicate a error "Cross thread operation not valid."
This is the solution i found form this site.
---------------------------------------------------------
Private Strt As System.Threading.Thread ;
Strt = New System.Threading.Thread(AddressOf MyThread1)
Strt.Start();
Sub MyThread1
' Working code
' Working code
' Working code
' Working code
' Working code
' Working code
AccessControl()
End Sub
Private Sub AccessControl()
If Me.InvokeRequired Then
Me.Invoke(New MethodInvoker(AddressOf AccessControl))
Else
' Code wasn't working in the threading sub
' Code wasn't working in the threading sub
' Code wasn't working in the threading sub
' Code wasn't working in the threading sub
' Code wasn't working in the threading sub
Button2.Visible = True
Button3.Visible = True
Opacity = 1
ShowInTaskbar = True
End If
End Sub
---------------------------------------------------------
but the problem is hence i do not use threads do i need to create threads to solve this problem?
Im developing the program using C#, so do i need to implement it in a same way of this code?
Thank you so much..
sweenySL
|
|
|
|
|
If you are not using Threads then are you using Asyncronous sockets? It would help a lot if you post your code.
|
|
|
|
|
Try
form1.CheckForIllegalCrossThreadCalls=false;
|
|
|
|
|
Hi,
you create threads when executing asynchronous stuff, e.g. with the timers (except for
Windows.Forms.Timer).
setting CheckForIllegalCrossThreadCalls false only disables the checking, it does
not avoid the problem that may result (UI freeze) immediately or after a while...
If InvokeRequired is true, you really need the Invoke (as you did), and then
the code you invoke should execute; check it with debugger or with logging !
PS: is this a C# question ?
|
|
|
|
|
Hi,
I am using dot net editor 2005.
I have written web site(c#.net,asp.net) which is using excel object in appliation.
Application,_Workbook.
I am feeding all data in excel application sheet.
I am saving file as
excelWorkBook.SaveAs(wwilFilePath,Type.Missing, Type.Missing, Type.Missing, false, false,
XlSaveAsAccessMode.xlNoChange, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
It is saving file in OS Xp.
But in windows server 2003 it will be giving following error:
The file could not be accessed. Try one of the following:• Make sure the specified folder exists.
• Make sure the folder that contains the file is not read-only.
• Make sure the file name does not contain any of the following characters: < > ? [ ] : | or *
• Make sure the file/path name doesn't contain more than 218 characters.
I have tried many combination on server end but probelm stil persist.
Also excel application executes under Network service account,I tried to give full access to this account in all distribution groups(all possible groups),excel application but problem still persist
Can any one help sugest any solution??
Manish
|
|
|
|
|
Manish,
It is considered bad practice to use Excel directly from an IIS web application.
If I remember correctly, no matter where you save to, Excel tries to access folders specific for the user it runs under, such as 'My Documents'. For these type of accounts like network service, ASPNET, etc these folders do not exist and that gives you these type of problems.
The work-around is a queued approach, where you queue requests for doing something with Excel. Then, you run an NT Service under a 'real' user account that picks up these requests and processes it. However, I was forced once to do something like that with Word and it's difficult to implement and it always remains error prone. Microsoft officially recommends against using Office applications in background services and for good reason.
Instead of trying to work around it, I suggest you look into buying one of those third party components that work natively on Excel files without requiring Excel on the server. Those are very stable and much faster than accessing Excel through its own object library. I've used components from SoftArtisans with excellent results.
See: http://www.softartisans.com/[^]
Hope this helps,
Roel
|
|
|
|
|
hi all
i have Datatable contain two colmnun "code" is type int And "Name" is nvarchar
I want search with context is
string arg = "code like '%%'";
dtdistric.Select(arg);
but it error
{"Cannot perform 'Like' operation on System.Int64 and System.String."}
|
|
|
|