|
Hi There!
I noticed two problems with .NET System.Windows.Forms.RichTextBox object:
1. While firing ContextMenu.Popup event from a RichTextBox object, the ContextMenu.SourceControl is always null.
2. If I want to set a menuItem Enabled or not (e.g.: Cut, Copy, Reverse, etc.) according to whether there is selected text in a RichTextBox object (I test SelectionLength > 0 or Selected{Text||Rtf}.Length > 0 during Application.Idle event and then update the command and menuItem state), I get a problem with DBCS input: the Chinese IME doesn't work anymore, the Korean IME works letter by letter instead of composing hangul characters, and the Japanese IME works randomly. As soon as I take off the test of those Selection related properties, I can do DBCS input perfectly within RichTextBox objects.
Does anybody have a clue why there are those problems and how to work around?
Thanks in advance!
Jian Yang
|
|
|
|
|
Hey Guys
I have an HTMLDocument and i want to be able to get an image on the website and display it in a listview. I can get the HTMLImage class loaded with the image element but can't seem to get the actuall image so i can display it. I have tried laoding it into a Image class but it says it won't load from a URL. Does anyone know how i would go about doing this?
Cheers
Pete
|
|
|
|
|
Can't you simply download the image, save it locally and display it in the list view? The src attribute of the img tag holds the URL of the image, so you can simply download it using HttpRequest and then give the downloaded file path to the listview.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
From the information that I have gathered it appears that XP has a limit in the resolution of timers (10-15 ms). So even though each timer can take a resoltion of 1 ms this cannot be achived in practice due to the OS limitation.
I believe that ExSetTimerResolution can be used to change this. Has anyone tried to achive this in .NET? How did you do it? Did it improve timer resolution?
Thanks,
Liam
|
|
|
|
|
You can't improve the resolution of the timers beyond 10-15ms. It's just plain impossible.
If you want sub-10ms resolution, you have to use the high performance counter built into the NT kernel, using QueryPerformanceCounter API function. There are examples of this in the CP articles, like this[^] one.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I run .net on P4 2.8 GHz and 1 GB of RAM and XP profesional machine. although i have good configuration it sucks while debugging my .net application. it takes lot of time to step into the code. due to this my production has come down. Its very difficult go step by step into the code. Could you please any one suggest me, is any patch i need to apply to fast my debugging. or do i need to do any setting. Kindly let me know.
Thanks in advance!
Umesh
|
|
|
|
|
Yeah i have the same problem. I think the problem got worse when my project became bigger and bigger. But still, it isn't nice, and it is really slowing me down aswell.
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
One thing you could try is splitting your project into parts and building the ones you're sure are working right in release mode. I've never done it in .net so I can't be more specific about how. IF you're trying to debug the processor intensive portion though you're more or less stuck unfortunately.
|
|
|
|
|
That sounds like a good idea, but i've got a lot of internal classes and stuff. If i split it up, i've got to make a lot public or re-do many things all over again. (Bad design , i know )
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
Is there any chance you turned on native debugging also? I've seen that slow down debugging to a crawl.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hello,
this might not be your problem at all:
I noticed slow debugging whenever a specific software firewall was running in the background on my system. Seems like component control of the firewall wanted to block some data exchange between Visual Studio and the app process. This slowed down debugging significantly and no firewall setting helped.
I solved this problem by going back to an older firewall version.
FTrader
|
|
|
|
|
How do I generate a GUID for a file and also include the GUID in the same file?
|
|
|
|
|
'The new guid
Dim g As Guid = Guid.NewGuid()
'For writing to a textfile
Dim textw As IO.StreamWriter = IO.File.CreateText("C:\SomeFile.txt")
textw.WriteLine(g.ToString)
textw.Close()
'For writing to a binary file
Dim binw As IO.FileStream = IO.File.Create("C:\SomeFile.dat")
binw.Write(g.ToByteArray(), 0, 16)
binw.Close()
Something like that.
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
I execute the following command, but want to see if it successfully created the xml file:
cmd = "bcp ""select * from dbName..tableName where StudyNo = " & SN & """ queryout c:\tResultQue.xml -c -S servername -U uname -P pwd"
Shell(cmd)
I tried the following, but it won't work as it executes before the file is created:
If File.Exists("c:\tResultQue.xml") Then
'success
Else
'failed
End If
Thank you for any help!
|
|
|
|
|
Rather than using Shell, you should create a Process object to run the command. The Process class allows you to wait for a return code that signals the execution has terminated.
|
|
|
|
|
|
Good afternoon
XmlTextReader behaves very strange: I have the following
encoding-definition in my (valid) XML-File:
encoding="ISO-8859-1"
If I open the File:
fileStream = new StreamReader (xmlFile);<br />
xmlReader = new XmlTextReader(fileStream);
an read some values, I can see that the Encoding is set
to "UTF-16" and I don't get all data: XmlTextReader
absorbs non UTF-16 characters.
If I explicit define the Stream-Encoding to:
fileStream = new StreamReader(xmlFile, <br />
Encoding.GetEncoding("ISO-8859-1"));
then XmlTextReader works perfect.
Is it wrong to except that XmlTextReader relates it's encoding
to the XML-Definition and not to the stream encoding?
Or: Do I really have to open the xml-file to check the
encoding-property and then to open the xml-file
again using the right stream - encoding?
Thanks a lot for any hint in advance,
kind regards,
thomas
People who wait until the eleventh hour to call on Jesus die at 10:30.
|
|
|
|
|
Hi,
I have a form containing just a Microsoft WebBrowser Object. Im using it to view Excel files in my app (workaround for no OLE support). Only problem is, the controls take a long time to load, so I'm trying to get them to initialize in another thread when the app begins. There are two stages to the init of one such form: the constructor, where the activex control is inited, and the View() command, which causes the control to navigate to the specified file.
I've found that if I call View() straight after calling the constructor, the control freezes and Excel shows an "Out of memory" error box. However, if I move the View() call to when a user presses a button, for example, it works perfectly. It's somewhat strange, and i cant find any events that tell me when the control is finished initing. Can anyone help me please?
Thanks in advance
Mankeyrabbit
|
|
|
|
|
Hi,
I have created an dll Using .NET framework 2 (Beta 2) with CLR option off
(as my underlying implementation is C++).
1. Now when I am trying to deploy this on a machine which has just .NET framework 2 redistributable on it. I get error while registering this dll there.
I have kept Manifest generation and embed manifest options ON.
2. When I switch them (Manifest) OFF : It works fine, gets registered on that machine.
But on system with .NET framework 2 intalled and having XP, it fails to register...
Any suggestion why this must be happening..
thanks & regards
ajay
|
|
|
|
|
i have confusion that About CLR Memory Allocation / De-Allocation:
That if an managed class written in VC++.Net:
For e.g:
__gc class Client1
{
public:
Client1()
{
}
~Client1()
{
}
static double Square (double value )
{
value = value * value;
Console::WriteLine("Client1 Returning {0}",__box(value));
return value;
}
};
and i try to allocate it's instance as:
(1): Client1 * cl1 = new Client1();
and do not explictly delete it , then is it posssible that this instance will automatically be deleted by <CLR> of .Net?
-----------------------------------------------------------------------------
(2): An other confusion i have is that if i allocate an array of
<Client1> type objects such as:
Client1 * cl[] = new Client1 * [3];
will this instance will automatically be deleted by CLR or it also have to
explicitly destroyed using syntax < delete []cl; >
-----------------------------------------------------------------------------
(3): I create an delegate in VC++.Net
__delegate double Square(double);
use it in <_tmain> as:
Square * sq1 = new Square(0,&Client1::Square);
sq1->Invoke(3);
will the instance of this <sq1> delegate type object will be
deleted automatically by CLR or not?
|
|
|
|
|
in Managed code GC control all of these de-allocations automatically
,actually GC check them periodically and collect everyone of them that
ain't used.
.Net Developer
|
|
|
|
|
Hi everybody I hope somebody can find a suggestion for this problem
I wrote store proc that work correctly in QueryAnalyzer but when I
call it from my project it make error "system error"
look at it:
CREATE PROCEDURE spSer_contact
@contactGroupID uniqueidentifier,
@countryID uniqueidentifier,
@contactName varchar(100),
@city varchar(50),
@phoneNumber varchar(100)
AS
declare @SqlString varchar(2000)
set @SqlString = 'SELECT contact.contactName,
contactgroup.contactGroupName,
country.countryName, contact.city,
contact.street, contact.zipCode,
contact.phoneNumber, contact.faxNumber,
contact.telex, contact.email,
contact.webSite, contact.comments,
contact.attachment,contact.contactID,
contact.contactGroupID, contact.countryID
FROM contact INNER JOIN contactgroup
ON contact.contactGroupID = contactgroup.contactGroupID
INNER JOIN country
ON contact.countryID = country.countryID
WHERE'
if (len(cast(@contactGroupID as varchar(38))) != 0)
set @SqlString=@SqlString+' contact.contactGroupID='''+cast (@contactGroupID as varchar(38))+''''
if (len(cast(@countryID as varchar(38))) != 0)
if (SubString(@SqlString, len(@SqlString) - 4, 5) = 'where')
set @SqlString = @SqlString + ' contact.countryID = '''+cast(@countryID as varchar(38))+''''
else
set @SqlString = @SqlString + ' and contact.countryID = '''+cast(@countryID as varchar(38))+''''
if (len(@contactName) != 0)
if (SubString(@SqlString, len(@SqlString) - 4, 5) = 'where')
set @SqlString=@SqlString+' dbo.contact.contactName='''+ @contactName+''''
else
set @SqlString=@SqlString+' and dbo.contact.countryID= '''+ @contactName+''''
if (len(@city) != 0)
if (SubString(@SqlString, len(@SqlString) - 4, 5) = 'where')
set @SqlString = @SqlString + ' dbo.contact.city = '''+@city+''''
else
set @SqlString = @SqlString + ' and dbo.contact.city = '''+@city+''''
if (len(@phoneNumber) != 0)
if (SubString(@SqlString, len(@SqlString) - 4, 5) = 'where')
set @SqlString=@SqlString+' dbo.contact.phoneNumber= '''+ @phoneNumber+''''
else
set @SqlString=@SqlString+' and dbo.contact.phoneNumber= '''+ @phoneNumber+''''
exec (@SqlString)
GO
====================
//sample code for retriving data by store proc
SqlConnection cn = new SqlConnection(connectionString);
SqlCommand cm = new SqlCommand("[spSer_contact]",cn);
cm.CommandType = CommandType.StoredProcedure;
SqlParameter pm = new SqlParameter("@contactGroupID",SqlDbType.UniqueIdentifier,16,"contactGroupID");
pm.Value = listBox1.SelectedValue;
cm.Parameters.Add(pm);
SqlDataAdapter da = new SqlDataAdapter(cm);
DataSet ds = new DataSet();
da.Fill(ds,"contact");//this have problem error message is (system error)
dataGrid1.DataSource = ds.Tables["contact"];
if somebody find a solution for this problem please send it
thanx
|
|
|
|
|
how can i export .Net Native data types such as for e.g [string]
to a calling C# program ?
|
|
|
|
|
4 of the (essentially) same questions all in a row...was it really necessary?
|
|
|
|
|
how can i export .Net Native data types such as for e.g <string>
to a calling C# program ?
|
|
|
|