|
|
Look at the Invoke method.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
|
I have a problem it is described as under
I want to load an ascx control in the class (no the web form code behind file) file so that i would be able to render the control.
what i am doing is as follow
Page page = new Page ();
creating the page instance and then loading the control
Control cont = a.LoadControl(path );
but it throws a null pointer exception
Remember i am in the class file where "Page" reference is not available that is y i have to make the instance of a page
Please help me
waiting for ur sids
|
|
|
|
|
Gurus Guru wrote:
Remember i am in the class file where "Page" reference is not available that is y i have to make the instance of a page
In that case making a new Page isn't going to help you, because it will be a reference to a brand new page, not the one you are currently processing.
To my knowledge you'll have to construct your class so you can pass in the Page object it should be using. But I don't know much about ASP.NET so you may be better off posting in that forum.
James
"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation
|
|
|
|
|
But the problem is that my code is written in a thread and it never have any interaction with any web page
The scenario is that i have written a thread class that mails some search results after some time i have a user control that takes some results array (my own defined class) and display it in the data grid so i thought to use this control
Now i am in the class file and want to load the control so that i may be able to render that control afterwords and then email the html to the user
getting me
But still no use
|
|
|
|
|
Did u try something with
System.Web.HttpContext.Current. ...
(I am not so sure about that... But this has some bunch of properties that might help you.)
deepak
Deepak Kumar Vasudevan
http://deepak.portland.co.uk/
|
|
|
|
|
The problem i am running it the application in thread and using a singlton and factory pattern too and it is a demon thread and dont have to do any thing with any web form i have at the end passed the page reference who calls the thread but when in the class file after the thread has been created and i try to bind the results with the datagrid it raise the exception that request is null
|
|
|
|
|
Hi.
I want to create a C# program that will be able to write in a text file every application that the user/machine ran. This file will resides in a specified directory on a particular machine. I have read that this is possible using WMI in a client-server environment. I am running Active Directory using Windows .Net Server RC1. I don't have any experience with WMI yet. Is WMI supported in C#? What is the namespace where I can find the classes specific to WMI? I would greatly appreciate it if someone can show to the basic program structure for this or links relevant to this matter. Thanks
|
|
|
|
|
swarm wrote:
Is WMI supported in C#?
Yes.
swarm wrote:
What is the namespace where I can find the classes specific to WMI?
System.Management
You can find very good articles about WMI in C# in this site.Search this site with WMI or System.Management Keyword.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
I need to be able to call a .NET object from inside ASP (and later VB6).
Has anyone got information on this?
Simon
Cheers,
Simon
"The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter.
my svg article
|
|
|
|
|
put this attribute on the class:
[System.Runtime.Interop.Guid("put-a-guid-here")]
Set "True" on Project properties/Configuration Properties/Build/Register for COM Interop
That's it.
I see dumb people
|
|
|
|
|
SimonS wrote:
Has anyone got information on this?
Simon, I believe you are going to need to look into the Regasm.exe (Assembly Registration Tool)[^] to do something like this. I haven't been able to spend a lot of time with it, however I am looking to do this as well. You might also find the Tlbexp.exe (Type Library Exporter)[^] helpful in this process. Let me know if this helps.
Nick Parker
You see the Standards change. - Fellow co-worker
|
|
|
|
|
|
Hi there,
I need some basic WinXP icons as Refresh, Open, Print etcetera.
Where can I find them?
Thanx in advance
Tom
|
|
|
|
|
Email me and I'll send you some via email, I can't find you email in your profile
|
|
|
|
|
can you possibly send me some basic win xp icons too ? email them too cuteone_97058@yahoo.com
jesse m
|
|
|
|
|
|
I send a email from a C# form.
Example below.
using System.Web;
using System.Web.Mail;
try
{
MailMessage MailMsg = new MailMessage();
MailMsg.From = "dorina@tradelabs.ro";
MailMsg.To = "dorina@tradelabs.ro";
MailMsg.Subject = "test";
MailMsg.Attachments.Add(new MailAttachment("C:\\Test\\Noutatile saptamana.htm"));
SmtpMail.SmtpServer = "name of server";
SmtpMail.Send(MailMsg);
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
}
It works.
BUT when Attachment file name containts ASCII extended characters
(example MailMsg.Attachments.Add(new MailAttachment("C:\\Test\\Noutaţile săptămână.htm"));)
then the mail can't be send and I get a "Could not access 'CDO.Message' object." exception.
How can be solve this problem?
Thanks, Dorina
dorina
|
|
|
|
|
Hello,
How do I do to an application when minimized flash in taskbar ?
Thanks for your help.
|
|
|
|
|
The API you should look at is Flash or FlashEx.
Here[^]'s an article on how to use the API.
Here[^]'s an article from EricG on using libraries from .NET generally.
HTH
Cheers,
Simon
"The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter.
my svg article
|
|
|
|
|
Does anyone know if c# has an Idle event that is called continuously while the application is in an idle state?
The Application.Idle event occurs when the application finishes processing and is about to enter the idle state.
I need one that will be called repeatedly...
|
|
|
|
|
Can any one tell me how to get to the selected text in an edit/richedit control (or any control having text that could be highlighted) of a foreground window from my own application? What about accessing a selected text in IE browser? One can see such use in Microsoft Boolshelf -- highlight any word in any window and then click on the QuickShelf icon in the system tray to get the meaning of the word! Tomasz Sowinski in the VC++ message board mentioned earlier using a combination of (1) calling the WIN32 API GETFOREGROUNDWINDOW to get a handle to the window and (2) sending the EM_GETSEL window message to get a pointer to the selected text. But this limits only the case when the foreground window is itself a edit/richedit control.
Would appreciate very much any answers to these questions!
Gene Yu - gene4yu@yahoo.com
|
|
|
|
|
I am attempting to create a piece of code that will drop through from a root directory and list all files and subdirectories within it (regardless of the directory depth)
As I see it the only way I can do this is through some sort of recursive code, which at the moment elludes me, has anybody come across anything like this before?
At the moment I have the following, which is butt-ugly and doesnt come close to what I need :
<br />
public string ARCHIVE_PATH = ".\\archive\\";<br />
private void RecurseDirectories()<br />
{<br />
listBox1.Items.Clear();<br />
DirectoryInfo dir = new DirectoryInfo(ARCHIVE_PATH);<br />
DirectoryInfo[] diArr = dir.GetDirectories();<br />
foreach (DirectoryInfo dri in diArr)<br />
{<br />
listBox1.Items.Add(dri.Name);<br />
DirectoryInfo drill_dir = new DirectoryInfo(ARCHIVE_PATH + dri.Name);<br />
DirectoryInfo[] drill_diArr = drill_dir.GetDirectories();<br />
<br />
foreach (DirectoryInfo drill_dri in drill_diArr)<br />
{<br />
listBox1.Items.Add(drill_dri.Name);<br />
}<br />
} <br />
}
|
|
|
|
|