|
Is MyApp.DataAccess in another assembly? Do you have a reference to it in your web project?
only two letters away from being an asset
|
|
|
|
|
Yes, and yes.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John, if the other assembly (the one containing EntityTable) is referenced, you should be able to see it. For some reason you're not, so something is wrong.
There's a little keyboard shortcut that may help here. In your CMyEntityTable class, place the caret on EntityTable inheritance declaration. Hit Shift+ALT+F10. Does anything popup? If the type is available in some referenced dll, but you don't have an appropriate using statement to import the type, this key combo will drop down with options for adding a using statement.
|
|
|
|
|
John Simmons / outlaw programmer wrote: public class CMyEntityTable : EntityTable
see if this works
public class CMyEntityTable : MyApp.DataAccess.EntityTable
led mike
|
|
|
|
|
Hi!
I'm wondering if there's a way to read an application into memory from another one and launch it there?
The scenario is, we have two files, one is compressed. Can the other one uncompress it into memory and execute it (that is, without extracting it onto the disk)?
/ Mike
|
|
|
|
|
Hello
Uncompressing the exe file directly into a memory block won't be much of a problem. what really faces you is that you want to take over from the program loader, which is -I think- the biggest OS hack you can think of!!
Exe files aren't copied into the memory as it is. There is a part of the os that is called the program loader which reads the binary data in the exe, then allocates memory blocks accordingly. One line in the exe may allocate one byte, while another may allocate upto 4 gigabytes, or even more?!!
Doing this in pure C# is almost -if not really- impossible. You are asking for very low level programming. This means that you not only manipulate a free memory block to inject your exe -aftr modifying it as the program loader would-, but you have to manipulate some table -I don't remember its name at the moment- to register this block of memory as a working independent process!!
If you really found a way to get out of this mess, I'd be eager to read an article about it!!
Regards
|
|
|
|
|
Hmmm, okay, but is it possible to make the program loader load the program from memory instead of disk? That would solve the problem.
|
|
|
|
|
Well, again not in C#.. If you have some C++ backgrounds, you can look up CMemFile class in your MSDN. Maybe it helps.
Regards
|
|
|
|
|
Using code DOM there is the ability to create an application on the fly essentially. Don't know if it would apply to your situation
only two letters away from being an asset
|
|
|
|
|
hi,
i need to swap between forms, im looking at 3 screens on (yes realy screens attached to pc)
on each screen there is a different form, but in a menu i can choose diffent forms to look at, only the 3 most always remain the same,
so if i swap from form on the first screen it needs to close the form that was there befor and check if its not the form form screen 3,
realy a bit fussy....
i found a example but its in vs 2003:
http://www.codeproject.com/csharp/applicationcontextdemo.asp[^]
and i'm not sure how to implement this in my existing application.
any body has tips??
thx
|
|
|
|
|
faladrim wrote: (yes realy screens attached to pc)
I have 5
So you have several different forms in your app and you want to change which one has the focus ? Or you have several different apps running ?
If Marc's 2003 code does what you want, it will work in 2005 as well.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
thx,
it's more like a perant child thing,
i have one app with several forms
one is a visualisation of a factory, this is the one that always should stay
and in a menu bar you can choose several others like:
logs, history, orders, alarms, .... these are changeble on the two other screens
i think for this i should work with parent child not?
the perant is the form with the menu bar, and all the others are the childern
you think this shoud work?
ill know it monday :p
-->> its weekend
|
|
|
|
|
Hello,
I have to made some application in which I'm using MDI forms. Like in first form I have two buttons say button1 and button2, from here I've to navigate to a MDI parent form and in it the child window regarding the respective button clicked should open. I'm struck here as i dont know how to perdorm this action.
Can someone help me please...
And yes Please give code rather than simple suggestion
Thx n regards
PARAG
|
|
|
|
|
Hello
I don't really think I get you!! Do you mean you want to activate a second MDIchild when a button on the First MDIChild is clicked?
Regards
|
|
|
|
|
Ok take an example
I have an initial form a Login form
on this form I have labels and text boxes for loginid and Password, and tqo buttons Login(for existing user) and Signup(if new user)
now there is an MDI window FORM now if the Login button is clicked then user must enter his home page form in the MDI window FORM, and if SignUp is clicked then SignUp form must open in the same MDI window FORM..........
That is what i want
I hope its clear now
|
|
|
|
|
Why do you want it MDI?? For all I know it's a simple form with a webbrowser control in a Dock.Fill state. The login in dialog is just another form. In your Form_Load event just write
MyLoginForm login = new MyLoginForm();
if(login.ShowDialog() != DialogResult.Cancel)
{
if(login.IsSignUo)
webBrowser1.Navigate(SignUpURL);
else
webBrowser.Navigate(HomePage);
}
Regards
|
|
|
|
|
Hi
I use a picturebox and filled with a bitmap onto the form.Now if i place any control it display a control color in background.How can i make it transparent only text displayed not control color
Parshant
|
|
|
|
|
You need to use SetStyle to allow transparent background, and set the background color to Transparent. At least, that's what the docs say. It doesn't work for me. If I want transparent, I write an owner drawn control.
How does this relate to your picturebox ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
but if i make background color to transparent it does't work
|
|
|
|
|
Like I said, it doesn't work for me either. But that's what the docs say. I've had to resort to writing my own derived controls and owner drawing them, making sure I set double buffering and all painting in WMpaint, so the control does not erase itself.
But why do you have a picturebox ? If it's for a background, your form has a BackgroundImage property.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I am in the process of designing a web-querying application requiring quite a few seperate thread processes to run when I click the "Run" button...
I tried using Threadpool and although it works reasonably well (though I dont have a basis for comparison and think that it can be much faster - run more threads - actually), there's a major flaw with it: I cannot destroy threads midway through operation (using "Stop" button).
I came across the BackGroundworker here: http://msdn2.microsoft.com/en-us/library/waw3xexc.aspx[^] but I am not sure whether multiple Background workers is a good idea.
Also came across a custom-designed thread pool here: http://www.codeproject.com/cs/threads/workqueuethreading.asp[^] which seems quite promising.
Any ideas which of the above 2 options could be more suitable? Any other advice on threads will be taken aboard with much appreciation.
Many thanks,
Gerry
Threading-newbie
|
|
|
|
|
Hello
1- Make a new thread
2- Make a List<Thread> collection
3- Add the new thread to the list
4- Loop until you reach the number of threads that you want
5-
foreach(Thread T in MyThreadCollection()
T.Start();
6- When you want to stop aprubtly call T.Abort() in another foreach loop.
Regards
|
|
|
|
|
Thanks this seems like a good way to create a 'Thread Pool'...
I have a little problem tho - the construct for a thread is as follows:
<br />
Thread t = new Thread(new ThreadStart(ThreadProc));<br />
but I'd like to add an "array" of threads to MyThreadCollection, each associated with a string
fetched from a richtextBox of variable length:
<br />
<br />
for (int j = 0; j < InList.Length; j++)
{<br />
Thread |ThreadName?| = new Thread(new ThreadStart(ThreadProc));<br />
MyThreadCollection.Add( |ThreadName?| );<br />
}<br />
<br />
foreach(Thread T in MyThreadCollection() <br />
T.Start();<br />
<br />
ie. what should I put for |ThreadName?| above? Is there some way of using a string array to assign each element as the "name" of a variable? Also, is it possible to pass an argument to the ThreadProc method?
Your help mcuh appreciated!!
gerry
|
|
|
|
|
gvanto wrote:Is there some way of using a string array to assign each element as the "name" of a variable?
Well, instead of using a generic List, use
Dictionary<string, Thread> MyThreadsCollection = new Dictionary<string, Thread>();
MyThreadsCollection.Add(ThreadName, MyThread);
Where the ThreadName is the text you get from the RichTextbox.
To get the Thread with the specific name use
MyThreadsCollection[ThreadName] = new Thread(new ThreadProc);//for example
gvanto wrote: Also, is it possible to pass an argument to the ThreadProc method?
Use ParameterizedThreadStart delegate instead of ThreadStart.
Regards
|
|
|
|
|
Wow thanks Nader,
Your methods are excellent and have been VERY helpful thanks a million!!
I'm actually doing it like this:
<br />
<br />
for (int j = 0; j < InList.Length; j++)<br />
{<br />
AddThread(InList[j]); <br />
} <br />
<br />
private void AddThread(string threadName)<br />
{<br />
ThreadStart threadDelegate = new ThreadStart(ThreadProc);<br />
Thread t = new Thread(threadDelegate);<br />
t.Name = threadName;<br />
<br />
this.MyThreadList.Add(t);<br />
}<br />
But Im not sure - it seems to work but is it healthy?
Thanks for the advice on ParameterizedThreadStart - will check it out immediately!
Gerry
|
|
|
|