|
Hi All,
I wondered if anyone could make sense of this undocumented object (System.Runtime.Remoting.Proxies.__TransparentProxy) being returned from the static method call to System.Appdomain.CreateDomain(...).
Normally (in my simple single-assembly testing application), System.Appdomain.CreateDomain(...) returns the documented System.Appdomain that is expected.
When I stitch the code into my multi-project solution, however, the call returns a __TransparentProxy object that raises exception further on in code when I call a member on it (of what is supposed to be the System.Appdomain object). The exception demands that all sorts of classes (and their members!) be marked as serializable. I'm not interested in doing that for various reasons.
Any help is greatly appreciated.
Rein
|
|
|
|
|
Is it possible that the code that creates the AppDomain itself is running in an AppDomain different from the code calling it? Usually, you'll get Transparent Proxies and serialization problems only when you cross AppDomain boundaries.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi Senthil,
Thanks for responding, I'm at my wits end and appreciate a helping hand.
Yes it is very possible that I may be calling AppDomain in another domain (somehow). My solution is a multiproject solution and the startup project is not the same project that is calling System.AppDomain.CreateDomain(...).
I have tried (for testing purposes) to call System.AppDomain.CreateDomain(...) from the startup project (in the constructor of the startup form - right at the beginning) just to see if that was the problem but it still returned a __TransparentProxy and I was, consequently, stymied.
I could be mistaken, but I understood that with all the references to various projects load the modules into the root AppDomain. I may be completely wrong on that.
I'm not sure what to do next and am grateful for any suggestions - even a shot in the dark might prompt to think laterally about this problem.
Thanks again Senthil
Rein
|
|
|
|
|
Hi,
I know from a bitmap object I can get the height and width and pixel depth but to get the size of the actual object (in bytes) is there a property (or something else I can use)? Or do I just multiply the three properties above to get it?
I'm writing a VB.Net Winforms app that will be dealing with various types of JPG's from my client's image server and from the web and I need to know the size in memory (not of the file itself) of the bitmap once I've read the image into the Bitmap. Since some of the images are coming direct from the web we don't always have the file info which is why I'm trying to find it out from the image itself.
In C# I think I could just get the Length property of the object but I can't see how to get that in VB.Net for a Bitmap as the property is not available in intellisense. I also tried casting it to a normal Object but I still could't get the size/length so I'm a bit puzzled by this.
Any help or pointers would be appreciated... I'm sure I've overlooked something really basic!
Mike
|
|
|
|
|
I use visual studio .net to develope a website. I have run the project on my local machine and it works fine, and all the requiredvalidators and rangevalidators work correctly.
To upload the site to the remote server, which is actual host of the site, I compile .dll files and put both .dll and .aspx files onto the remote server and access the site from actual web url, all the validators do not work at all. For example, a form with several required fields can be submit even when all the fields is empty.... I have no idea what I missed.
Could anyone here help me out?
Thanks in advance.
|
|
|
|
|
A new Java-like framework has just been released by SwingC.com.
SwingC is a great UI framework that can be used in place of MFC, or any other GUI framework. It has a java-like syntax, and works flawlessly.
|
|
|
|
|
Cheating this site of advertising dollars just put your product on my black list.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote:
Cheating this site of advertising dollars just put your product on my black list.
Going to the website and looking at the quality of the site and the software toolkit put it on my blacklist.
John
|
|
|
|
|
I didn't want to give him the satisfaction of the click.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi guys =)
Just drag in a ListBox & copy/paste this piece of code & run.
<br />
for (int i=0; i<50; i++)<br />
{<br />
listBox1.Items.Add("");<br />
TextBox tx = new TextBox();<br />
tx.Location = new Point(0,i*20);<br />
listBox1.Controls.Add(tx);<br />
}<br />
Now scroll the listbox as fast as u can. Items disappear! That's on XP ofcourse.
Anyone can help?
-- modified at 8:55 Tuesday 11th October, 2005
|
|
|
|
|
your code has no problem... i think it's the version of the OS...
dude... we know all microsoft is good all the times.. but extremely bad sometimes (taking consediration of your copy.. is it trusted copy or not?)... so don't worry ... if you want to check out your program... run it in another machine, with another Version
Militiaware
|
|
|
|
|
Hi,
I'm trying to get a regex pattern that will match any URLs in some text but *not* email addresses:
Eg: Given the following text...
Visit us on the web under Career Opportunities www.site1.com or email your enquiry to mike@site1.com. To obtain a copy of our position description go to http://www.site2.com or http://site3.com
... I'd want to get the three URLs but *not* the domain of the email address... I've tried and tried with all sorts of regex patterns but can't get this working... can anyone help me out on this one?
Cheers, thanks in advance for any help... this will help me hit a big deadline (hopefully!)
Mike
|
|
|
|
|
Hi Mike,
IMO, you can simply classify the URLs in the text into two groups. For ones starting with http:// you can use the pattern:
http: and the pattern:
www.([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)? for others starting with www.
Now you can refine the two patterns to produce a better one that can be used for the two groups:
(http: The sample code looks something like:
private ArrayList ExtractUrls(string s)
{
string pattern = @"(http://|www.)([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?";
Regex r = new Regex(pattern, RegexOptions.Compiled);
MatchCollection matches = r.Matches(s);
ArrayList list = new ArrayList();
foreach(Match match in matches)
list.Add(match.Value);
return list;
}
|
|
|
|
|
Thanks so much for that... this is a project I'm working on in my spare time so will look at it a bit later today.
Cheers,
Mike
|
|
|
|
|
What is IIS?
If I start working on .NET environment then what is basic things about IIS should I know?
what are the basics of IIS?
|
|
|
|
|
IIS is Internet Information Services[^]. In other words, it's a web server.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
First of all you MUST install IIS before the installation of VS.NET
It is necessary for ASP.Net applications which you need a web server.
(1) You can install it from
Start -> Control Panel \ Add Remove Programs \Add Remove windows component
check IIS checkbox
(2) You can use IIS Manager from
Start -> Run \inetmgr.exe
It shows default Web site (C:\Inetpub\wwwroot)
if everything is okey your internet browser can show asp files.
(3) .Net creates and open a virtual directory for your web project under
C:\Inetpub\wwwroot
It is better to know how to create a virtual directory from IIS as a general knowledge (http://www.webwizguide.com/asp/tutorials/installing_iis_winXP_pro.asp)
P.S : If you install IIS after the installation of VS.NET, VS.NET doesn't recognise IIS. Help instructions and ISS diagnostic tools don't help much.
Because of this problem I have to use use VS .Net 2002 for web applications instead of 2003 which doesn't see IIS on the same machine.
|
|
|
|
|
Hi,
I faced one question in my recent interview, i don't know the answer.
What is the size of stack in .net?
anyone knows?
|
|
|
|
|
According to Google[^] the answer is one megabyte.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
Thanks.
Yes i think it is true.
|
|
|
|
|
What this code does is let me choose a file, like an article saved in a .rtf file and take the text from that and put it into a .html file. The problem I'm having is in the middle, in the part that writes "the BULK of the content to the new file". It stops writing the writing the content from the .rtf file to the new file after it has written so many characters.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Button1.Click
Dim openStream As New FileStream(txt_BrowseDP.Text & ListBox_Browse.SelectedItem, FileMode.Open, FileAccess.Read)
Dim makeStream As New FileStream(txt_BrowseDP.Text & ListBox_Browse.SelectedItem & ".html", FileMode.CreateNew, FileAccess.Write)
Dim theReader As New StreamReader(openStream)
Dim theWriter As New StreamWriter(makeStream)
Dim BulkContent As String
'Write the FIRST part of content to new file
Try
theWriter.WriteLine("<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Strict//EN""")
theWriter.WriteLine("""http://www.w3.org/TR/xhtml1/DTD/strict.dtd'"">")
theWriter.WriteLine("<html>")
theWriter.WriteLine("<head>")
theWriter.WriteLine("<title></title>")
theWriter.WriteLine("<meta http-equiv=""content-type"" content=""text/html; charset=UTF-8"" />")
theWriter.WriteLine("<style type=""text/css"" media=""screen"" title=""Default"">@import url(../main.css);</style>")
theWriter.WriteLine("</head>")
theWriter.WriteLine("<body>")
theWriter.WriteLine("")
theWriter.WriteLine("<pre><div</pre> id=""container2"">")
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
'Write the BULK of the content to the new file
Try
theWriter.WriteLine("<p><strong>" & theReader.ReadLine() & "</strong></p>")
While theReader.Peek() > -1
If theReader.ReadLine() <> "" Then
theWriter.WriteLine("<p>" & theReader.ReadLine() & "</p>")
End If
End While
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
'Write the LAST part of the content to the new file and then close
theWriter.WriteLine("</div>")
theWriter.WriteLine("")
theWriter.WriteLine("<p><a href=""#container2"" accesskey=""c""></a></p>")
theWriter.WriteLine("")
theWriter.WriteLine("</body>")
theWriter.WriteLine("</html>")
openStream.Close()
makeStream.Close()
End Sub
-- modified at 19:37 Sunday 9th October, 2005
|
|
|
|
|
Call .Flush() on the stream before you close it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I added theWriter.Flush() and it writes everything now. Thanx.
|
|
|
|
|
You should have called Close on the StreamReader and StreamWriter instead, that way, it automatically flushes AND closes the stream for you.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
crystal reports report
in my Form i Have Sum query like this :
SELECT SUM((Sahar.RegHours * 1 + Sahar.Hour120 * 1.2 + Sahar.Hour125 * 1.25 + Sahar.Hour140 * 1.4 + Sahar.Hour150 * 1.5 + Sahar.Hour175 * 1.75 + Sahar.Hour200 * 2.0 + Sahar.Hour225 * 2.25) * Sahar.MoneyForHour + Sahar.TasNsiot + Sahar.Globaly + Sahar.HefrshySahar + Sahar.Manak - Sahar.HiovMils - Sahar.HiovBigod - Sahar.HiovHanala) AS total, Customers.CustName, Sahar.SalDateStart, Sahar.SalDateEnd, COUNT(*) AS Expr1, Customers.CustAddres, Customers.CustNum, Customers.CustCity FROM Sahar INNER JOIN Customers ON Sahar.CustNum = Customers.CustNum WHERE (Sahar.SalDateEnd >= @Edate) AND (Sahar.SalDateEnd <= @Edate1) GROUP BY Customers.CustName, Sahar.SalDateStart, Sahar.SalDateEnd, Customers.CustAddres, Customers.CustNum, Customers.CustCity
the sum value is changing for every row
i have also a datagrid and the resualt there are good
the problem is when i sending this data to printing in crystal
i dont know how to send the SUM val to the report
is someone here can help me whit that ?
thanks aheed.....
|
|
|
|