|
Please don't make a new post when you're discussing the same problem, respond to my post instead.
Do you know what a GUID is ? It's the unique ID that represents your COM object. The base address has nothing to do with it. I have to admit, I have no idea how it's set in VB6, I've only done it in C++. From memory, there's a text file which contains the GUID. Do NOT make up a GUID, use the tool to generate one for you. Make sure you also give it a new name, because in VB you generally use the name, not the GUID.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks for giving direction.
Sasmi
|
|
|
|
|
Hi Guys,
I Have a dll name 'XYZ.dll' which i use in my project call 'ABC' and install it on users pc and i use same dll 'XYZ.dll' (with some major changes) in my another project call 'PQR' if i install this pqr on users PC i found it overwrite the first one dll which is use in 'ABC' project. can any one help me regarding this i am first time using this dll funda in vb6. if any one give me detail idea about 'How to use dll' it will really great for me.
Thanks in advanced
Sasmi
|
|
|
|
|
I assume this is a COM dll, otherwise you could just put the dlls in the directories with the apps and it would be fine.
You've done the wrong thing, and there's no easy way around it. If you're going to change a COM dll, you need to generate a new GUID so you have a new version. Either way, you should never break existing functionality, only add new functionality.
In .NET, dlls are not registered, and are just loaded from the local directory. This change was made because the recommended way to use COM would work fine, but too many people just didn't bother to do it properly/thoughtfully.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi, How do I create a comma delimited text file and write data from SQL database in it using Vb .net?
|
|
|
|
|
Please don't cross post.
Best Regards,
Apurva Kaushal
|
|
|
|
|
i have to draw pie chart on my application run time.i used this way.
create a graphic object and then draw lines.
my problem is when from minimize or other form come over that from,drawing is refreshing(erasing)
is there a way to prevent this.
|
|
|
|
|
No - you need instead to do it properly - draw it in your paint handler.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I have no idea why some idiot voted you a 1...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
*grin* Good advice often attracts low votes, because what people want is a slab of code that works despite violating how Windows itself functions
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
You don't stop this. You actually need to have this! When another window is dragged acrossed your chart, it has to repaint itself. Put all of your drawing code in the Paint event of the control you're drawing this chart on and it'll do just that.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Putting the code in the event is one way of doing it and probably the best way if your pie chart is constantly changing. Another way would be to create a bitmap object and set the image propertie to the bitmap and it windows will handle the redrawing for you but you should really try doing it the correct way.
Recreating the wheel is the best way to appreciate what the previous coders have gone through to get you where you are at now.
|
|
|
|
|
I am using VS 2002. I have put the code down below. I have a module that creates a systray application. Ideally I would like to hit the Form123_load on the class from the module so it will execute a listener for a hotkey.
I have a sub called staticmethod that does execute my messagebox but only if the login button is pressed (so the module must require an action). How can I have it access the form123_load sub from the module automitically when the program runs without an action placed upon the module?
Thank you!
Module Imports systray1.vbAccelerator.Components.HotKey
Public Class Form123
Inherits vbAccelerator.Components.HotKey.HotKeyForm
Shared Sub staticmethod()
MessageBox.Show("hello")
End Sub
Public Sub Form123_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' add an event handler for hot key pressed (or could just use Handles)
AddHandler Me.HotKeyPressed, AddressOf hotKey_Pressed
' set the hotkey:
Dim htk As HotKey = New HotKey("My HotKey", Keys.Up, HotKey.HotKeyModifiers.MOD_CONTROL Or HotKey.HotKeyModifiers.MOD_SHIFT)
Me.HotKeys.Add(htk)
'this is a test
'show a messagebox:
End Sub
Private Sub Form123_Closed(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Closed
' remove the dynamic event handler
RemoveHandler Me.HotKeyPressed, AddressOf hotKey_Pressed
End Sub
Private Sub hotKey_Pressed(ByVal sender As System.Object, ByVal e As HotKeyPressedEventArgs)
' ensure form is shown:
Me.RestoreAndActivate()
'show a messagebox:
MessageBox.Show(Me, _
String.Format("HotKey Pressed:" + vbCrLf + "Name: {0} " + vbCrLf + "KeyCode: {1}" + vbCrLf + "Modifiers: {2}", _
e.HotKey.Name, _
e.HotKey.KeyCode.ToString(), _
e.HotKey.Modifiers.ToString()), _
".NET Hot Key Demonstration", _
MessageBoxButtons.OK, _
MessageBoxIcon.Information)
End Sub
End Class
Module systray
Private systray As New NotifyIcon()
Public Sub Main()
Dim mnu As New ContextMenu()
Dim mnuitem As New MenuItem()
Dim mnuitem2 As New MenuItem()
'First
mnuitem.Text = "Exit"
AddHandler mnuitem.Click, AddressOf EndApp
mnu.MenuItems.Add(mnuitem)
'second
mnuitem2.Text = "Login"
AddHandler mnuitem2.Click, AddressOf LoginApp
mnu.MenuItems.Add(mnuitem2)
systray.ContextMenu = mnu
systray.Icon = New Icon(Application.StartupPath & "\systray.ico")
systray.Visible = True
Application.Run()
'try to access the form
Form123.staticmethod()
End Sub
Private Sub LoginApp(ByVal sender As Object, ByVal e As EventArgs)
systray.Visible = True
Dim frmchklogininstance As New frmLogin()
frmchklogininstance.Show()
'try to access the form
Form123.staticmethod()
End Sub
End Module
Public Sub Main()
'try to access the form
Form123.staticmethod()
End Sub
End Module
Public Class Form123
Inherits vbAccelerator.Components.HotKey.HotKeyForm
Shared Sub staticmethod()
MessageBox.Show("hello")
End Sub
Public Sub Form123_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'ideally i would like to hit this sub
' MessageBox.Show("hello")
End Sub
End Class
|
|
|
|
|
hi all,
i got a problem here about session, i am trying to store IDs into a session for anyone who opens our website, in other words, i am going to give every visitor (no matter registered or not) of our website an ID, and store those IDs into a session, and finally put those IDs and all items the visitor want to purchase into a seperate table in the database.
urgent!!looking forward ur reply!!!
thanks
Jackie Ding
|
|
|
|
|
Sounds like an ASP.NET question. Which bit is causing you grief ? What do you mean by 'seperate table', you want a table per user, including anonymous ones, or a table per session ? Either idea is a bad one, BTW.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi christina,
i am doing a shopping cart project using vs.net 2005.
Each of our product is made of several images, and we have to store all the information of the product(including several imageUrls, and background color,etc), so that even unlogged in persons can view our products,and put some products into the shopping cart. i was told by a nice person that i could store those information into a seperate table, and then when they decided to pay, they have to login, and then those information would be put into the orders database.
But now, i have a problem to store those information into a seperate, i was thinking give each visitor who opens our website an id, and assign all ids into a session, then i could store information into the table which has those ids as primary key. At last, if the visitor logs in, i can put information from the table to the "orders" table.
i wrote codes like this,but i am not sure whether it is right, it seems doesn't work....
Session("sessionid") = Request.Cookies.Get("CookieName")
so please give me some suggestionS???
thank u very very much!!!!!
Jackie Ding
|
|
|
|
|
JackieWill wrote: i was told by a nice person that i could store those information into a seperate table, and then when they decided to pay, they have to login, and then those information would be put into the orders database.
OK, you can have a table that stores all shopping cart info, that is true. But not a table per user.
JackieWill wrote: i was thinking give each visitor who opens our website an id, and assign all ids into a session
Each user HAS an ID, the session ID.
JackieWill wrote: Session("sessionid") = Request.Cookies.Get("CookieName")
You're copying data from a cookie to the session. Where does the data come from initially ? You can store the info in the session directly, you don't need to use cookies as well, unless you want the order to persist across uses of the site. Then, you do need to use cookies.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
so this is a webpage using ASP.NET, correct? If so you want to use sessions try: Session.Add("name", value) and refer to it by Session.Item("name"). This line: "i am doing a shopping cart project using vs.net 2005." kind of makes me think you're creating a windows project, but your scenario sounds to me like a webpage. If it is a winapp, post back and go from there.
Big Pimpin, Spendin Gs
Nate Lindley, .NET Aficionado
|
|
|
|
|
i want to change the data grid background color which the default is grey color. when i print the data out the grey color will print out too so it will look like the data was inside the box... how can i change it??
i didnt found the function for it in the properties.
I'm using vb6
|
|
|
|
|
Hi,
i have three questions about own usercontrols:
1.) How can i include this menu with the most impartant settings for my usercontrol (The small arrow at the top right corner, e.g. on TabControl)
2.) How can i define objects to be visible only in the designing-mode. I want to show a TabControl in designing mode and while running there should only be the single Panels.
3.) How can i provide an own window for these typical items-property. E.g. when you click on the "..." button in the property-window you can see such one.
If there are any language mistakes i'm sorry about... my english isn't the best
schachmat
|
|
|
|
|
1 - not sure what you mean. You can expose properties to the designer, in fact, I thought you have to suppress them, or they are all shown.
2 - There's a DesignMode property ( I could have the name wrong ) which could be used to write code to render only in the designer.
3 - I don't know what you mean. A pop up window ? Define it as a form and use it within the control.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks for the answer, i uploaded some screenshots:
1.) http://img113.imageshack.us/img113/6743/09192006233321os7.jpg
2.) Where and how can i activate this DesignMode?
3.) http://img20.imageshack.us/img20/7590/09192006233639iw8.jpg This window appears, when you click on the "..." button in the property window. e.g. on DataGridView.Columns. I want to know how to define a property to show such a (selfdesigned?) window.
schachmat
|
|
|
|
|
1 - Oh, you want that pop up in design mode ? I imagine there's an attribute you can use to expose properties that way
2 - It's built in. Just have your controls OnPaint check for it, and draw depending on it
3 - Oh, OK, you're worried entirely about making your control work in the design mode. I'm not sure, I prefer to write code I'd recommend looking into MSDN for more info.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
1.) Yes i thought so too, but didn't find the name and values for this attribute
2.) Ok, Thanks i found it XD
3.) I've allready searched for 2 hours.... But ok, i'll search two other ones now
|
|
|
|
|
On 3. If the property is a subclass of CollectionBase, on the designer you should be able to have the elipse (...) button show up, and popup a property dialog where you can add/update/remove items (similar to tab control - tab pages).
If you want more customized dialog, you may need to use TypeEditor (hope I remember the name correctly).
You may want to look at this to see how to persist the items that are added on designer:
http://www.codeproject.com/csharp/dzcollectioneditor.asp
|
|
|
|