|
I have 3 dlls involved in this. One is a 3rd party enhanced messagebox class. The second is several shared gui components that includes a wrapper to the 3rd party lib (I want to keep the wrapper separate to make updating the lib as easy as possible). The third consists of primarily nonGUI components. A few of those components do however spit out messageboxes in certain error conditions. The shared GUI components dll extensively references the shared nonGUI dll, so that dependency isn't changable. The problem is that when I try to have the nonGUI dll reference the GUIdll, which I only need for the messagebox wrapper, VS won't allow me to do so because it would create a circular dependency.
Am I correct in thinking my only options are to move the messagebox wrapper out of the shared GUI dll so that I can reference its new location from both, or to modify the classes in the nonGUI dll so that they let all their problem reports float up to a higher level before informing the user?
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
As I understand it, the logical dependency chain mainly is
GUIstuff --> nonGUIstuff --> SpecialMessageBox
I see three possible approaches to avoid the circular reference:
1) move the wrapper for SpecialMessageBox from GUIstuff to nonGUIstuff
you may feel it does not really belong there, and I would concur
2) move the wrapper to a separate DLL
GUIstuff --> nonGUIstuff --> wrapper --> SpecialMessageBox
it seems to be a pitty having a DLL for just that purpose
3) break the direct connection between your nonGUIstuff and the SpecialMessageBox;
this is the real OO approach: if the nonGUIstuff is about calculation, database accesses,
whatever, then it should not know how to interact with the user.
At best create an interface for reporting problems, implement it in GUIstuff,
and pass an object that implements it to nonGUIstuff.
Since you are going to ask anyway, yes, that interface itself belongs in nonGUIstuff
because nothing says it will use the GUI, and because nonGUIstuff needs it.
Hope this helps.
Luc Pattyn
|
|
|
|
|
Luc Pattyn wrote: As I understand it, the logical dependency chain mainly is
GUIstuff --> nonGUIstuff --> SpecialMessageBox
No, the main dependency is as follows.
GUIstuff --> nonGUIstuff
\--> SpecialMessageBox
There're only a very small number of dependencies between nonGUIstuff and SpecialMessageBox. GUIstuff is mostly controls shared between the mainApp.exe, and the newModule I've added for the current cycle. Most of GUIstuff and nonGUIstuff were originally part of mainApp but were pulled out to leave making newModule into a standalone app at some point in the future a simple task. SpecialMessageBox was a new addition and I didn't realize the problem until now because the places in question were oversites when it was initially added.
An interface like you suggested is probably the best option since some of the enhancements would produce feedback that would hardpressed to fit into a messageBox.
Making the change shouldn't be too painful since I'm the only developer, the downside is that I don't have enough experience to always come up with the best design decisions when i have to make them.
Thanks.
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
You're welcome.
dan neely wrote: the downside is that I don't have enough experience to always come up with the best design decisions when i have to make them.
Well, as long as you feel when some advise could be helpfull, this forum and a
few million people are here to help.
Luc Pattyn
|
|
|
|
|
Calling by the other way:
Is it possible to call a stored procedure WITH PARAM from .net WITHOUT using "AddParams" ? I mean we should be able to call(exec) the SP just like we do in the query analyser. I'd construct the string like "sp_testproc '111','RR',23'". and execute it as nonQuery. Is there any way? please help.
*
|
|
|
|
|
Astricks wrote: 'd construct the string like "sp_testproc '111','RR',23'". and execute it as nonQuery. Is there any way? please help.
You could use an SqlCommand object and pass the SQL command string as "exec sp_testproc '111','RR',23'".
|
|
|
|
|
|
have a google for SQL Injection first.
Russ
|
|
|
|
|
Russell Jones wrote: have a google for SQL Injection first.
Thanks for adding that. I really should have included that in my original reply.
|
|
|
|
|
You could also stop cross posting.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi all,
I need you guys to solve this problem for me and I will really appreciate it.
I have 2 pages, pageA that receives two input from a text box and redirects when a button is clicked and sends the two parameters entered to PageB which uses it to search a database. below is my code:
Hyperlink.NavigateURL="pageB.aspx?num1=" +para1 && +"num2="+ para2
i don't know if it is the concatenations that is the problem.
I will appreciate it if I get a quick response.
AC
|
|
|
|
|
You might want to reword that to read "I really need help with this. I can't see the problem"
acodman wrote: Hyperlink.NavigateURL="pageB.aspx?num1=" +para1 && +"num2="+ para2
why do you have && and + ? You probably mean para1 + "&num2=" para2
|
|
|
|
|
Shouldnt that be
Hyperlink.NavigateURL="pageB.aspx?num1=" +para1+ "&num2=" + para2;
If in doubt, do it in multiple lines and watch at the intermediate values as in:
string s="pageB.aspx?num1=" +para1+ "&num2=" + para2;
Console.WriteLine("NavigateURL will be set to: "+s); // or whatever is able to show you a var
Hyperlink.NavigateURL=s;
Luc Pattyn
|
|
|
|
|
acodman wrote: I have 2 pages, pageA that receives two input from a text box and redirects when a button is clicked and sends the two parameters entered to PageB which uses it to search a database. below is my code:
Hyperlink.NavigateURL="pageB.aspx?num1=" +para1 && +"num2="+ para2
Try,
Hyperlink.NavigateURL = String.Format("pageB.aspx?num1={0}&num2={1}", para1, para2);
|
|
|
|
|
Hello guys .
i am developing an application protocol like soap
it is based heavily on xml ,
i need to read a string which contains the xml declaration of the protocol and manipulate that string using built in classes of xml in dotnet studio , can i initialize a class or any method with the string that contains the xml format..
Thanks guys.
Human knowledge belongs to the world.
|
|
|
|
|
|
Hello guys i just testing regular expressions
and i give to the regex class a well formatted pattern
but it always unable to recognize the string whereas i put validated string that contains the regular pattern .
here is my code
<br />
using System.Text.RegularExpression;<br />
.<br />
.<br />
.<br />
.<br />
.<br />
string pattern = "([0-9]+\".\"[0-9]*)";<br />
Regex reg = new Regex(pattern);<br />
if((reg.Match(inputText.Text)).Success)<br />
{<br />
OutputText.Text = "Matched successfully";<br />
}else<br />
{<br />
}<br />
it always enters in the else block in the code whereas the pattern is well formatted and in good structure. is that it ?????
please tell me cause i need to kill my compiler.
Human knowledge belongs to the world.
|
|
|
|
|
the pattern doesn't work at all. Why are you trying to place quotes in the pattern?
([0-9]+\.[0-9]+)
|
|
|
|
|
Thank you ed , Really thank you brother. i had figured that out , thank you
Human knowledge belongs to the world.
|
|
|
|
|
I have Created one Class Libary(DLL) Using C#.net 2005 .
How to use that Dll in C-Lang or C++ (Using LoadLibary).
How to call those functions from C or C++ (6.0 version)
Thanks in Advance
Regards
Vijay
|
|
|
|
|
I did something similar to use some classes in .NET from VC 6. Not exactly like what you are asking, but I think if you do it this way, you will get the result you are looking for:
1) Create a "bridge" .DLL written in C++ .NET that instantiates the classes in your C# library and accesses the members as you want them. Create helper functions, structures, or whatever it is you need that is a 1-1 map to what is in C# that you need.
2) Call this bridge from the VC 6 code as you would any other .DLL. You are using the IJW (it just works) feature of C++ .NET to get your code to work together correctly.
My code used LoadLibrary because I didn't want to force the user to have the .NET framework on their machines (it just had a default behaviour otherwise).
David
|
|
|
|
|
Hi David ,
Really Thanks for you Time to answering my question .
Thanks for telling me a way .
Regards
Vijay
|
|
|
|
|
An alternative to David's approach is to use the CCW (COM callable wrapper). Just add a COM interface to your managed DLL, register it properly and you may use it from your unmanaged application like any other COM object. However, in this approach the installation of the .NET framework is mandatory.
Regards,
Tim
|
|
|
|
|
I have to add to a form a button with left,top,height,width given by the user.
how can I do to put the button on the form, but the surface of each button to be without the surface
of the others button.
I try to locate if the each corner of the new button is in the surface of the each button added on the form, but I think is to complicate. know anyone another method....
|
|
|
|
|
What is so hard? Just keep a tally of the last button's vposition + height and hposition + width, and add other buttons accordingly.
|
|
|
|