|
I am a newbie in C#. I tried to build a COM+ application by creating an interface like this:
public interface ITest
{
int sum(int x, int y);
}
then I created a class which inherit from ServicedComponent and this interface.
After that I complied and deployed it by using regsvcs. Everything seemed to be fine, but when I checked my COM+ from COM Admin, I not only saw the inferface but also the class methods.
It doesn't seems right because normally, only the interface's method should be there.
What did I do wrong here?
Thanks,
Tommy.
|
|
|
|
|
i need before to show my application create some object that is i need to set
// declarations
...
// this panel is showed in the form
private System.Windows.Forms.Panel panel1;
// this is just a needed-in-memory panel
private Panel myobject = new Panel();
...
private void InitializeComponent(){
this.panel1 = new System.Windows.Forms.Panel();
}
// now i have
private Any_Inithialize_Function(){
myobject = panel1;
}
if i do it in Main, onLoad, onPaint funtion (as Any_Inithialize_Function) i get memory error becouse panel1 is not yet created.
|
|
|
|
|
Assigning it right after InitializeComponent (in the Form's constructor) should work fine.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
if you mean write that line inside InitializeComponent it is deleted when i run the debug.
So it doesn't work.
|
|
|
|
|
I think he meant you should put your call right after the call to InitializeComponent inside the constructor.
|
|
|
|
|
I tried using the toolbar of VS.NET. And found that, it does not show the alpha region of the icons perfectly. I have tried using maximum color depth in the imagelist that was associated with the toolbar, and also tried using PNG images.
Nither of my approaches succeded
Is there any way to show the icons perfectly ??
thanks in advance.
|
|
|
|
|
are your png real 32bit files?
Sometime (it is a visual studio bug) it doesn't work, you have to delete all these image from the imagelist and reload them all in the same time.
Other bug become if you use not good png images. That is you have to make much attention at antialising your image when you draw it in your graphic program, i advice you to don't use much antialising.
Make me to know.
|
|
|
|
|
I am using 32bit PNGs. and also tried reloading the images but that did not work
|
|
|
|
|
so try to redraw these images using not strong antialising
|
|
|
|
|
|
I have a dum guestion... how do i declare an array of clases, an array in wich every element is a class i tried
class SomeClass
{
public int x;
public int y;
};
SomeClass[] a=new SomeClass[5];
everything goes ok.
when i run the prorgam and i try smth like :
a[3]=4; the program throws an exception.. pls help me..
|
|
|
|
|
For each class in SomeClass[] you need to do a SomeClass[i] = new SomeClass(constructor)
Then you can access the values like: SomeClass[3].x = value;
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Ok.. pls show me how to make such a constructor.. thx
|
|
|
|
|
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
|
|
|
|