|
Christian Graus wrote: the few poor suckers on this earth still stuck writing it
Oh you mean kissdnuts who is now jon_boy for some reason.
Poor buggers stuck remediating some old VB6 code by the sounds of it!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
jigar_arps wrote: and my Application Design is like that:
Is your Application Design empty?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I have a .Net interop .dll. The .dll is registered with regasm. If I open VB6 and use the following syntax, everything is peachy:
Dim o As New Utils.ObjectChecker
msgbox o.CheckObjects("C:\windows\system32")
However I must be able to call this particular interop .dll without a reference in the VB6 project, so I change to the code as follows:
Dim o As Object
Set o = CreateObject("Utils.ObjectChecker")
msgbox o.CheckObjects("C:\windows\system32")
When I attempt to recompile and run in VB6, I get: Run-time error 429. ActiveX component can't create object.
I found the following MS support article and have verified I have a valid parameterless constructor, register for COM interop, etc, etc (obviously this is the case since example 1 works fine).
Any obvious ideas on what I might be overlooking or doing wrong here?
Thanks guys (and gals if there are any?)
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
did you specify what the ProgID (project.class) is in your class definition?
<microsoft.visualbasic.comclass(),ProgId("Utils.ObjectChecker")> _
Public Class ObjectChecker
.
.
.
End Class
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
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.
|
|
|
|