|
Why would you want to? I'd store it in a file.
The Registry is evil!
|
|
|
|
|
One of the design goals of .NET is to avoid using Registry. What prevents you from storing you settings in a settings file ?
|
|
|
|
|
now what if i still want to use the Registry?!
|
|
|
|
|
Then you are going against the design goals of the language you are coding in. Up to you, but not recommended.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
This coding is in C++\CLI:
System::Drawing::Bitmap ^pBitmap;
System::IntPtr intPtr = pBitmap->GetHbitmap();
//How to convert this IntPtr to HBITMAP
//HBITMAP hbitMap = intPtr
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
vibindia wrote: This coding is in C++\CLI
So why are you asking in C# forum when there is a C++ forum here?
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Hi All,
I have developed a c# product,when i want to sale my product in cd's,how can i give licence key for my product.i dont have any basic idea about this process.please guide me for this,im really new to this windows app's.pls help me.
Thanks& Regards
Happy
Happy
|
|
|
|
|
You are new to Windows apps and you already have a product, really great.
|
|
|
|
|
Buy an application that protects yours. Such software can be found here[^], for example.
You could also pick up a book on programming, learn for a few weeks and try to build one yourself. The basic idea is to generate a number that's unique for the combination of a product/computer/user. If the registered key is different from your computed value, you're either dealing with an unregistered key, or a bug
I are Troll
|
|
|
|
|
Hi,
I'm creating a user control that displays a DataGridView control. I want to be able to programmatically select multiple cells/rows. So i made this function:
public bool SetSelectedValues(string ColumnName, List<object> CellValues)
{
bool FoundRows = false;
for (int ColumnIndex = 0; ColumnIndex < gridData.Columns.Count; ColumnIndex++)
{
if (gridData.Columns[0].Name == ColumnName)
{
gridData.ClearSelection();
for (int RowIndex = 0; RowIndex < gridData.Rows.Count; RowIndex++)
{
foreach (object CellValue in CellValues)
{
if (gridData.Rows[RowIndex].Cells[ColumnIndex].Value.ToString() == CellValue.ToString())
{
gridData.Rows[RowIndex].Cells[ColumnIndex].Selected = true;
gridData.CurrentCell = gridData.Rows[RowIndex].Cells[ColumnIndex];
FoundRows = true;
}
}
}
break;
}
}
return FoundRows;
}
It doesn't work, only the last cell gets selected, because i cannot select multiple cells in the CurrentCell. How can i solve this?
Regards,
Willem
|
|
|
|
|
I don't the code here setting MultiSelect as true. See if you have done that. Plus, not sure about CurrentCell thing. Why are you setting it in first place?
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Found the solution myself, the setting of selected cell's is only effective after the datasource is bound to the control. This is not done jet when you are in the Form_Load, so you have to wait for it. This is my solution:
private string Selection_ColumnName = null;
private List<object> Selection_CellValues = null;
public void SetSelectedValues(string ColumnName, List<object> CellValues)
{
Selection_ColumnName = ColumnName;
Selection_CellValues = CellValues;
gridData.DataBindingComplete += new DataGridViewBindingCompleteEventHandler(gridData_DataBindingComplete);
}
private void gridData_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
{
bool CellFound = false;
for (int ColumnIndex = 0; ColumnIndex < gridData.Columns.Count; ColumnIndex++)
{
if (gridData.Columns[0].Name == Selection_ColumnName)
{
gridData.ClearSelection();
for (int RowIndex = 0; RowIndex < gridData.Rows.Count; RowIndex++)
{
foreach (object CellValue in Selection_CellValues)
{
try
{
if (gridData.Rows[RowIndex].Cells[ColumnIndex].Value.ToString() == CellValue.ToString())
{
gridData.Rows[RowIndex].Cells[ColumnIndex].Selected = true;
if (!CellFound) gridData.CurrentCell = gridData.SelectedCells[0];
CellFound = true;
}
}
catch
{
}
}
}
break;
}
}
gridData.DataBindingComplete -= new DataGridViewBindingCompleteEventHandler(gridData_DataBindingComplete);
}
|
|
|
|
|
Hi,
I am trying to retrieve mails from a server like gmail. I have used TcpClient class to connect to the server.Connection is established successfully.During authentication using SslStream.AuthenticateAsClient() method to authenticate..I receive an exception saying..(HandShake Failed due to unexpected packet format)..
Can anyone help me with this..
Thank you.
|
|
|
|
|
Probably the connection on the server side is not SSL.
Or, you must first send some data (to identify you want to use SSL) to then call SslStream.Authenticate.
|
|
|
|
|
Hi again..
This is continuance from 2 Nov '09
Is there any another solution for win XP ?
I try this:
<br />
[DllImport("ntdll"), SuppressUnmanagedCodeSecurity]<br />
public static extern int NtGetCurrentProcessorNumber();<br />
and I get this exception:
System.EntryPointNotFoundException was unhandled
Message="Unable to find an entry point named 'NtGetCurrentProcessorNumber' in DLL 'ntdll'."
Source="XP_Multicore_try_0"
TypeName=""
StackTrace:
at XP_Multicore_try_0.Program.NtGetCurrentProcessorNumber()
at XP_Multicore_try_0.Program.loop() in C:\Documents and Settings\evyatarv\Desktop\XP_Multicore_try_0\XP_Multicore_try_0\Program.cs:line 24
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
|
|
|
|
|
ntdll.dll is a native code dll. You will not be able to access this dll from user code.
You have to write a native code service or driver to access it.
Greetings
Covean
|
|
|
|
|
Covean wrote: ntdll.dll is a native code dll. You will not be able to access this dll from user code
All of the Windows core is native code, and its API functions can be accessed perfectly using P/Invoke.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Once again you are right. I can invoke it. Just ignore my post.
Greetings
Covean
|
|
|
|
|
so..
Did I do something wrong ?
Why I get this exception ?
Thanks..
Evyatar
|
|
|
|
|
Can you please give me an example, I think I don't realy understand what
I'm needed to do to make it work.
Thanks..
Evyatar
|
|
|
|
|
That message is thrown when the method can't be found in the library. You might want to try to use the GetCurrentProcessorNumber method instead.
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
public static extern int GetCurrentProcessorNumber();
Hope this helps
I are Troll
|
|
|
|
|
Windows XP does not support this.
|
|
|
|
|
|
Building a windows service which needs to call a custom DLL. When I try to start the service it gives me an error stating it can't find the DLL. Which makes since since I was unable to register the DLL using Regsvr32. If I take out the DLL the service works fine (minus functionality of custom DLL). If I create a project with the same functionality as the service everything works fine once I add a reference to the DLL. Is there anything I can do to get the windows service to work with this custom DLL?
Only thing I have found is to add the DLL to the System32 direcotry which I have done.
|
|
|
|
|
What is the exact error message you are getting ?
|
|
|
|