|
Yet, .Net is crap where code re-use is concerned. In C++, all you had to do was add a given file to your project, regardless of what folder it was in. In .net, you can't do that. I don't care to have a million little DLL's distributed with my app. Sometimes, I don't want ANY DlL's. Code re-use is limited to making a COPY of a file in the new project's folder. It's just crap, and a huge step AWAY from code re-use.
"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
|
|
|
|
|
Isn't using a Source Control product the modern version of pointing your C/C++ project to a file on your hard drive?
led mike
|
|
|
|
|
Nope, not when you're dealing with .Net.
"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
|
|
|
|
|
You can add source code as a link, I do that a lot when I don't want to include my whole library.
I agree (and have since my first experience with VS ten years ago) that VS should not copy files by default.
|
|
|
|
|
Ok...I now have many follow up questions to this dilemma.
If you can't just link in a DLLs source tree, what is the purpose of having a solution and not just opening up multiple IDEs with multiple projects?
If I just reference the DLL, when I step into a function debugging, will it know where to find the source for that DLL?
This DLL I already have has common data access routines in it that is used by a service I created. I would like to access those same routines with a new service. I may also need to add more functions, but like I said, I would like to be able to step into those routines and debug.
|
|
|
|
|
mobius111001 wrote: If you can't just link in a DLLs source tree
You can, no one said you could not.
mobius111001 wrote: I step into a function debugging
If it were me, I would not just reference a DLL that I did not trust had been tested and debugged. If you cannot trust the functionality of the DLL you would probably be way better off adding the project to your solution.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Ok, so what is the proper way to add a project to a solution so that a second copy of the code isn't created?
|
|
|
|
|
mobius111001 wrote: proper way to add a project to a solution
I suppose that depends on the version of VS you are using. In VS 2008, right click on the solution, select Add, then select Existing project.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
mobius111001 wrote: is there a better solution?
I have always found using a source control product very productive.
led mike
|
|
|
|
|
Yes you can. I do. Otherwise, I can't step into that code while debugging.
|
|
|
|
|
Can anyone give me a detailed step by step procedure to deploy a C# application in visual studio 2005 with sql server 2005 databse ? I had developed an application but I can't deploy it because I don't know the procedure to deploy it. When I deploy it is working on my machine but on client's pc it throws an exception that cannto Login to the database.
|
|
|
|
|
|
i need to change mouse cursor outside form.
how can i do it?, can i use user32.dll?
please give some tip or hint or example to me.
thanks a lot....^^
|
|
|
|
|
ping_jacob wrote: change mouse cursor outside form
What do you mean?
only two letters away from being an asset
|
|
|
|
|
|
Hello,
how can I link a hscrollbar to a picturebox ? (I need to get the offset from hscrollbar.Value, so that I can calculate the horizontal coordinates of a point in the image) I believe I must use an OnPaint event, but do not know how to use it. A portion of code would be appreciated.
thanks
pcjd
|
|
|
|
|
Are you asking how to determine the clicked point on an image, even if the image is larger than the area it's being displayed in and the image is scrolled to one side??
If so, you don't need the scroll offset.
Create a UserControl, put a Panel on the UserControl and set it's AutoScroll property to true. Then put another Panel inside the first one. Expose a property in the UserControl to take an Image. In the setter for the Image, set the second Panel's size to match the image size. Now, when you click on the second Panel (the one showing the image), you handle the Click property of that Panel control. You'll get the coordinates of the click, relative to the upper left corner of the image Panel.
|
|
|
|
|
Hello,
yes I am trying to get the coordinates of a clicked image - the absolute
coordinates - not those relative to the top corner of the panel, but
relative to the top corner of the image when I've scrolled way past it. I've already tried your method, which is why I want the offset.
thanks
pcjd
|
|
|
|
|
Offset relative to what?? I don't understand your explanation.
|
|
|
|
|
Hello,
I want to get the coodinate (horizontal only) of a point on the image
after I have scrolled a certain way along the X-axis of the image. So
initially, the image is displayed (perhaps showing a range of X values from 0 to 500). As I scroll along the image, using your method, the X coordinate I want would be (clicked value of X + scroll bar offset) - as the clicked value of X only gives the coordinated relative to the panel and NOT the image. As an aside, I have already done this in Delphi 6, but this is a port to C#, and it appears that I will need to use hscrollbar and get its offset from hscrollbar.Value, as it appears this cannot be obtained from the panel scrollbar.
regards
pcjd
|
|
|
|
|
You don't need the scrollbar values. I've done the very same thing wihtout them, well getting the clicked offset anyway. Since the panel is exactly the size of the image, you get the coordinates of where the user clicked in the panel, relative to the top left corner of the panel. This translates to getting the coord's in the image itself.
I'm failing to see where the problem is and why you think this doesn't work.
|
|
|
|
|
Hello,
maybe I'm doing this incorrectly. Just to summerise, I have two panels,
the outer panel1 has Autosize = true, the inner panel2 has panel2.BackgroundImage = (Image)MyImage. I've set the width of the outer panel to 775, and the inner panel to 2000 (which is enough for all images). After I initially load an image and I click on a specific point on the right of the image I get the cursor position as 650,446. If I then scroll the image, but still keeping this point in view, clicking on it gives a cursor position of 340,446 (the point has visually moved to the left). The absolute value should be 650 + (scroll offset), not 340. Hope I'm making myself clear.
regards
pcjd
|
|
|
|
|
pcjd63 wrote: outer panel1 has Autosize = true,
Useless as you set the absolute size of the panel. Did you actually mean to say you set the AutoScroll property to true?
pcjd63 wrote: the inner panel to 2000 (which is enough for all images).
You would normally set this inner panel to the same size as the image itself when you set it's background image property to the image.
pcjd63 wrote: I click on a specific point on the right of the image I get the cursor position as 650,446. If I then scroll the image, but still keeping this point in view, clicking on it gives a cursor position of 340,446 (the point has visually moved to the left). The absolute value should be 650 + (scroll offset), not 340. Hope I'm making myself clear.
It would appear that you're handling the click event of the wrong panel. You need to handle the click of the INNER panel, not the outer one.
I've done this myself, creating a UserControl that does exactly this, and a lot more. Whenever you click on the image being viewed, it fires off an ImageClick event with the coordinates of the mouse click relative to the image, not the outer panel, and all I did was raise the new ImageClick event, reusing the MouseEventArgs.Location property given by the inner panel's Click event.
|
|
|
|
|
Hello,.
yes, sorry, it was a typo, I meant Autoscroll, not AutoSize.
All of the images are of a fixed (large) width, which is why I set the width of the inner panel to 2000.
I am handling the click event of the inner panel, and whether I use
Cursor.Position.X or MousePosition.X I get the same X values, which are relative to the panel, not the image.
if you are getting the correct absolute coords - I must be doing something wrong.
thanks for your patience
pcjd
|
|
|
|
|
If you're handling the mouse click of the inner panel, no matter where you click on it, repeatedly, the mouse coord's will not change with the scrolling of the outer panel.
Next, why are you settings the size of the inner panel so much larger than the actual image contained within?? Just set it's size to the size of the image and you won't have to do any funky math to get the coords mapped to the image.
I told you everything I'm doing. It's as simple as my description.
|
|
|
|