|
I have created one document in .html. I have one html file with its supportive file and developed player for its viewing in my vb application. I want lmy user should click on one button and my program should make one ProgramName.Exe file. I want to add files programmatically in setup.exe and wehn this will be installed on reader's system. This Setup.exe will install required components (which i add at the time of creation) automatically and my main page will open in my vb application which is actually a viewer of .html files.
Actually i want to know how to create .inf, .cab or setup.exe file thru VB.NET coding.
Please help me out.
Many Many thanx in advance.
Early action will be highly appreciated.
Manish Thouri
manishthouri@indiatimes.com
manishthouri@rediffmail.com
Manish Thouri
Software Professional
manishthouri@indiatimes.com
manishthouri@rediffmail.com
|
|
|
|
|
You'd have to write your own custom Setup.exe from scratch. Something that will parse up an .INF file (which is just a text file), and perform the actions described there in. How that file is layed out and what is in it is completely up to you, since your writing the .EXE that will interpret it.
Also, there are no native methods in the .NET BCL that work with creating .CAB files. These are built using as an external tool. BTW: Setup's using .INF and .CAB files have been deprecated for years now.
With a Setup that interprets a .INF, you don't have to recompile the Setup.exe every time you want to make a change to the installation. All you do is modify the .INF file that describes the setup process and update the .CAB file with the appropriate files.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The WebBrowser control can return a reference to the Office Document object.
See this[^] article for a look at how to do it. The code is in VB6, so you'll have to adapt it to VB.NET and your implementation of the WebBrowser control.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Rage,
Thanks for the article. However I am facing a roadblack when it comes to trying to access the properties of the oDocument object.
The following is my translation of the Vb 6.0 code.
Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
Dim OFD As New OpenFileDialog
Dim sFileName As String
'Find an office file...
With OFD
.FileName = ""
.Filter = "Microsoft Excel Files|*.xls"
.Title = "Select an Excel Document"
End With
If OFD.ShowDialog = DialogResult.OK Then
sFileName = OFD.FileName
oDocument = Nothing
Me.WBwr.Navigate(sFileName)
Me.URLCombo.Text = sFileName
End If
End Sub
- This enabled me to iniatilize the oDocument object to Nothing.
Then I wrote this code for the WebBrowser control
Private Sub WBwr_NavigateComplete2(ByVal sender As Object, ByVal e As AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Event) Handles WBwr.NavigateComplete2
'On Error Resume Next
MsgBox(sender.GetType.ToString)
oDocument = sender.Document
MsgBox("File opened by : " & oDocument.Application.Document)
End Sub
- In the article in place of "sender", pDisp was the object. When I tried seeing the properties of the sender object it showed me only one item i.e., GetType. I am not able to access the Document object property here when I could do it in VB 6.0. No matter how much I have tried I simply cant access the Document property.
Halp!!!!!!
vijaykri
|
|
|
|
|
vijaykri wrote:
When I tried seeing the properties of the sender object it showed me only one item i.e.,
You won't see anything in Intellisense because oDocument is bound to a generic Object type, sender . The only property your going to see in that case, is the method GetType(). The only way you're going to see the Excel object model in Intellisense is if you cast sender to a variable of type Excel.Application . But that would mean you have to set a reference to and import the Microsoft Excel Object Library for the version of Excel you have installed on the machine.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave,
Thanks for the Intellisense clue... I simply hardcoded a few lines without depending on the Intellisense feature. And voila it worked beautifully.
Following is a sample
Private Sub WBwr_NavigateComplete2(ByVal sender As Object, ByVal e As AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Event) Handles WBwr.NavigateComplete2
On Error Resume Next
oDocument = sender.Document
Dim s As String
s = oDocument.Application.Range("A3")
Dim oExcel As Excel.Application
Dim wbk As Object
wbk = oDocument
With wbk.ActiveSheet
'read
MsgBox(.Range("A3").Value)
End With ' wbk
wbk = Nothing
'MsgBox(CStr(oDocument.Application.Range("A4")))
'MsgBox("Value : " & oDocument.Application.Range("A3"))
End Sub
Thanks
You were of gr8 help
Vijay
vijaykri
|
|
|
|
|
hi
i am interested in programming a combination mp3 player / voice recorder for my pocket pc (using VB.NET). this is for an usual application (tape logging) and am having a hard time finding example source code for either a simple mp3 player or voice memo recorder.
if someone could point me in the right direction or send some sample source code to put me on the right track, it would be most appreciated.
thanks
|
|
|
|
|
I just tried a search on Yahoo for "pocket pc audio record", and came up with a bunch of stuff for audio playback and record. You'll have a lot of reading to do though. It's not as easy as it would sound.
Yahoo results[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Iam making a BooksFairGuide and i was thinking of using a XML Schema and XML file as a small database to store the data into but i didn't know exactly how to do that and then i thought if i can make the XML file store that data then i can extract it into SQL database later but the problem is how can i make the program when i hit the add button save the data into the XML file
"Open Source" Millions of free minds can't be wrong
|
|
|
|
|
You'd have to load you XML database into a dataset first. Then you can use that dataset as your database while you application is running. Then, when you app exists, or your user clicks "Save", you can write out the dataset back to the XML file. So long as you keep your database small, this won't be a problem. But if your database starts to get big, it will just take longer and longer to make any updates to the dataset.
You can start by checking out this[^] article on MSDN, along with this[^] one. And if your reall yin the modd to learn how Datasets, ADO.NET, and XML work, start reading this[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm trying to import files with a strange format into a treeview. Here is a look at the file format:
EZ Keys Instant Phrase File
0.90c Beta Test
Words+ File
Conversation
.Control
..Please wait until I finish what I'm trying to say.
..Would you mind if I talk while you're interrupting?
..Excuse me. May I say something?
..Please let me finish.
..I have something to say about that.
.Agreement
..That's true
..I agree with that
..You're right about that
..Right on!
..I think that's correct
.Disagreement
..I don't agree with that
..No way!
..That's not true
..You're wrong about that
.Greetings
..New person
...Hello. How are you?
...I'm fine, thanks.
...I'm very pleased to meet you
...I'm doing well, thank you.
..Someone I know
...Hi. How have you been?
...What have you been up to?
...I'm fine, thanks.
...I'm doing well, thank you.
...Yo, bro. Whussup!
...What's happening?
...How have you been?
.Closings
..New person
...It's been a pleasure meeting you
...I hope to see you again
...I'm so glad I got to meet you
..Someone I know
...Goodbye!
...So long!
...See you later!
.Opinions
..What did you think about that?
..What did he or she think about that?
..You know what I think?
..I think that's OK.
..I think that's good.
..I don't think that's right.
..I think that's bad.
.Social
..Weekend
...Your weekend
....Did you have a good weekend?
....How was your weekend?
....What did you do on the weekend?
...My weekend
....I had a great weekend.
....I had a lousy weekend.
....I went somewhere special on the weekend.
...Next weekend
....What are you doing next weekend?
....I have plans for next weekend.
....I'm going somewhere special next weekend.
.Subject
..Let's change the subject.
..I don't want to talk about that right now.
..Please don't change the subject.
..It's a touch subject.
.Talk
..Openers
...I'd like to talk to you about something.
...Can we talk?
...I have something to say about that.
...We need to talk.
...I really need to talk with you.
.Questions about you
..Name, age, etc.
...What is your name?
...How old are you?
..Home, family
...Do you have any brothers and sisters?
...Where do you live?
..School
...What grade are you in?
...Where do you go to school?
...Who is your favorite teacher?
..Work
...Do you like that kind of work?
...How long have you been doing that?
...Where do you work?
Responses
.Absolutely not
.Certainly
.I'm sorry
.Not!
.No, thank you
.Thank you
.Thank you very much
.Yes, please
Exclamations
.Buzz off!
.Cowabunga, dude!
.Don't have a cow, man
.Get outa here!
.Good grief!
.Leave me alone!
Insults
.Integrity
..I wouldn't trust that person.
..What a slime!
..That person is not very honest.
.Intelligence
..If brains were gunpowder, you wouldn't have enough to blow your nose.
..If you had a brain, it would be like a BB in a boxcar.
.Looks
..I've seen prettier faces on alligators.
..Someone must have hit you with an ugly stick.
.Manners
..What a slob!
..I've seen pigs with better manners.
Interests
.Music
..I like to listen to music.
..I enjoy almost all kind of music.
.Sports
..General sports
...Do you like any kinds of sports?
...I like a lot of sports.
..Basketball
...Who is your favorite basketball team?
...Who is your favorite basketball player?
..Football
Knowing
.I'm not sure I want to know.
.Do I need to know that?
.How do you know that's true?
Likes and dislikes
.Likes
..Food
...Breads
....I like most kinds of bread.
....I like biscuits.
....I like good yeast rolls.
....I like toasted bagels.
...Candy
....I really like chocolate.
...I like pizza.
..Things
...I always liked that.
..People
...I like him.
...I like her.
...I like them.
...I always like him.
...I always like her.
...I always like them.
..Places
...I like that place.
...I always liked that place.
...I like to go there.
...I wish I could live there.
.Dislikes
..Food
...I don't like onions.
...I don't like mayonnaise.
..Things
...I never did like that.
..People
...I don't like him.
...I don't like her.
...I don't like them.
...I never liked him.
...I never liked her.
...I never liked them.
..Places
...I don't like that place.
...I never liked that place.
...I don't like to go there.
...I wouldn't want to live there.
This is
.This is fun!
.This is really boring.
.This is interesting.
.This is pretty bad.
.This is really bad.
.This is fantastic!
Here is the code I wrote:
<br />
Imports System.IO<br />
<br />
Public Class Import<br />
Public Function ImportEZK(ByVal Folder As String, ByRef Tree As TreeNodeCollection)<br />
Directory.SetCurrentDirectory(Folder)<br />
Dim Files As String()<br />
Files = Directory.GetFiles(Folder, "*.phr")<br />
<br />
For f As Byte = 0 To Files.GetUpperBound(0)<br />
Tree.Add(Files(f).Substring(Files(f).LastIndexOf("\") + 1, Files(f).Length _<br />
- Files(f).LastIndexOf("\") - 5))<br />
Dim Lines As ArrayList = FileProcessing.GetFile(Files(f))<br />
MakeTree(Tree(f), Lines.ToArray(GetType(String)), 3)<br />
Next<br />
End Function<br />
<br />
Private Sub MakeTree(ByRef MyTreeNode As TreeNode, ByVal Lines As String(), ByVal LineNum As Integer, _<br />
Optional ByVal Level As Integer = 0)<br />
If LineNum > Lines.GetUpperBound(0) Then Exit Sub<br />
Dim Cntr As Integer = 0<br />
Dim Line As String = Lines(LineNum)<br />
Dim c As Char = Line.Substring(Cntr, 1)<br />
Do While c = "."<br />
Cntr += 1<br />
c = Line.Substring(Cntr, 1)<br />
Loop<br />
Select Case Cntr<br />
Case Is < Level<br />
Dim NewNode As TreeNode = MyTreeNode, x As Integer<br />
For x = 1 To Level - Cntr<br />
NewNode = NewNode.Parent<br />
Next<br />
NewNode.Nodes.Add(Line.Substring(Cntr, Line.Length - Cntr))<br />
MakeTree(NewNode, Lines, LineNum + 1, Level - x)<br />
Case Level<br />
MyTreeNode.Nodes.Add(Line.Substring(Cntr, Line.Length - Cntr))<br />
MakeTree(MyTreeNode, Lines, LineNum + 1, Level)<br />
Case Level + 1<br />
MyTreeNode.Nodes(MyTreeNode.Nodes.Count - 1).Nodes.Add(Line.Substring(Cntr, Line.Length - Cntr))<br />
MakeTree(MyTreeNode.Nodes(MyTreeNode.Nodes.Count - 1), Lines, LineNum + 1, Level + 1)<br />
End Select<br />
End Sub<br />
End Class<br />
Two problems:
First, after it gets to the lower levels, it doesn't go back to the upper levels (Case Is < Level).
Second, it duplicates every file entry in reverse order, strange.
Like this:
CARS
FOOD
GENERAL
...
...
...
GENERAL
FOOD
CARS
I would appreciate any help.
Thanks!
|
|
|
|
|
I am getting the following compile error:
"value of type 'DataAccess.DataRequest' cannot be converted to 'DataAccess.DataRequest'"
This doesn't make any sense to me, as the types are exactly the same. Perhaps someone has some experience with this type of error. In this particular case I have 3 DLL's. A class in DLL #1 makes a call to another class in DLL #2 by passing as a parameter an object that comes from DLL #3 -- i.e. both DLL #1 & #2 reference DLL 3#.
IHere's some sample code that reproduces my problem. There is a Windows Form Project, a BusinessLayer DLL, a DataLayer DLL, and a MyObject DLL. The windows form references the BusinessLayer DLL and the BusinessLayer DLL references the DataLayer DLL. All of three reference the MyObject DLL. THis gives me the same compile error of not being able to convert the type -- it will however compile and run OK if I tell the compiler to continue. It doesn't seem to make any difference whether I have Option Strict on or off, or if I pass the parameter by Ref or Val.
Public Class Form1
Inherits System.Windows.Forms.Form
Dim oMyObject As New MyObject.MyObjectClass
#Region " Windows Form Designer generated code "
‘this is a simple windows form with a textbox “TextBox1” and a button “Button1”
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.Text = oMyObject.Name
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim oBusinessLayerObject As New BusinessLayer.BusinessLayerObject
oBusinessLayerObject.AlterObject(oMyObject)
TextBox1.Text = oMyObject.Name
End Sub
End Class
Namespace BusinessLayer
Public Class BusinessLayerObject
Public Sub AlterObject(ByVal oMyOBject As MyObject.MyObjectClass)
Dim oDataLayerObject As New DataLayer.DataLayerObject
Dim oMyObjectBL As New MyObject.MyObjectClass
oMyObjectBL = oMyOBject
oDataLayerObject.AlterObject(oMyObjectBL)
End Sub
End Class
End Namespace
Namespace DataLayer
Public Class DataLayerObject
Public Sub AlterObject(ByVal MyObject As MyObject.MyObjectClass)
MyObject.Name = MyObject.Name & " DataLayer Addition. "
End Sub
End Class
End Namespace
Namespace MyObject
Public Class MyObjectClass
Public Name As String = "Some Name"
End Class
End Namespace
Mark
|
|
|
|
|
I am working on the ftp client type application.
while uploading I can't not stop until finishing
downloading all files. Even I make a button to
stop I won't response until finish whatever my
program is doing what can I do?
shinay
|
|
|
|
|
You description is difficult to understand, but I think your trying to terminate your file upload/download before it completes on it own?
How that is done depends entirely on your implementation of the client transfer process. Without knowing anything about your code, it's impossible to tell you what to do...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I wonder how i can enable the frontpage extension for a domain name on IIS by coding.
I can't find any help from google about this.
I appreciate if you can help.
Thanks.
|
|
|
|
|
There are several methods for administering IIS using code. The documentation on such methods starts here[^].
For a jump start, you can try using the System.Management namespace and WMI. Check this[^] article on MSDN. You'll have to covert the code from VBScript to VB.NET though.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm hesitating on changing Platform from VS6 to VS.Net. Would you
please to tell me what's the prospect of MMC in Microsoft .NET plan?
There's an MMC Snap-in designer for VB 6.0 ,and is there a designer for
VB.NET? Does Microsoft have anything to substitute for MMC in .NET
platform or something in the future?
|
|
|
|
|
Without more specifics on what you're using MMC for, it would be hard for me to provide you with anything more than general items I've come across.
There's a Console class in the System namespace.
I found a C# library for MMC on SourceForge
https://sourceforge.net/projects/mmclibrary/
There are some resources on this site:
http://codeproject.com/csharp/MMCFileActCs.asp
http://www.codeguru.com/Cpp/W-P/system/mmcsnapins/article.php/c5779/
The Microsoft .NET Framework SDK tools are designed to make it easier for you to create, deploy, and manage applications and components that target the .NET Framework. This section contains detailed information about the tools.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpconNETFrameworkTools.asp
Still coaxing software out of the can after all these years...
|
|
|
|
|
I am working on the OfficeAddin(IDTExtensibility2)
and wanting to find out how to enable and disable
toolbar button when user save document
So perfect solution will be if there is
an event when user saves, otherwise
an event that always listening all the thing
you are doing just like PreTranslateMessage
in VC
I hope some has idea about this
van
|
|
|
|
|
I could do this in VBA, but I'm not certain how it would translate into VB.NET
Still coaxing software out of the can after all these years...
|
|
|
|
|
can you tell me how to do this VBA.
I might get hint out of it.
Thanks
|
|
|
|
|
There's a couple ideas I can throw your way, they come from the Microsoft Word MVP website under FAQ's VBA
http://word.mvps.org/
http://word.mvps.org/FAQs/MacrosVBA/AddMenu.htm
http://word.mvps.org/FAQs/MacrosVBA/LaunchExeFromToolbar.htm
http://word.mvps.org/FAQs/MacrosVBA/AttachMacroToButton.htm
I assume you are familiar with adding MS Office references into your projects. Once you've added the specific interop you want to work with, poke around there in the object browser. I was able to figure out a number of options and commands by doing so.
Still coaxing software out of the can after all these years...
|
|
|
|
|
Hallo guys...I've got a question for u.
How can we add new action on file menu when we do right click in that file?Like WinZip.When we do right click file .zip, we can see there's some actions like unzip,extract,or extract to..
Thanks for reply me..
|
|
|
|
|
HKEY_CLASSES_ROOT\exefile\shell\YourAppName\command\
YourAppName: this is what you are going to see in your right click menu.
command: you specify the path to your app exe probably with %1
For example if you have app called myapp.exe in C:\ and want to display
"start my app" on the right click menu
you said
HKEY_CLASSES_ROOT\exefile\shell\start my app\command\
in side of command you have
"C:\myapp.exe %l"l is not the number but alphabet 'L'
Just for your info
if you add the right click menu on directory
this is the place to add the same thing
HKEY_CLASSES_ROOT\Directory\shell\start my app\Command
Good Luck!
|
|
|
|
|
Thanks again for ur reply but...I still confuse.
How can we know that file,for example .zip,has been unziped or extract?Because u dont give any value for that things.
And..how can we do unzip and extract directly from that file menu?Is there any commands that might be added to your sample command(HKEY_CLASSES_ROOT\exefile\shell\start my app\command\"C:\myapp.exe %l"l )that will call to the function(ex:extract/unzip) on program(winzip)?
|
|
|
|