|
Can you give me some tips as what to look for? I haven't done c++ in about 5 years. I'm guessing I can't use any controls and I'd have to render all text in gdi or use images like rainlender.
|
|
|
|
|
Probably something to do with Layered and Transparent windows. Also, modifications to the windows EXSTYLE (Extended Style) attributes, like Alpha and ColorKey.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How do you spin a process off onto another thread and wait for it to complete? I'm looking for something like when you call ShowDialog and the process stops until the dialog has been closed.
|
|
|
|
|
|
Cool, thanks. I'll take a look at it.
|
|
|
|
|
If your question was how to kick off a seperate process (e.g. another application) from within you current program then the previous answer will be the key, however it looked from your question as if you wanted to kick off a seperate THREAD from within your program, in that case you would create a new thread, start it off and then call Join to wait for it to finish.
e.g
<br />
ThreadStart ts = new ThreadStart(StartExtrapolation);
Thread thThread = new Thread(ts);<br />
thThread.Start();<br />
thThread.Join();
<br />
<stuff><br />
|
|
|
|
|
Yeah, a separate thread yes. I've known how to start different threads and whatnot, just didn't ever know how to wait for one to finish without some kind of event. Thanks.
|
|
|
|
|
This is part of a class libary that I am creating for a web site. I've created a class for a HtmlGenericControl that I want to use on my pages. It creates a box object that I can format easily (via the use of built in methods) and use on my ASP.net web site.
I've created the class, and it all compiles correctly, I can set it's properties and access it's methods, but when I create an instance of the class and try to add the control to the page I get a "null object" error.
Here's my code for the object:
public class ContentBox : HtmlGenericControl<br />
{<br />
HtmlGenericControl BoxTop;<br />
HtmlGenericControl BoxHeader;<br />
HtmlGenericControl BoxBottom;<br />
<br />
<br />
public string BoxHeaderText;<br />
<br />
public HtmlGenericControl BoxContent;<br />
<br />
<br />
string BoxStyle;<br />
public void SetToContentWide() { BoxStyle = "box-wide"; }<br />
public void SetToContentLeft() { BoxStyle = "box-left"; }<br />
public void SetToContentRight() { BoxStyle = "box-right"; }<br />
public void SetToContentRightSidebar() { BoxStyle = "box"; }<br />
<br />
<br />
string BoxHeaderStyle;<br />
public void SetHeaderImportant() { BoxHeaderStyle = "header"; }<br />
public void SetHeaderNotImportant() { BoxHeaderStyle = "top"; }<br />
<br />
<br />
public ContentBox()<br />
{<br />
BoxStyle = "box-wide";<br />
BoxHeaderStyle = "header";<br />
BoxHeaderText = "";<br />
<br />
this.TagName = "div";<br />
this.Attributes["class"] = BoxStyle;<br />
<br />
BoxTop = new HtmlGenericControl("div");<br />
BoxTop.Attributes["class"] = BoxHeaderStyle;<br />
this.Controls.Add(BoxTop);<br />
<br />
BoxHeader = new HtmlGenericControl("h2");<br />
BoxHeader.InnerText = BoxHeaderText;<br />
BoxTop.Controls.Add(BoxHeader);<br />
<br />
BoxBottom = new HtmlGenericControl("div");<br />
BoxContent = new HtmlGenericControl("div");<br />
this.Controls.Add(BoxBottom);<br />
}
When I add the box to the page I simply use:
ContentBox _thebox = new ContentBox();
I can create an instance of the class, I can access it's methods, I can set it's properties, but when I try and use it on the page I get a null object error.
I think that the problem is that although when I create an instance of the class "ContentBox" it isn't being created as a new HtmlControl, but rather a null object.
Can anybody tell me how I get the object itself to become a new HtmlGenericControl when I create an instance of it?
Thanks
|
|
|
|
|
Ok just so I can clarify this.
When I defined the class, I defined it as a an extension of the "HtmlGenericControl" class (as you can see in my above code). I want it to behave like a HtmlGenericControl, I want to manipulate it like a HtmlGenericControl, I basically want it to be a regular HtmlGenericControl.
Since "ContentBox" inherits from the "HtmlGenericControl" class I assume that I am just missing some code that will make the system initialise it as a regular "HtmlGenericControl" (eg. "InitializeComponent()" ).
That's the info that I'm after, how do I tell ASP.net to initialise instances of the class "ContentBox" as a "HtmlGenericControl", so that I can treat it as a HtmlGenericControl in my application?
Thanks
|
|
|
|
|
VS 2005 C# Class Wizard - it is gone? Should I be able to use the class wizard or is it no longer an option?
|
|
|
|
|
I think they removed it in the Express editions to be honest
|
|
|
|
|
Is there an SQLDMO like product for Oracle? I want to be able to manage tables and views from C# code.
Thanks.
|
|
|
|
|
Hi.
I'm trying to hook on to an event which my remote object provides. client and server share the same common library where the event and delegate is defined in an interface.
Anyway, the remoting works, but when I try to use delegates (+=), I get the following message:
"Type System.DelegateSerializationHolder and the types derived from it (such as System.DelegateSerializationHolder) are not permitted to be deserialized at this security level."
I've been searching a lot and see that in 1.1 this could be fixed by setting the 'typeFilterLevel=Full'. However, I can not figure out to set this in .net 2.0 as the 'RegisterChannel' method has changed
|
|
|
|
|
Hi all,
I am very new to DirectoryServices. I created an ActiveDirectory user by using DirectoryServices. I can find that added entry later-on aswell. But I still couldnt figure out that how can I delete an added user later.
I tried
DirectoryEntries.remove("username", DirectoryEntry.SchemalClassName);
as mentioned on MSDN, but its keep on givng me an error like:
Invalid DN name assigned
Can anybody help me?
Thanks in Advance!!!!
|
|
|
|
|
Hi,
I have a form and I don't want it to get focus. Is there a possibility with .net (like setting the focus to a certain window) or do I have to use the win32 api? I'm using visual c# 2005 express edition, so I could make use of .net 2.0.
Thanks
|
|
|
|
|
my tabcontrol's selectedindexchanged event handler runs some code and if an exception is thrown, i set my selectedindex to 0 (the first tab page). but only the tab changes, not the page. the page remains on what was originally changed to. what is going on? i also tried .selectedtab = tpStart; and .selecttab(0); which produces the same weird effect.
|
|
|
|
|
Hmmm not sure why this failing for you - I created a very simple little application and within the SelectedIndexChanged event handler I created an exception and then reset the Tab index to zero and it worked ok.
I have had a look at the System.Windows.Forms.Tabcontrol DLL using Reflector and it seems that the Windows message for SelectedIndexChangING is handled and not passed on so you could override the WndProc for a derived Tab control and handle the code which could potentially cause an exception by trapping the SelectedIndexChanging message and only pass it on to the base Wndproc if no exception was thrown.
Alternatively stick up some code and lets see if there is anything obviously wrong with the code.
Mark.
|
|
|
|
|
the tab it self switches fine. stick some controls in each tab page and you'll see the tab resets to index 0 but not the page. the code i had was simply a tab control, a button, and a label in each tab page. the button click event does "tabControl1.SelectedIndex++;" and the tabcontrol's selectedindexchanged event does "tabControl1.SelectedIndex = 0;" clicking the button or the second tab switches to the first tab as expected and as function but the tab page panel is still at tab page 2. this same code worked fine and also switched the tab page in visual studio 2003, but now in 2005 it does not. however, i found a workaround. visual studio 2005 has a Selecting event for tabcontrol and responds appropriately when setting SelectedIndex to zero. not to mention i can conditionally cancel a tab change .
|
|
|
|
|
Hi,
I'm working on aproximate string matching detecting trademark similarity. I use NGrams, Lev, Editex and
Longest Common Substring algorithm. Recently I find a set of records from another system based on trademark
watching too. The set of records looks like:
(ASELTIN,SLTN,AEI,AEILNST,AS,IN)
(AMBERLITE,MBRLT,AEIE,ABEILMRT,AM,TE)
(ABBEI,B,AEI,ABEI,AB,EI)
where first field is the real trademark name, third field vowels letters, second non vowels, fifth field
are first two letters of trademark and sixth two ending letters.
The fourth field I think is all letters (no repetition) sorted in ascending order.
How can I use this scheme for detecting similiarity??
One way could be take word A and B and use vowels and non-vowels letter with Levenshtaein algorithm.
Like this:
float sim(string wordA, string wordB)<br />
{<br />
<br />
string AVowels = extractVowelsFrom(wordA);<br />
string BVowels = extractVowelsFrom(wordB);<br />
int distance = Levenshtein.distance(AVowels,BVowels);<br />
<br />
...<br />
...<br />
<br />
...<br />
...<br />
return metric;<br />
}
this is fine im working on it, but,
How can I use the fourth field (all letters no repetition sorted in ascending order) for detect similarity??
Any idea???
Thanks in advance
Elvio Fernandez
|
|
|
|
|
I think there are some ways you can use this information for detecting similiarity.
There are some factors, if there are enough fullfilled, you accept this as a string matching:
- beginning of the word / ending of the word
- are all vowels in the word
- are all nonvowels in the word
- order of vowels correct / order of nonvowels
- length of the word (+- 1)
- are all letters matching
These are 8 possibilities. If you check the word, you want enough to be right. For example:
(AMBERLITE,MBRLT,AEIE,ABEILMRT,AM,TE)
AMBRELITE is ok. All 8 factors are ok. So you suggest the word is Amberlite. If someone writes Amberlit the beginning is ok, are all nonvowels are in there the vowels are in correct order (even one is missing), the nonvoewls are in correct order, the length of the word is nearly the same and alle th letters are matching ABEILMRT. You would suggest this is the word Amberlite.
The question is how to weight this factors and how many must be fullfilled (weighted). I don't work on string matching, but without any further background I would weight is like:
3 points for (beginning of the word / ending of the word) if one is missing two points for the other.
5 points for (are all vowels in the word / are all nonvowels in the word) if one is missing 3 points for the other
5 points for (order of vowels correct / order of nonvowels) if one is missing 3 points for the other. If a letter is missing than the fact is still fullfiled
3 point for (length of the word) substract 1 point for each extra or missing
1 point for all the letters are matching
This would be 17 points. Perhaps you must accept when there are 12 points (but this have to be testes out).
Greetings,
Ingo
|
|
|
|
|
Hey Ingo,
Thanks for your time. I will test it!!
Elvio Fernandez
|
|
|
|
|
|
here is my code
CRAXDRT.Application crxApp = new CRAXDRT.Application();
CRAXDRT.Report crxRpt = new CRAXDRT.Report();
crxRpt = crxApp.OpenReport(@Application.StartupPath+"\\Report_1.RPT",null);
string myExportFile = Application.StartupPath+"\\Report.txt";
crxRpt.ExportOptions.DiskFileName = myExportFile;
crxRpt.ExportOptions.FormatType = CRAXDRT.CRExportFormatType.crEFTText;
crxRpt.ExportOptions.DestinationType = CRAXDRT.CRExportDestinationType.crEDTDiskFile;
crxRpt.ExportOptions.RTFExportAllPages = true;
crxRpt.Export(false);
after i export, i want to close the crxRPT and crxApp object.
because i want to copy the latest database from the server to the my PC but i can't because these object are still connected to the database
i try this but didn't work.
crxRpt = null;
crxApp = null;
|
|
|
|
|
Can anyone give me any guidance on how to store details from a windows form, entered via user input, into an XML file and then display those details to a DataGrid in the form of a table?
Also, how do I populate a drop down menu with a list from an XML file?
Steve G
|
|
|
|
|
Btw, the code below was typed directly into this textbox.. it is prone to have syntax/compilation errors!
<br />
XmlDocument xd = new XmlDocument();<br />
xd.Load("c:\\myxml.xml");<br />
foreach (XmlNode xn in xd.SelectNodes("/Root/Item"))<br />
{<br />
myForm.myCombo1.Items.Add(xn.SelectSingleNode("@ItemNumber").InnerText);<br />
}<br />
To store user values in Xml document you may use XmlTextWriter
XmlTextWriter xtw = new XmlTextWriter("c:\\output.xml");<br />
xtw.WriteStartDocument();<br />
xtw.WriteStartElement("MyRoot");<br />
xtw.WriteAttributeString("UserName", myForm.textBox1.text);<br />
xtw.WriteEndElement();<br />
xtw.WriteEndDocument();<br />
xtw.Close();
- Malhar
|
|
|
|