|
I dont have a option, I have to do it in VB6.
Please help if you knw how to.
Thanks,
Karthick.M
|
|
|
|
|
There is no native option to doing this in VB6 or VB.NET.
You have to use the Win32 function SetParent to tell the main window of the app that it's new parent is the window handle to your form other other hosting control. Google for "VB6 SetParent" for examples.
Be warned. Some applications have rendering problems when doing this and you user gets to move the application around just as if it was running on the desktop. They also get to close the app any time they want. You cannot prevent these things from happening.
|
|
|
|
|
hey
This is for outlook vba for loading a ref at outlook
Whit this you can load a reference in it whitout any manual input the only thing you need
= a refernce to let vbe work
so this is no solution if you only whant to load 1 reference
Application.VBE.ActiveVBProject.References.AddFromFile "C:\WINDOWS\system32\redemption.dll"
is there a other way at vba
or a way true c#.net or vb.net to load a ref en set active in outlook
thanks
|
|
|
|
|
There's no such thing as "setting a reference to active". And what you're doing is the only way to do it in VBA.
neverpleat wrote: or a way true c#.net or vb.net to load a ref en set active in outlook
I don't understand what you're asking. Are you asking if there is an equivilent method to doing this in C# or VB.NET?
|
|
|
|
|
Yes
if i can force this with c#.net from outside outlook
Thanks
|
|
|
|
|
Your answer isn't very complete.
You have an external application that wants to add a reference in a VBA project that's running in Outlook already?
C# has no direct equivilent. You'd have to do it the same way as you do it in the project, by calling the method on the VBE object you get in Outlook. Don't ask for examples - I don't have any. You'd have to Google for something.
|
|
|
|
|
hi
- i have outlook installed but not running
- i have written a application in c#
- i have some vba code that runs at outlook but need a reference
question 1
is there a way to let on the first run from my application to insert the reference in outlook ?
and just maby it can be done by the registry ?
Question 2
if question 1 yes
is there a way to let on the first run from my application to insert the vba code in outlook ?
-------------------------------------
i now how to check if it's the first run or not
google don't now , yet
thanksmodified on Thursday, March 4, 2010 10:21 AM
|
|
|
|
|
Why are you even setting the reference? Do you have some object that is changed out frequently that this reference is loading?
What is the reference to?
|
|
|
|
|
i realy need to have redemption.dll in the reference
and it's a easy way from doing this if i can program this ,then at next install of pc i don't need to remember that i need that reference to set on
and i'am sure it can be done the only way = how that's the question 
|
|
|
|
|
If all you're doing is trying to reinstall an Outlook VBA project if you reload your machine, the reference is saved with the project. You just need to put the project file back. Just search your user profile folder for "vbaproject.otm" and back the file up. When you reload your machine, put the file back where you found it.
|
|
|
|
|
can i force this with c#.net from outside outlook
|
|
|
|
|
I already told you, you have to invoke the method on object in VBA. You cannot get that object directly from C#.
Get an instance of the Outlook Application, then you can navigate down to where that method is. No, I don't have any examples, because I already said that i don't do Office Interop.
|
|
|
|
|
How can I add a feature of grid computing in my software whereby I can provide the computing power of my PC for grid computing. (Chat software - Digsby has done it very nicely) I want to implement a similar feature in my application.
Any ideas How to do it in visual basic
|
|
|
|
|
ssonby wrote: How can I add a feature of grid computing in my software
Let me get this straight. Are you thinking that you can just throw this kind of support into your app by making a few changes to your code, maybe a little rewrite here and there? Correct?
Look into Digipede[^], BOINC[^], as well as others, and do some Googling on the subject first. Your choice of library will be determined by each vendor's product capabilities and your requirements.
...and NO. This NOT something you can just throw into your application at the last minute as an afterthought. This is something your application has to be designed around from day 1.
|
|
|
|
|
Hi,
I have a folder structure where I create two folders under
->Test Scripts
->Test Case (Contains .HTML)
->Test Models (Contians .GML)
I am Using VB6,I am able to see All the folders and files except the .gml files in the UI Form.
When I checked the folder manually the .gml file is present.
Can Anyone help in displaying .gml files in a folder structure of a Form.
Thanks,
Karthick.M
|
|
|
|
|
Without knowing how your code is getting the list of files, it's pretty much impossible to tell you want is going wrong.
I'm just asking this question to help someone else who may help you in using VB6. I'm not one of those people.
|
|
|
|
|
What are the attributes of the .gml files? if they are hidden/system etc. they not be showing up unless you set that as an explicit option of the DIR() function?
As Dave says, post some code you are using to look at the files.
|
|
|
|
|
Hi,
Thanks for your feedback,I got this resolved. I had previously restricted the user to open only .xls,text,html files. Now I added this .gml to this option and it is working fine.
Thanks,
Karthick.M
|
|
|
|
|
Hi experts,
How do i go about splitting a texbox with lots of information in it to lots of little ones.
Initially what i want to do is perform a sort on a textbox thus having to split the textbox up to perform the sort.
The textboxe is for a high score game so if someone does well they have the option of putting their name and the program will show the high score to everyone at the end.
Is there any easy way to do this then having to split up the textbox, bearing in mind that the names vary from length to length - e.g dan to Patrick....
Many thanks
Dan
|
|
|
|
|
I would presume you would hold all the scores in an array, sorted by value each time a new score is added.
Then show, say the top ten in the immediate text box by just filling in the top ten values from the array.
I would use a Form if you wished to show all scores (or top 1000 or whatever).------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
You really should be more object oriented about all this. In Your backend you should create a User class that exposes 2 properties, Name and High Score. Let your class implement the IComparable interface, and in the CompareTo function just compare the high scores. In your Front End you can create a list of as many users as you think sufficient, call list.Sort(), and use an Object DataSource to bind to a listbox (or Textboxes if you must) displaying the list in order.
|
|
|
|
|
I agree with zimvbcoder, you need a more structured approach. I suggest you create a Player class holding all relevant information; and a List<Player> holding your hall of fame. Then you can sort it; maybe this[^] will interest you.
BTW: I would consider using a ListBox (with OwnerDraw mode) rather than a TextBox.
|
|
|
|
|
Hi Luc, sorry it's off topic a bit, but I just wanted to say thanks for that article. It helped me through some problems I had a while back in implementing the IComparable Interface. Taught me all I know on the topic to be precise. Many Thanks.
|
|
|
|
|
I'm glad you liked it.
|
|
|
|
|
Hello,
I'am developing an App that needs to access a SqlDataBase named "Work", but this may be located in any drive of my system (C:,D:,U:,...). The database structure is always the same, so I use a unique name and only change the files.
When the application start, I use a OpenFileDialog to locate the database and execute an storedprocedure to attach the database to SqlServer (EXEC sp_attach_db @dbname ...).
This works fine, and I can work with the database.
When the user ends to work with database, I want to detach ("EXEC sp_detach_db) this from my App to allow to choose another location one.
At this point I get an error reporting that the database is currently in use, ans so, it can't be detached.
StoredProcedures form attach and detach owns to Master database, so when I execute it I'am not using my database.
Do you know any procedure to disconnect my App from database using system.data, and then I could execute the detach procedure ?
(If I only execute Attach and Detach, without accessing to database, is runs fine).
Here the Detach function:
Public Function DetachDB(ByVal DbName As String) As Boolean
Dim Cmd As New SqlClient.SqlCommand
Dim AffectedRows As Int32
Dim TmpDbName As String = _DbName
_DbName = "Master"
Cmd.Connection = GetConnection
Cmd.CommandText = "EXEC sp_detach_db @dbname = '" & DbName & "'"
Cmd.CommandType = CommandType.Text
Cmd.Connection.Open()
Try
AffectedRows = Cmd.ExecuteNonQuery()
Cmd.Connection.Close()
_DbName = TmpDbName
Return (True)
Catch e As Exception
If PopupErrors Then
MessageBox.Show("[DB]Error separando la base de datos " + e.Message)
End If
Cmd.Connection.Close()
_DbName = TmpDbName
Return False
Exit Function
End Try
End Function
|
|
|
|