|
cstrader232 wrote: But how to refer to the Interface from the dynamically loaded .dll?
You put the interface in a (third) common assembly so that both the exe and the existing dll can reference it.
|
|
|
|
|
OK, I think I get that part... but how do I create an instance of the interface? I can dim the interface in the assembly:
Dim mm As myInterfaceAssembly.Imyinterface()
but then
mm.method
gives me "Object reference not set to an instance of an object.
From the .dll
imports myInterfaceAssembly
class A
Sub Test
Dim mm As myInterfaceAssembly.Imyinterface()
mm.method()
end sub
End class
thanks again
|
|
|
|
|
cstrader232 wrote: but how do I create an instance of the interface?
You don't create an instance of the interface; you can't as there is nothing to instantiate. The appropriate class inherits the interface (remember, you can inherit multiple interfaces). You then instantiate an instance of the class. The object can then be assigned to a variable of the interface type.
|
|
|
|
|
Sorry, I still don't get it. Could you stay with me for a minute (anyone else care to chime in?)
You don't create an instance of the interface; you can't as there is nothing to instantiate.
OK
The appropriate class inherits the interface (remember, you can inherit multiple interfaces).
I don't see how you inherit an interface. Perhaps you mean that the class with the methods to be used _implements_ the interface? OK, I see that
You then instantiate an instance of the class.
But I can't do that because the class does not exist in my dynamically created .dll
I thought that the interface .dll would allow my plugin .dll to find the class from the main .exe at runtime. I still don't see how to do that.
thanks again
|
|
|
|
|
cstrader232 wrote: I don't see how you inherit an interface. Perhaps you mean that the class with the methods to be used _implements_ the interface?
I'm primarily a C# developer and in C# you inherit (or implement) an interface. So, yes, you implement the interface in the class.
cstrader232 wrote: But I can't do that because the class does not exist in my dynamically created .dll
Sorry, I though it was the class in the DLL that was inheriting (implementing) the interface.
If it is in the main exe, then shouldn't the class already be instantiated? (You might want to show some pseudo code so I understand what you are trying to do)
cstrader232 wrote: I thought that the interface .dll would allow my plugin .dll to find the class from the main .exe at runtime. I still don't see how to do that.
I think you are going the wrong way around. It should help the code in your EXE use the dyanmically created class in the dynamically loaded DLL.
Anyway, some pseudo code of what you are trying to achieve (with or without interfaces) would be most beneficial at this point.
|
|
|
|
|
I am using VBA 6.3 and MS Access 2003.
I have a combobox set from a RowSource (a query on a table).
The bound column is a hidden column, width 0"
How do I set the selection for the combobox via vba code, e.g. set it to first, last or say 3rd item in the query?
DLipkie
|
|
|
|
|
The following will work
1) Make sure that the bound column is the first column
2) Make sure the first column is the only visible column
3) Use combo1 = "text" to set the text content of the combo
4) If you have a combo changed event handler then explicitly call it, the assignment in (3) doesn't seem to be sufficient to invoke the handler.
I've not tested
a) having multiple non-visible columns
b) having the bound column be non-visible
This may not be the most general solution but it works for my situation.
DLipkie
|
|
|
|
|
Also I had to explicitly set the focus to the combobox before assigning the text,e.g.
form1.combo1.SetFocus
DLipkie
|
|
|
|
|
I've got an MSHFlexGrid on a form and it is set up to not highlight cells or rows when the user clicks. Howver, I've put code behind the click event to check the background color of the cell in which the user clicked. If it is not yellow, I set the background color of all cells in the row to yellow. If it is yellow (i.e., selected) I set the background color back to white.
What I want to do is to allow the user to select multiple rows by holding the shift key down while they click but this doesn't seem to be working. When the shift key is held down during the click event, the row that is selected appears to be the same row that was selected when the first cell was clicked in rather than the actual row in which the mouse click event occurred. Does anyone know how I can get tis to work the way I described?
|
|
|
|
|
I finally figured out my problem. I was looking at the .row property instead of the .rowSel property. Once I figured this out the rest was relatively easy.
|
|
|
|
|
Hello there
I could finish writing some other programs and thanks to Cleako for the previouse help!
My second problem is that in the forms that I have designed I want to put a button for printing option. How this can be done? I mean connecting to the printer? May anyone help me with this?
email: fight_2_death@hotmail.com
╦َ║▐
|
|
|
|
|
In toolbox there is printdialog options. Simply drag it and drop it onto form and then you will able to use it inside your code. For example I want to open a print dialog when user clicks a button.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
PrintDialog1.ShowDialog()
End Sub
However, there are more things to do for printing for example you should bind the content for a specific document.
I hope that helps
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
I recently posted up an article here[^] with a control to do just that - worth a try...
|
|
|
|
|
Is there a specific version of VS 2005 or add on to get this interop service?
|
|
|
|
|
You might want to look at this[^] page for more information on the Office PIA's. There's more info on installing them here[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
In my software when I'm in a textbox(multilined) and press Ctrl+T a text box must appear beside the cursor(no matter where the cursor is).
pls Help very urgent.
|
|
|
|
|
You can get the cursor position ON YOUR FORM using something like:
Dim cursorPosition As Point = Me.PointToClient(System.Windows.Forms.Cursor.Position)
Put this code in your form's key handler code and it'll give you the coordinates of the mouse on the form, not the entire screen.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
thanks, That is Useful but I need the textbox2(small box) to come beside the mouse cursor(not the pointer) when I'm inside textbox1(big and multilined).
I didn't want a code for the entire screen.(my mistake);)
Pls reply still urgent.
|
|
|
|
|
To preface, I have only taken on VB.net course and principles to programing, so I am a newbe to all of this.
To the question. I have stated creating a program that will allow me to centrally administer all of the workstations on the network...(ie. WOL, Reboot, Shutdown, execute *.vbs....)
I have figured out how to open the excel with all of the data needed, but how can I now select the data from the cell(say MACAddr) and execute a *.vbs on it.
If CompName_selected
then read excel and find CompName_selected MACAddr
execute command (ie "shutdown /t" or "*.vbs")
loop until all CompName_selected complete.
end
Any help would be greatly appreciated
TECABA
SYSTEM ADMINISTRATOR
NORTHROP GRUMMAN
SUNNY FLORIDA
|
|
|
|
|
You would use the Process[^] class for this. Usually, something like this:
Dim newProc As Process = Process.Start("shutdown /t")
or
Dim newProc As Process = Process.Start("myscript.vbs")
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
like
dim days as integar
days = Date.Now.ToShortDateString - any date.ToShortDateString
Ahmed El-Badry
|
|
|
|
|
days = (DateTime.Now - anyDate).Days;
If you substract one DateTime object (NOT string ) from another DateTime object you get a TimeSpan object. TimeSpan has the property Days which appears to be what you want.
|
|
|
|
|
Please give an example of it
thnx
Ahmed El-Badry
|
|
|
|
|
|
Sir/Madam,
I have two records in my database.From the form , I am chosing the id and want that record to get displayed in the crystal report.There are two tables in the database and there is a primary and foreign key relationship between them.Now the problem is , both the records are comming.I have created links between both tables in the reports.Is there any way to create the crystal report dynalically or can i pass the parameter to show the report.
Parameter means that id which has primary and foreign key relationship.
But I don't know the code how to pass the parameters.
and parameters should be passed at both ends (I mean in the crystal reports as well as on the coding side)??
I don't want to generate the window that ask me which id u want to select .
Please help.
Thanks and regards
Pankaj
|
|
|
|