|
I need to insert Help(my own) in a C# windows application, which is accessible through a menuitem called Help.
Does any one have a clue on how to do this?
GaMBiT---> aND ReVeNGe WiLL Be
|
|
|
|
|
Hi,
You can use C# Help class or HelpProvider for providing the help. To provide the help we can use the Help class showhelp and helpindex methods.
Regards
SGS
|
|
|
|
|
Thanks....that's really What I needed!
Thanks again!
GaMBiT---> aND ReVeNGe WiLL Be
|
|
|
|
|
Can anyone tell the diffrence btn. Multithreading and APPDOMAIN, as i know Appdomain is "Application domain is a construct in the CLR that is the unit of isolation for an application." and Mutithreading is " the ability of an operating system to concurrently run programs that have been divided into subcomponents, or threads"
So whats the diff. btn. two and which to be used when?
vipsi
|
|
|
|
|
With multithreading two tasks can run at the same time. E.g. one thread waiting for data coming from the internet and the other one doing immediatly processing what has come so far. This concept is also important if you want to do heavy calculation but the GUI should still be responsible (e.g. for cancelling).
Appdomains are something completely different. With them you can have isolated parts in your app which have no direct way to interact. All communication passes a boundary by remoting constructs in .Net. Appdomains are important when you need several security levels in one application, when dynamically loading and unloading assemblies and in many more situations which I cant remember now .
|
|
|
|
|
Thanx, But is it both interlinked ? like in gotdotnet APPDOMAIN FAQ there is a sample code using Threading class!! What i mean is do we have to uses Thread class for Appdomain ? Also if u know any URL for Thread or Appdomain then please give the link.
// C# Sample Code
// File: HelloWorld1.cs
using System;
using System.Threading;
public class HelloWorld
{
public void SayHello(String greeting)
{
Console.WriteLine("In the application domain: " + Thread.GetDomain().FriendlyName);
Console.WriteLine(greeting);
}
public static void Main( String[] argv )
{
HelloWorld o = new HelloWorld();
o.SayHello("Hello World!");
}
}
vipsi
|
|
|
|
|
If you look closely at that code you posted the only use of the thread class is to use a static helper method GetDomain() - no threads are created at any time.
|
|
|
|
|
using System.Threading;<br />
namespace mynamespace < when this executes it is in an app domain
<br />
{<br />
public class myClass:Forms<br />
{<br />
...<br />
Thread computationalThread;<br />
MyCompute computational = new MyCompute();<br />
computational.DoneEvent+= new DoneEventHandler(newValue);<br />
compuationalThread = new Thread(computational.ComputeData);<br />
compuationalThread.Start(); < now I begin an independant thread in my app domain
<br />
...<br />
public void button_press(sender, eventargs)<br />
{<br />
computational.ValueOne = myForm.Data.Text;<br />
computational.ValueTwo = myForm.DataTwo.Text;<br />
return;<br />
}<br />
public void newValue(..)<br />
{<br />
myForm.DataResult.Text = computational.Result;<br />
return;<br />
}<br />
<br />
Notice that everything in this case is running inside a single app domain. Inside that domain I have 2 threads that I created. (the system probably creates tons) My computational thread runs independantly but due to the limits of Windows form processing I cannot update the screen!!! So it raises an event -- the event enters the message pump -- and my application updates the screen. The window continues to react to all other events during that calculation such as paintovers, mouse moves, mouse clicks, etc.
Go to MSDN and read the tutorials on multi-threading. It really helps to get a handle on things.
There are 10 kinds of people in the world.
Those that read binary...
...and those who don't.
|
|
|
|
|
Hi All
Is it possible to identify the character which gets deleted when the backspace is pressed in a Textbox.
Regards
Deepak.S
|
|
|
|
|
A way is to store the text in the Textbox, when ever the key is stroke. The next time key is up, compare the previous text with the current text.
Another way is to catch the key down event. Check if it's a backspace, then get the last text in the current TextBox.
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
Hi
What u say is right when the user is going to delete the text when the cursor is at the last positon.. what if he places the cursor at some other line in the richtextbox and then do a delete.. this where i am facing the problem how will i know what is he deleting.... i gotta identify that..
|
|
|
|
|
Before Delete the Text Box is before , after delete the Text Box is befre . The idea is to track this changes, compare the first char of both string, then compare the second, the the third, when you compare the fourth it's not a match, so there is a character deleted.
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
I have seen people posting similiar problems but have yet found a solution that solves my issue, so here it goes again.
My windows form app, which utilize Microsoft WSE 2.0 SP1, connects to a web serivce via SSL(https) periodically. It works most of the time however I get follow exception from time to time.
System.Net.WebException: The underlying connection was closed: Unable to connect to the remote server.
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult)
at System.Net.HttpWebRequest.GetRequestStream()
at Microsoft.Web.Services2.SoapWebRequest.GetRequestStream()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
...(user code that invokes the web service call)
System config:
XP Pro + SP2
.Net 1.1 + SP1
WSE 2.0 SP1
What causes the problem and how do I fix it? TIA!!
|
|
|
|
|
Does anyone know how to pop up alerts from an icon in the tray ?
|
|
|
|
|
try this
http://www.codeproject.com/cs/miscctrl/RobMisNotifyWindow.asp
|
|
|
|
|
|
Hi,
I'm trying to call a program in a .dll file that is built with C. The .dll program takes a pointer to a structure and then will return that structure with additional information filled in. The .dll program will also return a BOOL if the function was successful or not.
I have no problem calling the function, I'm having a problem building a structure that I can pass with a pointer.
From what I have been reading, I should be able to allocate a chunk of memory for the structure to hold, copy the existing data into the memory area and pass a pointer.
Attached below is my code that I am having a difficult time getting to compile. It starts with line number 265 with unsafe.
<br />
unsafe<br />
{<br />
<br />
IntPtr pCreditCardStruct = Marshal.AllocHGlobal(sizeof(CreditCardStruct));<br />
Marshal.StructureToPtr(CreditCardStruct, pCreditCardStruct, false);<br />
Marshal.Copy(CreditCardStruct, 0, pCreditCardStruct, sizeof(CreditCardStruct));<br />
}<br />
<br />
_ProcAuthorizationWeb(pCreditCardStruct);<br />
The structure looks like this:
<br />
[StructLayout (LayoutKind.Sequential)]<br />
public class CreditCardStruct<br />
{<br />
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 15)] public string strTransType;<br />
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 30)] public string strMerchant;<br />
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 11)] public string strInvoiceNumber;<br />
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 24)] public string strCardNumber;<br />
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4) ] public string strCVV2;<br />
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5) ] public string strExpDate;<br />
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 35)] public string strCardHolderName;<br />
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 25)] public string strStreetAddress;<br />
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 10)] public string strZipCode;<br />
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9) ] public string strTransAmt;<br />
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 7) ] public string strAuthCode;<br />
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 40)] public string strResponse;<br />
[MarshalAs(UnmanagedType.Bool)] public bool bCardPresent;<br />
[MarshalAs(UnmanagedType.Bool)] public bool bCustomerPresent;<br />
[MarshalAs(UnmanagedType.Bool)] public bool bDeferred;<br />
}<br />
The error messages I'm getting are:
q:\mcp\authorization.aspx.cs(268,61): error CS0208: Cannot take the address or size of a variable of a managed type ('MCP.CreditCardStruct')
q:\mcp\authorization.aspx.cs(270,66): error CS0208: Cannot take the address or size of a variable of a managed type ('MCP.CreditCardStruct')
q:\mcp\authorization.aspx.cs(270,6): error CS1502: The best overloaded method match for 'System.Runtime.InteropServices.Marshal.Copy(int[], int, System.IntPtr, int)' has some invalid arguments
q:\mcp\authorization.aspx.cs(270,19): error CS1503: Argument '1': cannot convert from 'MCP.CreditCardStruct' to 'int[]'
q:\mcp\authorization.aspx.cs(273,27): error CS0103: The name 'pCreditCardStruct' does not exist in the class or namespace 'MCP.Authorization'
It appears that I can not use sizeof for the structure since its in "SAFE" code and I have the wrong format for the Marshal.Copy but from what I'm reading in the documentation it should be right.
Any ideas what I'm doing wrong and what is the best way to do this?
Thank you very much,
Glenn
|
|
|
|
|
Try passing the struct as a ref instead of an IntPtr
[DllImport("SomeDll.dll")]<br />
public static extern void _ProcAuthorizationWeb(ref pCreditCardStruct);<br />
<br />
CreditCardStruct pCreditCardStruct = new CreditCardStruct();<br />
_ProcAuthorizationWeb(ref pCreditCardStruct);<br />
"I think I speak on behalf of everyone here when I say huh?" - Buffy
|
|
|
|
|
i have a unmanaged dll in c++ that calls a
callback function in c# module
I want the c# code to fill an array for me
so the c++ code can use it
I can send an array but how can I do it by reference ?
osiliti
|
|
|
|
|
Hello there!
I am trying to create an export for DataGrids and Bitmaps into Excel.
To do this, I created an overloaded function with the ability of exporting into a specific worksheet.
Right at the moment, the function looks a little like this:
public void datagrid(GridTab gt_toexport, int sheetnr)<br />
{<br />
Excel.ApplicationClass excel = new ApplicationClass();<br />
Excel.Workbook excelWorkbook;<br />
<br />
<br />
if (File.Exists(target))<br />
{<br />
excelWorkbook = excel.Workbooks.Open(target,<br />
0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",<br />
true, false, 0, true, false, false);<br />
}<br />
else<br />
{ <br />
excelWorkbook = excel.Workbooks.Add(XlWBATemplate.xlWBATWorksheet);<br />
}<br />
<br />
Excel.Sheets excelSheets = excelWorkbook.Worksheets;<br />
<br />
Excel.Worksheet excelWorksheet = (Excel.Worksheet)excelSheets.Add(null, excelSheets.Count, 1, true);<br />
<br />
System.Data.DataTable table = gt_toexport.Table;<br />
<br />
<br />
excel.Save(target);<br />
}
All the things I marked with ***'s are things I am not sure about.. or dont actually work
Another thing is ... I dont know how to export a Bitmap object or an jpeg File into an excelsheet ... ;(
Would be great if you could help me out
Big TIA
|
|
|
|
|
Hi
Is there a way how to check if a workstation is locked and/or logged of?
|
|
|
|
|
Hi, im new to C# and i need some help printing HTML files programmatically.
Currenly i have created a windows application (C#), that scans a specified directory. For the files it should print. I am able to print the HTML files currently to any printer that is specified (without prompting at all). I use the Windows API SetDefaultPrinter to set the printer to which IE Must print.
The program scans the HTML files for this information.
Currenly i am also able to set the Headers,Footers,Margins by editing the registry.
But i need some help with setting the PaperSize,Copies (Or i could just loop),Orientation
Please let me know thanx.
|
|
|
|
|
I've been working for days on a project that creates a BAND OBJECT(BHO)in IE. This BAND has a button which when pressed finds a text box in the current HTML page, fills it in, then finds a button and clicks it to submit the page changes.
So far, I've found a terrific C# template that allows you to create a Band Object in IE. http://www.codeproject.com/csharp/dotnetbandobjects.asp
I've commented this code extensively and have done some Regional grouping to make the code clearer. Let me know if you'd like to see it.
Anyways, so I'm down to the part where I'm trying to access the HTML page. From my research, I've found that AxShDocVw, SHDocVw, mshtml references are needed to work with the browswer. Honestly, that's all the solid information I know. How do I take advantage of these references to access the browser and it's DOM?
I'm really pressed for time, so I'd appreciate your help...A LOT!
Thanks,
Dustin Lyday
~D
|
|
|
|
|
Hi,
am sure this question or one very much like it has been asked already by someone else but I can't find the thread so sorry for asking it again.
I have a screen with 1 listbox and 1 datagrid. The listbox is populated (via a stored procedure) with users.
I have another stored procedure which displays user info depending on whether 1 user is selected or all users are selected. What I need is to be able to select various users and then display the info.
How do I loop through the listbox?
Sorry again for re-asking old questions, please point me in the direction of the old thread if thats easier.
Really basic code sample below, I know the loop code has to sit in the 'else' section somehow.
private void btnRefresh_Click(object sender, System.EventArgs e)
{
if(chkSelectAll.Checked == true)
{
AllScannerCount();
}
else
{
SelectedScannerCount();
}
}
Thanks in advance
Scotty
|
|
|
|
|
I wrote a program that would change edi to xml.
Anyway the problem is to be able run the program from a network drive.
I keep getting Security Exception errors, regardless of how much I tried to play with the Security class (FileIOPermission or PermissionSet ....)
My question is:
Is there a way to request for the permission without using the .NET configuration or caspol.exe?
Thank you so much.. please help if you can
Elapid For The Win
|
|
|
|