|
Yes! Any .DLL you load becomes a part of your code, not a seperate process. This is a curious question, because throughout all coding, if your code creates or loads something, your code is also responsible for managing and destroying that something properly.
Making the assumption that an object or runtime can clean itself up without you telling it to do so is a very bad thing to do. This practice leads to unstable applications and operating systems. For instance, if you application creates a Graphics object, you are also responsible for destroying it when your done with it. If not, you'll eventually run the system out of resources and crash the whole operating system.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I need to call Outlook Compose mail box, By inserting subject and mail Id and show it to the user.
I can make it up to calling the outlook.exe but cannot call compose mail box directly.
Please help...
Jats
|
|
|
|
|
I'm not an expert but I use this:
<code>
Dim oOutlook As New Outlook.Application
Dim oMailitem As Outlook.MailItem
Dim oAttach As Outlook.Attachment
oMailitem = CType(oOutlook.CreateItem(Outlook.OlItemType.olMailItem), Outlook.MailItem)
oMailitem.To = "Jack <jack@isp.co.za>"
oMailitem.Subject = "Your Subject "
oMailitem.Body = "Hello, "
oMailitem.Display()
'oMailitem.Send()
</code>
I take it you already have references to Outlook.
Hope it helps
|
|
|
|
|
Thankx a lot for your help!!!
The code is perfect...i did it before but missed a line
Can you please tell me how to add multiple lines in the body, One line after the other, should i use some thing like or \n.
Jats
|
|
|
|
|
Hi dont mind i got it.
Thankx again!!!
Jats
|
|
|
|
|
hi jats use following code
pass required argument to following function
Function MailComponent(ByVal mailTo As String, ByVal cc As String, ByVal Bcc As String, ByVal subject As String,byval bodyofMessage as string)
Dim str, body As String
str = ""
If bodyofMessage Is Nothing Then
body = bodyofMessage
End If
If cc Is Nothing Then
cc = ""
End If
If Bcc Is Nothing Then
Bcc = ""
End If
If subject Is Nothing Then
subject = ""
End If
'string builder used for concatination
Dim MsgBuilder As New System.Text.StringBuilder
MsgBuilder.Append("mailto:" & mailTo)
If Not cc.Trim = "" Then
MsgBuilder.Append("&cc=" & cc)
End If
If Not Bcc.Trim = "" Then
MsgBuilder.Append("&bcc=" & Bcc)
End If
If Not subject.Trim = "" Then
MsgBuilder.Append("&subject=" & subject)
End If
If Not Body.Trim = "" Then
MsgBuilder.Append("&body=" & Body)
End If
If Not Attachment.Trim = "" Then
MsgBuilder.Append("&Attach=" & Attachment)
End If
'Debug.WriteLine(MsgBuilder.ToString)
ExecuteFile(MsgBuilder.ToString)
End Function
Function ExecuteFile(ByVal FileName As String) As Boolean
Dim myProcess As New Process
myProcess.StartInfo.FileName = FileName
myProcess.StartInfo.UseShellExecute = True
myProcess.StartInfo.RedirectStandardOutput = False
myProcess.Start()
myProcess.Dispose()
End Function
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Thankx for the help, i got it.
Jats
|
|
|
|
|
Hi
I need very urgent this requirement
i have tio implement in my project
I have implemented httpwebrequest through access the web pages
I want to login to home page using webrequest. it successfully logged into the site but it is unable to showing in web browser , it says session expired.
just see below example if have any solution give me reply
very urgent plz........................
thxadvance
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim query As String = "email=sams@sdd.com&password=regards &commit=Login&loginType=emp"
Dim url2 As String = "sourceurl"
Dim url3 As String = "target / home page url"
Dim src As String = ""
src = readHtmlPage(url2, query, url3)
src = getpage(url3)
WebBrowser1.Navigate(url3)
End Sub
Public Function getpage(ByVal strurl As String) As String
Dim responseData As String = ""
Dim responseReader As StreamReader
Try
webRequest1 = WebRequest.Create(strurl)
webRequest1.Timeout = 30000
webRequest1.Method = "GET"
responseReader = New StreamReader(webRequest1.GetResponse.GetResponseStream)
responseData = responseReader.ReadToEnd
responseReader.Close()
Catch ex As Exception
MessageBox.Show(ex.Message.ToString, "vcv", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
Return responseData
End Function
Function readHtmlPage(ByVal url As String, ByVal strpost As String, ByVal url1 As String) As String
Dim result As String = ""
Dim myWriter As StreamWriter
Dim objRequest As HttpWebRequest = WebRequest.Create(url)
objRequest.Method = "POST"
objRequest.ContentLength = strpost.Length
objRequest.ContentType = "application/x-www-form-urlencoded"
objRequest.CookieContainer = New CookieContainer
Try
myWriter = New StreamWriter(objRequest.GetRequestStream())
myWriter.Write(strpost)
Catch e As Exception
Return e.Message
Finally
myWriter.Close()
End Try
Dim objResponse As HttpWebResponse = objRequest.GetResponse()
Dim sr As StreamReader
sr = New StreamReader(objResponse.GetResponseStream())
result = sr.ReadToEnd()
WebBrowser1.Navigate(url1)
sr.Close()
Return result
End Function
|
|
|
|
|
Hi
How do you overwrite bytes in a certain position in a file in VB.Net/VS2003.
|
|
|
|
|
This is covered by the FileStream[^] class. You usually open the file, Seek to the position you want to overwrite, then Write the new data.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
What type of file is this? If it is text, you dont have a choice but to read out the whole file, change the characters that you want to, and write it all out again.
|
|
|
|
|
Hi
It is a midi file...
The header is mixed as follows:
A 4-byte chunk type (ascii)
A 4-byte length (32 bits, msb first)
length bytes of data
(I will only be able to check if you reply in the morning)
|
|
|
|
|
RichardBerry wrote: It is a midi file...
The header is mixed as follows:
A 4-byte chunk type (ascii)
A 4-byte length (32 bits, msb first)
length bytes of data
In that case, please look at Dave's suggestion above.
Keep in mind that the number of bytes you want to write should match the number you are overwriting, though
|
|
|
|
|
hi everybody,
i want to call a function from c++ dll. previously it was working fine. but now i have added unicode support to it. it works fine if _UNICODE is not defined in c++ dll. but if i define _UNICODE it gives error that Can't find DLL entry point . what i am missing.
Thanx in advance.
|
|
|
|
|
Without seeing your function header, it's impossible to tell. You might want to ask this question in the C++ forums.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hi
How do you rename a file in vb.net?
(I don't ewant to open the file and Save it as osmething else - just rename)
|
|
|
|
|
Try this:
Imports System.IO
File.Move(oldfilename, newfilename)
NOTE you need to include the path in the filenames above.
Hope that helps.
Ben
|
|
|
|
|
Works perfectly - Thanks!!!
|
|
|
|
|
Hello All,
Can I use declare API function in vbscript file and use that function via wrapper function
Develop2Program & Program2Develop
|
|
|
|
|
No. VBScript, thankfully, has no facility to call the Win32 API directly. You'll have to write a COM wrapper around the functions you want to use, using either VB.NET or VB6, or whatever else you want, exposing methods and properties to manipulate the data you want. You can then instantiate that class using CreateObject in VBScript.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Dave Kreskowiak wrote: No. VBScript, thankfully, has no facility to call the Win32 API directly.
I don't agree. A COM wrapper to Win32 could be handy to have some fun scripting.
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.
|
|
|
|
|
CPallini wrote: I don't agree.
I sure as **** don't want someone having fun at my expense. I want to have fun at theirs!
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Dave Kreskowiak wrote: I sure as **** don't want someone having fun at my expense. I want to have fun at theirs!
I never asked you to build up such a wrapper...
BTW, Could you, please, build it for us?
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.
|
|
|
|
|
OK, now you're startin' to sound like your serious. You're creepin' me out man!
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
hello
how can i search for information that is in access and display it in datagrid
|
|
|
|