|
would be helpfull if we could see your whole configfile
|
|
|
|
|
Hi All,
I have problem passing pointers from unmanaged to managed through IDispatch::Invoke. The 'Invoke' returns E_NOINTERFACE. It works fine with passing values though. Any idea?
Thanks in advance.
|
|
|
|
|
|
I has a problem with function MessageBox.Show().
When I call MessageBox.Show() ex: MessageBox.Show("Hello World","Error"), I can't see my message "Hello World" althought I see MessageBox windows.
Some one to help me?
Sorry about my English.:->
Thanks.
|
|
|
|
|
your call seems to be ok.
perhaps you should try the other variants of MessageBox.Show(...);
MessageBox.Show("test");
MessageBox.Show(this,"test","ddddd"); //assuming this is a form or something similar
and the variants where you can define the buttons and icon ...
I can't imagine why the box should not display your text.
I have NEVER seen a MessageBox failing. It is one of the basic tools used by GUI Builders and therefore very stable.
Is the code you used really
--
MessageBox.Show("Hello World","Error");
--
or did you use a variable for the string, in this case I would blame the variable.
Good Luck
|
|
|
|
|
I had similar problem with function MessageBox in my brother's Computer.
I just call funtion MessageBox.Show()
ex: MessageBox.Show("Hello World","Error")
the box has "title" = "Error" and a button.text = "".
I don't know what's wrong.
|
|
|
|
|
How can I programatically do simple FTP operations using .Net framework 1.1?
|
|
|
|
|
Everything you need is in the System.Net and System.Net.Sockets areas of the framework. Do a search on Google for c# (or vb.net) FTP. There are plenty of samples that show a simple asycn FTP client.
|
|
|
|
|
hi all
I have a interesting problem with one of my gui's in the Forms Designer in VS2003.
When I open the form in design view my studio crashes with a Stack Overflow Exception.
When I analyze the crashed process I can see that it is executing one of the constructors of my data and comunication model classes.
Call Stack shows that these were created because the constructor of my Form registers some methods to events in the model.
The crash could be related to the fact that the model is unmanaged code provided by wrapper clases.
The crash is 100% reproduceable.
(uneccessary to say, under normal runtime conditions the same code works fine)
One solution would be to prevent this snip of code (the data and communication classes) to be executed in design time.
I don't believe it is neccessary to create an instance of them.
How can I detect that my code is executed in the designer oposed to normal execution.
I found some hints about providing custom designers and thereby changing the behavior, but issent there simply somewhere a boolean I can read, saying designtime/normal?
|
|
|
|
|
How can I detect that my code is executed in the designer oposed to normal execution?
You can use the components DesignMode property (MSDN link[^])
public MyForm()<br />
{<br />
...<br />
<br />
if (!this.DesignMode)<br />
{<br />
...<br />
}<br />
}
"I think I speak on behalf of everyone here when I say huh?" - Buffy
|
|
|
|
|
seams to be what I was searching for,
could not invertigate whether this solves my problem, because I have implemented a workaround.
Will test it on monday.
Thx
|
|
|
|
|
All,
I converting a bmp to png using the System.Drawing.Image.Save function by passing the format PNG. Now the problem is .NET framework seems to be using zlib compression level 6 by default. If I use a command line program like pngcrush at compression level 9 I get smaller png files.
Now, is there a way to make .NET framework api produce smaller size png files?
thanks,
--serkan
|
|
|
|
|
Does anyone know of a way to detect what shortcut key was used to invoke a .Net Macro?
I'm trying to take different actions based on CTRL-key vs CTRL-SHIFT-key.
Thanks,
Jim
|
|
|
|
|
Hi all
I am in college , and we are not spending a lot of time on the framework
We are mostly staying on the basics of coding, structures, etc.
I wanted to pick up a solid book on the framework, 1.1 or higher
Any suggestions
Thanks
Paul
|
|
|
|
|
"Applied Microsoft .NET Framework programming" by Jeffrey Richter is a very good book that deepely covers both the framework and the CLR from a general point of view (strings, events, assemblies, GAC, Garbage collector, ..), it uses C# and IL to show some code snippet, there's nothing about windows forms, XML, ADO.NET and so on.
paco
|
|
|
|
|
Hi,
I am trying to list out the domains on the server using System.DirectoryServices. It gives domains, but list contains only one domain name. Our server has more that 3 domains and subdomains.
The code which i am using is as follows:
<br />
private StringCollection GetDomainList() <br />
{ <br />
StringCollection domainList = new StringCollection(); <br />
try <br />
{ <br />
DirectoryEntry en = new DirectoryEntry("WinNT://"); <br />
DirectorySearcher srch = new DirectorySearcher("objectCategory=Domain"); <br />
SearchResultCollection coll = srch.FindAll(); <br />
foreach (SearchResult rs in coll) <br />
{ <br />
ResultPropertyCollection resultPropColl = rs.Properties; <br />
foreach( object domainName in resultPropColl["name"]) <br />
{ <br />
domainList.Add(domainName.ToString()); <br />
} <br />
} <br />
} <br />
catch (Exception ex) <br />
{ <br />
Trace.Write(ex.Message); <br />
} <br />
return domainList; <br />
} <br />
Is it the correct way to list the domains? It is giving only the domain name in which i am a user and i log in with this user. This domain has subdomains and also along with this other domains are also there.
Can you please help out?
Thanx
Iftach
|
|
|
|
|
Imagine the following scenario:
A shared member variable "TheResult " is null .
A worker thread sets this variable with the result of its computation (and terminates).
Another frequently running thread checks for this variable beeing null or not. If it is not null , it assumes the worker thread has assigned a valid object to it and uses it.
Do I need to monitor the access to that variable, i.e. use lock in C#? Or in ohter words, can the assignment "TheResult = TempResult " be preempted, so that "TheResult" is neither null nor a valid object reference? Is the assignment of an object an atomic instruction that cannot be interrupted?
Thank for any hints.
|
|
|
|
|
Assigning a reference is atomic, AFAIK. But I think you need to declare "TheResult" volatile, as you are modifying its value from a different thread while frequently checking it for null value. If it is not volatile, there is a chance that checking thread reads null even *after* the worker thread sets it to the correct value.
Regards
Senthil
My Blog
|
|
|
|
|
Thanks Senthil,
I would have missed "volatile " without your hint (although missing the result wouldn't have been a big problem in my context). I probably will have to use Interlocked.Exchange , just to be sure it is atomic, because I don't find a guarantee.
Gerhard
|
|
|
|
|
If moving a 32 bit value is atomic, then setting a reference is. I think it should be atomic in x86 processors, as it can written as a single
mov ax, val
assembly instruction. And processor instructions are atomic, AFAIK.
Regards
Senthil
My Blog
|
|
|
|
|
In Windows Forms the ListBox class has a GetItemText method, but lacks a GetItemValue method. How to retrieve the associated value of any specified item? There is a SelectedValue property. That does not work for me because I need to get the value for any item without changing the selection of the listbox.
Actually I was using the checkedListBox class. At a certain point in the program I want to get the associated values for the items the user put a check mark on.
Thanks for your help
|
|
|
|
|
Hi everybody,
When I put a DataGrid control at the MDI parent window(VS.NET), I can use form.show() to display the Child window (after I call the show function, there is nothing at the MDI client area).
Does anybody know how to solve the problem. I really want to keep the datagrid control at the parent window, and meanwhile let the Child window show out.
Please help me!!!
Thank for any help in advance!
Alan Shen
Alan Shen
MCAD for .NET Version
^~^~^~^~^~^~^~^~^~^~^
Great idea is the beginging of success!
|
|
|
|
|
i am unable to remove assemblies from GAC even after Uninstallation and when i try to installer newer version of dll ,it doesnt reflect changes
how could i resolve this?
-adnan
|
|
|
|
|
Hello,
this might be a stupid question, but i haven't found an answer on either this forum or the MS knowledge base, so here is my problem:
On a PocketPC 2003 and using the Compact Framework, I want to create a copy from an image (an embedded resource 24bpp png), modify that copy and use it in subsequent redraws of a control (a class deriving from Forms.Control and overriding OnPaint ).
For this I use the copy-contructor of the Bitmap class (dstImage is a member of the control):
dstImg = new Bitmap(srcImage);
This seems to be a valid copy of the source image, dstImage.GetPixel returns color values identical to srcImage.GetPixel throughout, and the Width and Height properties show the expected image size. However, when I render that image to the control with
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.DrawImage(dstImg, 0, 0);
e.Graphics.DrawImage(srcImage, dstImage.Width + 1, 0);
}
then the image is only about a quarter in size of what it should be. It is not truncated (and small enough to fit in the control entirely), but scaled down. Using srcImage in the above code does not exhibit this unwanted scaling. Please note that there is code ensuring that dstImage is only attempted to be drawn when its production is finished (omitted for brevity).
I've also tried to use different means of contructing dstImg , like
dstImg = new Bitmap(srcImage.Width, srcImage.Height, PixelFormat.Format24bppRgb);
Graphics g = Graphics.FromImage(dstImg);
Rectangle r = new Rectangle(0, 0, srcImage.Width, srcImage.Height);
g.DrawImage(srcImage, r, r, GraphicsUnit.Pixel);
g.Dispose();
A final note: this problem is specific to the compact framework. If I paste the above snippets in a 'full' framework app and run it, both original and copy show correctly. I suspect this behaviour might result from some mismatch of the DPI settings, however you can't seem to access these members (HorizontalResolution and VerticalResolution ) in the CF? What am I missing/doing wrong?
Any help and subtle pointers to possible stupidity on my part would be appreciated,
Georg
|
|
|
|
|
I hear about we can run .Net on Win98 but I just worry about the performance.
And Howabout Run .Net on Win95?
Because I have a hundred of client PCs (Pentium100, Ram32) and I love .NET, I don't want to build vb6 application for this new project.
wait for suggestion...
Thank you.
Regards,
------------------------------
Mr.Wigrom Sakonlapahb
.NET Application Developer
------------------------------
|
|
|
|