|
If you don't need one, then just don't declare it.
A simple SomeClass[i] = new SomeClass(); will be enough then.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hey, thx
|
|
|
|
|
when i build a window application using crystal report
the application run well on the perticular system where it is build but
if i use to run this application on another system in which there is only Dot Net Framework 1.1
its gives an error " KeycodeV2.dll "
plz give me solution
help me its urgent
Viren
Never Think That You Have Failed Instead Always Think That u hav Better Chance Next Time...
|
|
|
|
|
Is Crystal Reports installed on the other machine?
The KeyCode dll is used for the Crystal Reports licencing check. I usually create an MSI that uses the Crystal Reports merge modules and set the key-code property to the licence key. I then install this onto the destination machine along with my app.
How you install the runtime depends on if you are using the version of CR that comes with Visual Studio or a full version.
See here[^] or this pdf[^] or visit the Crystal website[^]
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
Hello,
I'm trying to read registry value using the API functions RegOpenKeyEx and RegQueryValueEx along with DllImport in C#(I'm aware of C# inbuilt registry access but I need to do it in this way). The results show that code runs fine but I'm not getting the desired data. Its returns 0 instead of the data. I'm including the code that I'm using
//*** declarations in the class *****
public static readonly UIntPtr HkeyLocalMachine = (UIntPtr)0x80000002;<br />
<br />
public const string lpSubKey = "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0";<br />
<br />
public const int KEY_QUERY_VALUE = 0x1;<br />
public const int REZ_SZ =0x00000002;<br />
<br />
[DllImport("advapi32.dll",EntryPoint="RegOpenKeyEx")]<br />
public static extern int RegOpenKeyEx_DllImport(UIntPtr hKey,string lpSubKey,uint ulOptions,int samDesired,out IntPtr phkResult);<br />
<br />
[DllImport("advapi32.dll",EntryPoint="RegQueryValueEx")]<br />
public static extern int RegQueryValueEx_DllImport(IntPtr hKey,string lpValueName,int lpReserved,out uint lpType, IntPtr lpData,out uint lpcbData);<br />
<br />
<br />
IntPtr hKeyVal;<br />
uint lpType;<br />
uint lpcbData;<br />
IntPtr q=new IntPtr();<br />
<br />
int valueRet=RegOpenKeyEx_DllImport(HkeyLocalMachine,lpSubKey,0,KEY_QUERY_VALUE,out hKeyVal);<br />
<br />
valueRet=RegQueryValueEx_DllImport(hKeyVal,"ProcessorNameString",0,out lpType, q,out lpcbData);
Output when viewd using different variables :
lpType= returns 1 which signify a string value
q returns 0 *** this should return data but does not
lpcbData returns 48 signifying size of the data being returned.
The return values of the functions show 0 which means success
Any help or insight on "Why I'm unable to get the data" would be highly appreciated.
Thanks
Rahul Sharma
|
|
|
|
|
Is there no one who can help me out with this code!!!!!!
|
|
|
|
|
use instead..
RegQueryValueEx( _
ByVal hKey As IntPtr, _
ByVal lpValueName As String, _
ByVal lpReserved As Integer, _
ByRef lpType As Integer, _
ByVal lpData As System.Text.StringBuilder, _
ByRef lpcbData As Integer) As Integer
in DLLImport change it to StringBuilder and then retrive value out of it...
code sample:
[DllImport("advapi32.dll", EntryPoint = "RegQueryValueEx")]
public static extern int RegQueryValueExA(int hKey, string lpValueName, int lpReserved, ref uint lpType, System.Text.StringBuilder lpData, ref uint lpcbData);
uint lpType= 0;
uint lpcbData = 1024;
string keyValue = null;
StringBuilder keyBuffer = new StringBuilder(1024);
RegQueryValueExA (hSubkey, "Description", 0, ref lpType, keyBuffer, ref lpcbData);
keyValue = keyBuffer.ToString();
|
|
|
|
|
Hi,
Is ThreadPool in .NET have work for window 2000 or above machine ?
And why there are no maximum threads setting in the ThreadPool class ?
Thanks
|
|
|
|
|
ThreadPool will work on any platform supported by .NET and that includes Win 2K. As to why there is no max setting in ThreadPool class, I don't know, but IIRC, it's set to 25 by default.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thanks for your reply.
But Win98 also support .NET if install the .NET runtime on it.
So will win98 support threadPool also ?
And what will happen for the machine if the maximum threads no setting
is reached or beyond ?
Thanks
|
|
|
|
|
Yes, it should run fine on Win98 also.
The threadpool limit is per process, not per machine. If your process reaches the max number of threads, further requests to the threadpool will block until atleast one thread is released from the pool.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi
I have made setup installation using Set and Delpyment I am using Visual Studio 2003.
Suppose i have opened the my Product and word and internet explorer when i press ALT + TAB , there shows the windows Picture in my product. I want to change that picture
How can i change my product picture when i press ALT + TAB .
Is there any properties when i make the installation .
This is my desktop application . I have made set up of desktop application.
When i press ALT + TAB I can see windows picture of my product I want to change that picture
is there any option to change the picture when i press ALT +TAB
Some has given some help---
If you press ALT+TAB the icon showing is your installation exe 's icon. So you should change setupiconfile while creating setup program. This facility is available in all major setup program creation applications like innosetup, Install Sheild etc. Check this facility is available in the deployment tool in visual studio. --- I tried to set exe file ' icon still i am getting the picture of Windows when i proess the ALT + TAB
pls Help me its very urgent
Thanks
|
|
|
|
|
Hi,
I am connecting my Winform with MySql 3.27 i c#
I am connected through MySql Connector 1.0.
In mY database of mysql Table has Datetime column
example --
values of datetime column comes in that way
2005-04-11 17:21:33
DateTime column has some corrupted format 0000-00-00 00:00:00 or 2005-00-00 00:00:00
when i store it in dataset it can store only correct format of datetime if it gets corrupted format
it throws exception
My client wants to bypass the corrupted datetime format.
how can i store correct and corrupted datetime format in dataset
Is there any way to set default value to the datetime feild of the dataset
pls provie me code for that
any clue
thanks
|
|
|
|
|
Hi,
I am connecting my Winform with MySql 3.27 i c#
I am connected through MySql Connector 1.0.
In mY database of mysql Table has Datetime column
example --
values of datetime column comes in that way
2005-04-11 17:21:33
When i retrive thr winform it displays 2005-04-11 17:21 this format
How can i get the complete Datetime format from MYSql
pls provide me complete code Its very Urgent
Any clue
Thanks
|
|
|
|
|
I need to create a button control which help me to apply a SQL query in a database shown in a datagrid.Anybody can tell me where can I find a tutorial about this?
|
|
|
|
|
Please first of all clear ur question
What do u want mean when u press the button it should perform query
|
|
|
|
|
I think he means databinding from a database. Yeah probably a query. If so i suggest you start first by creating a datagrid then hardcode your queries assuming you already did. Its really hard to answer vague questions...
Kampai!
|
|
|
|
|
When you set GridLines = true in the ViewList the grid lines don't match up with the column.
How do I fix this?
Thank you
|
|
|
|
|
Years ago I used to muck around with Basic and I used to draw things just using commands like "plot x,y " and whatever.
I'd like to do something similar in VS but I'm not sure how. I *think* I have to make a window that can be used to draw to, but I'm not sure how, and I also need to be able to write pixels or something to that effect as well.
All I need is a very basic platform so I can start, because I can work up from there, but until then, I don't have a clue, well, I think I need to use GDI+ but thats all I know.
July is perseverance month
|
|
|
|
|
I would start creating an empty Form and adding a Panel into it. The Panel will be the area your graphic will be drawn to. But the actual painting shouldn't be done directly to that panel - you should do it on a Bitmap object which you can than draw onto the Panel. This is known as double buffering and is handy because the windows are redrawn rather often (e.g. when minimized/maximized or just another window moving over it). This way you will not have to 'remind' every draw operation.
To fill the Bitmap with life you have to create a Graphics object of it. This object will than have all kinds of drawing functions. To set simple pixels you can even use the SetPixel function right on the Bitmap object.
I think its also a good idea to (instead adding just a plain Panel to your Form) inherit from Control or UserControl and encapsulate the needed drawing operations into a seperate class.
The basic startup code could look like the following (not tested):
public class MyPlot : Control {
private Bitmap _buffer;
public MyPlot() {
ClearBuffer();
}
private void ClearBuffer() {
_buffer = new Bitmap(base.Size);
this.Invalidate();
}
protected override OnResize(EventArgs ea) {
ClearBuffer();
}
protected override OnPaint(PaintEventArgs pea) {
if (_buffer != null)
pea.Graphics.DrawImageUnscaled(0, 0, _buffer);
}
public void DrawCommand(string[] commands) {
using (Graphics g = Graphics.FromImage(_buffer)) {
for (int i = 0; i < command.Length; i++) {
DrawCommand(commands[i], g);
}
}
}
private void DrawCommand(string commands, Graphics g) {
g.DrawLine(Pens.Black, 5, 5, 10, 10);
g.FillRectangle(Brushes.Red, 8, 17, 15, 20);
}
}
Add this Control onto a form and begin to send commands to it .
|
|
|
|
|
hi there. I have a project to make and i'm a litle confused. Between a Browser (like IE or Firefox) and the web server IIS i have to do something (application, Server, module ...) that recognizes a PDA and if so change HTML code or change the text inside it and then answer the request.
I need some kind of module or application that work with IIS and, if device is PDA, change the response to the browser.
The problem is that i have to change the text within the pages of all web sites...
I can configure web.config in ASP.NET on root of all web sites in IIS to recognize or filter PDA devices and i did a module with the help of a web service to change the web pages but this only works with pages that use aspnet_isapi.dll. The rest of the pages pass by this module.
This only works in WebService pages or WebApplication pages.
I need a "HTTP Runtime Support" of .NET with HttpHandler and HttpModule for all pages and not only for aspnet_isapi.dll.
ASP.NET
<httpmodules>
<add name="HelloWorldModule" type="WebServiceHTTPModule.HelloWorldModule, WebServiceHTTPModule">
The only way i think this is executable is by making a ISAPI filter for IIS but i need to program in c# for my project ...
.NET, C#.
Can you Help me !!! PLEASE
Sorry for my english.
Thank you for your time
Bruno Conde
countbruno@gmail.com
|
|
|
|
|
What is the best way to create thread safe generic dictionary. The only operations done by multiple threads are check if key exists, get value and add value.
I created a helper class that calls those methods internally, and uses lock inside the method. Is there a better way of doing it?
I know in non-generic versions you could do Hashtable.Synchronized, but generic dictionary doesn't offer this.
|
|
|
|
|
A "better" way of doing this would to use the ReadWriterLock, allowing multiple readers but single writers. And yeah, you'll need to implement all the methods yourself.
The problem with the built in .Synchronized versions of Hashtable and ArrayList is that naive developers assumed that you could create a synchronized version of the list, have one thread insert an item in the list, and have another thread iterate over it using foreach. BAD PRACTICE! Because using a foreach will iterate over the list without locking it (it can't lock it because it doesn't know when the consumer is done iterating over it). So the insert on another thread interrupts and foreach, causing an exception because the list can't be modified while iterating over the list with foreach.
In other words, you can't just assume a synchronized version of your list does takes care of all threading issues. The consumers of the list have to ensure proper synchronization.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuality in Christianity
Judah Himango
|
|
|
|
|
Thanks for suggesting ReaderWriterLock, I already looked into it before and it seemed what I wanted, but using lock was just easier.
I also knew about iteration problem, but I do not worry about that as I only need to insert and get data back.
|
|
|
|
|
Okay, I have had no luck and somehow I know this should be easy. I made an app that receives data and processes the info and does calculations, etc. But I can't get the data to write to anything on the form. I know how to use form button and such, but I want the app itself to write to a textbox, datagrid, whatever on the form. But I can't get it to work. Any help is greatly appreciated. I'm using Visual C# .Net. I can only get it to write to the console. HELP!
Thanks,
RABB17
|
|
|
|
|