|
VB looks for the specified dll in the same directory as the application.
Note that if you are running inside the VB IDE, this means "c:\program files\visual studio\vb98\" not the location of your source code.
Either try copying your .net dll to this directory. Or try running your VB6 program built as an .exe with the .net dll in the same directory.
Also, I think there is an environment variable (something like "devpath") that you can set to tell VB to search other directories for required dlls.
Simon
|
|
|
|
|
nlarson11 wrote: did you specify what the ProgID (project.class) is in your class definition?
Yup.
<system.runtime.interopservices.progid("utils.objectchecker")> _
<comclass(objectchecker.classid,> _
Public Class ObjectChecker
Public Const ClassId As String = "4DF90706-7164-4c14-BD84-2A123885C706"
Public Const InterfaceId As String = "ED9298F8-EA4F-4c2f-93C0-66E3ACF0CD47"
Public Const EventsId As String = "DDD41717-C928-4374-B2FC-D3DD1A423717"
Simon Stevens wrote: Either try copying your .net dll to this directory. Or try running your VB6 program built as an .exe with the .net dll in the same directory.
Thanks for the suggestions and ideas.
I was pretty certain what I had was correct, so I created a new solution. I copied and pasted my code from the orig. ObjectChecker class in it's entirety and changed the guids. I cleaned the registry of any references to Objectchecker. Compile with new solution and everything works as expected.
If I go back to the orig and retest - error still exists. I did a "clean" and rebuild, error still exists. Not sure what's diff between the two solutions (I've verified the project properties and everything looks the same). The are very files used in this particular project, so I'm about to use WinMerge to see what's different between the project files......just curious as to what setting/change is causing this in the orig vs. the new solution (incase this happens in the future).
Sigh.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
I changed my screenname to something well................less offensive. No one's ever complained, but it's probably just a matter of time.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Let us know what the outcome was. I've come across that error several times, and it's always tricky to resolve if you think you've done everything you need to. Another possible solution to add to my bag of solutions would be good to know about.
Simon
|
|
|
|
|
I neglected to post my results last Friday.
I compared the .sln, vbproj, and class files with WinMerge. There wasn't anything different between other than the platform target and names of the files. Dunno what was causing the problem.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
I am using WebRequest class to crawl a sites.
This class is just working like a browser.
It takes more time to download the response.
Is there any idea to download only the Response Text so quickly Using .NET?
Thanks,
Nagaraj
|
|
|
|
|
Nagaraj Muthuchamy wrote: This class is just working like a browser.
In what way is it acting like a browser? Is it running the javascript on a page or something?
Nagaraj Muthuchamy wrote: It takes more time to download the response
More time than what?
Nagaraj Muthuchamy wrote: Is there any idea to download only the Response Text so quickly Using .NET?
I don't see how. It is just an HTTP wrapper around sockets. It doesn't really do that much for you. You still have to interpret the response yourself.
|
|
|
|
|
Hi, I want to implement redo - undo functionality in my winforms application developed in vb.net
Please guide
|
|
|
|
|
Think about the scope of the undo (before/after commit of data to the database)
Decide how you are going to deal with rolling back any changes in the data
Implement in code your design decisions.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
You may also want to do some reasearch into the Command pattern.
|
|
|
|
|
Hi I have one Plan try it!!!!
Use one more datagrid(2) control make that visible=false then
What ever changes u made in original datagrid control store in that 2nd one cell data in one cell. next cell address like { Row * Column) (Vice verse for undo and redo) When the user will call the undo or redo operation call that values in stack method...
may be it will help for u...
|
|
|
|
|
|
lol
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
I just finished off implementing a custom undo redo feature for a similar problem, what I did was create 4 classes. The first class is your UndoRedoManager class which will manage your undo/redo commands. Next we have our topmost class titled UndoRedoList which has 2 Collections. An Undo collection and a Redo collection. Then we have our middle class which has also a collection of what I needed was titled ChangesSet, since in my application we treated a series of cell changes as a single change. Last class is a change, where you record the cell location, the before value and the after value.
So on every cell change, you create a single ChangesSet object, and as many Change objects as you need (for each cell changed) and you store it in the ChangeSet collection, as a single entry in the UndoRedoList collection. for each undo command issued, move the ChangesSet object out of the Undo list into the Redo list.
Hard to explain, I can't provide the source but I will show you when I get home with some sample code based off of a datagridview. But, if you understand my broken logic above, you should be well on your way.
Just realized I forgot to say, if your datagridview cell being edited doesn't effect other cells, you obviously wouldn't need the second ChangesSet class, you would just need to create Change objects inside a Collection so you can cycle through it as you need to.
modified on Friday, December 12, 2008 1:22 PM
|
|
|
|
|
Hi to all,
I'm using VS2008 and VB lang.
How do I reference a method in the usercontrols parent container.
I'm coding, or at least trying, controls that constitute a Windows Control library that facilitates standardized size colour fonts etc.
the Library contains hierarchies of inherited classes e.g basebtn->OKBtn, basebtn->OKbtn->OKBlueBtn, basbtn->savebtn , basebtn->savebtn->savedeletebtn. etc.
Somewhat obviously at design time these classes do not know their eventual parent.
The parent will have the method being called
A simple example would be a Save button.
The form would have a SaveAll method
The buttons click event would call the forms SaveAll method.
Thanks in advance for anyone spending their time helping me out
|
|
|
|
|
You add the method as the onclick event of the button - google ADDHANDLER
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Thanks Bob.
I've made the first pass using your suggested google - ADDHANDLER but I'm not able to derive a solution at the moment. All the examples I've seen so far use a button on a form.
Although my classes will eventually be on a form I'm coding in a library that has no knowledge of a form. The class library only contains my inherited controls though eventually the library will be added to each solution that uses my library.
Nonetheless I'll keep looking -
Thanks for the input.
|
|
|
|
|
You should never call a method on the parent form of a usercontrol.
Instead add an event to your usercontrol
In the clickevent of your button you raise this custom event.
Then on the parent form you can simple catch the event you created and excecute the code you want.
|
|
|
|
|
Hi Tom,
Thanks for the reply. I'm confused though. I obviously have not had dealings with events and event capture.
Can you point me to some article or give an example on how the form makes itself aware of an event.
Also to mention I'm not just sitting back waiting to be spoonfed - I'll be googling this as well as Bobs ADDHANDLER.
Thanks for the speedy response by the way.
|
|
|
|
|
simple example:
<br />
public class MyButton<br />
private event MyButtonClick<br />
private withevents btn as button<br />
public sub new<br />
btn = new button<br />
btn.text="test"<br />
me.controls.add(btn)<br />
end sub<br />
<br />
private sub btn_click (sender as object,e as eventargs) handles btn.click<br />
raiseevent mybuttonclick<br />
end sub<br />
end class<br />
<br />
public class MyForm<br />
private withevents mybtn as MyButton<br />
public sub new<br />
mybtn = new mybutton<br />
end sub<br />
<br />
private sub mybtn_mybuttonclick() handles mybtn.mybuttonclick<br />
'Do your code here <br />
end sub<br />
end class<br />
This is all from memory so you might have to adjust a bit.
Your control doens't know and shouldn't know about the form.
Its the form that handles your control's mybuttonclick event
|
|
|
|
|
Thanks Tom.
I'll put this code into a test and modify it if required.
Tom Deketelaere wrote: Its the form that handles your control's mybuttonclick event
This is understood.
I am attempting to avoid having to write the button click handling code into each form. In my scenario the form would be subclassed and reside in a library that would be added to the solution. This subclassed form in the library would be pre-sized and formatted to maintain a consistent UI. It would have code that handles the control(s) say the click event. That code would only be called if the production form had an instance of that/those particular control(s) and a triggering event occurred in the control. Hence my thinking that the control would call up to its container. The control would not know or care about its parent, it would only know that it needs to call its parent when its trigger event occurs. The parent, admittedly more often than not a form, would assume control of any subsequent actions, including chaining up to its parent if necessary.
I think that we have now exhausted this thread.
Thanks for the response.
|
|
|
|
|
Valkiri wrote: How do I reference a method in the usercontrols parent container
You should never be doing this. A control should not care about, nor try to explicitly manipulate, it's parent container.
Valkiri wrote: Somewhat obviously at design time these classes do not know their eventual parent.
The same is true for runtime. Your controls should not know anything about their parent.
Valkiri wrote: The buttons click event would call the forms SaveAll method.
No, it shouldn't. Your control shouldn't even have a button like this. This button should be on the parent form, not your control. Your control only needs to expose, by public properties or events and argument, the values and settings under its control. It's up to the parent form to decide what to do with those values.
|
|
|
|
|
Hi Dave,
Thanks for your response.
I think that my terminology may have misdirected you. I'm trying to say that a button is a control and the button would be on a form but it may also be on a context strip for instance or part of another control.
The control be it a button or any other type of control needs in my scenario, to communicate with procedures and or functions in the form. The control - the button does not know anything about how to, what to, or where to save for instance. All it knows is that some event e.g. Click has taken place.
If I have 20 forms I don't think that I need to write the same code into the 20 buttons on the form. I believe that I should be able to have a library of buttons that have been specialized that call the parent form parentform.SaveALL to save parentForm.DeleteALL to delete, parentform.ChangeFBackground("Blue") to change the forms background etc.
Once the library has been added to my project I should be able to drag and drop the buttons for instance onto the form.
My problem is how to code a reference to the form when the form has not even been created yet. It will be at runtime of course.
However I am pursuing the event handler approach but at this point in time I am still confused. If you have any pointers to URLs or Code I'll be happy to look 'em up.
Thanks again - I am trying to grasp this.
|
|
|
|
|
My statement still stands. The control does not need to know about 20 instances of a form. This is, again, a job for the containing form, not your control.
Valkiri wrote: I believe that I should be able to have a library of buttons that have been specialized that call the parent form parentform.SaveALL to save parentForm.DeleteALL to delete, parentform.ChangeFBackground("Blue") to change the forms background etc.
Wrong. This is a bad method to use and actually has you generate more code than is necessary. The code on the form should SOLELY be responsible for it's appearance and actions. The controls should NEVER have any clue that they are even sitting on a form.
Valkiri wrote: My problem is how to code a reference to the form when the form has not even been created yet
You cannot have a reference to an obejct that does not exist. The closest approximation to this is an Interface. If you use your proposed control library on a form, that form will have to implement a known Interface to be able to have the controls call it. But, again, this is NOT a good idea because the form must now implement an interface ahead of time, specifically to use your controls.
|
|
|
|
|
Look what I've Found:
http://www.codeproject.com/KB/cs/agusercontrol.aspx[^]
This appears to address what I had in mind except in my case the I would want the button control to be in a separate library that would be added to any solution created and then dropped onto my form which is held in another library.
Are you stating that controls should never (hardly ever anyway) call the form.
Am I correct in understanding that you advise that the form should listen for and catch the, say, click event and act upon it.
If the above 2 statements are true I really need to reassess my understanding of the concepts - go away and do some serious reading.
If the form is waiting to catch the event does this mean that the controls say click event has no code in it.
Do you know of URLs / articles that address this question of using control libraries. ALL examples that I have access to drag and drop controls from VB's standard toolbox.
If I appear dogmattic it's only because I have a desire to understand - apologies and thanks for your responses and patience
|
|
|
|