|
thanks
but i am dealing with a smtp using exchange 2007 this is why i am using CDO1.2.1
modified on Monday, October 20, 2008 9:39 AM
|
|
|
|
|
If you're connecting to Outlook (at client side) using CDO, the client must have both Outlook and CDO installed. I would guess that the non-working PC is missing the other one.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Hi,
When I use this internal function my program automatic create a folder for the use of the program. Thats fine, but it also create a subfolder with the version number. Is there a way to avoid the creation of the subfolder?
I use this code:
sFile = New IO.DirectoryInfo(Application.LocalUserAppDataPath).Parent.FullName
I use now the parent becourse I dont need that subfolder!
Jan
|
|
|
|
|
Your post is confusing. Try this method instead:
my.Computer.FileSystem.CreateDirectory(strYourDirectoryPathHere)
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
The way you suggest is create the folder yourself.
with Application.LocalUserAppDataPath the system automatic locate the correct place on the harddisk. On my PC it is:C:\Documents and Settings\UserLogin\Local Settings\Application Data
and then CompanyName\ ProductName\ ProductVersion
The variable sFile is of the type string. Later in the program I add the filename and I open that file with an xmlreader.
I know some (strange) persons who change the doc & set folder. So the program must also work for them
|
|
|
|
|
You can use Environment.GetFolderPath[^] to return the path to the Application Data folder. From there, you can create your own company and application subfolders and use that path as the root for your data. This is the same method Application.LocalUserAppDataPath uses as a base path to build the userdata\Company\Application\Version path that it returns to you.
Keep in mind that there are TWO app data paths. The one you're using returns the data path for non-roaming profile users. The Application.UserAppDataPath method returns the app data path for romaing profile users. Environment.GetFolderPath will also return those same paths, depending on which SpecialFolder enumeration value you use.
|
|
|
|
|
Thanks all.
I'll give this a try.
Jan
|
|
|
|
|
you could use:
my.Computer.FileSystem.GetDirectoryInfo(system.Windows.Forms.Application.LocalUserAppDataPath).Parent.FullName
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Good Morning!
I have a program developed in C, but the main application was made in Visual Basic. Is there any way of accessing C functions from Visual Basic?
My best regards.
|
|
|
|
|
ajorge2008 wrote: Is there any way of accessing C functions from Visual Basic?
Visual Basic or Visual Basic .NET ?
You need to export your C functions to a DLL. Use P-Invoke to access that in your .NET application.
|
|
|
|
|
Hello guys,
in my search for a solution integrating an ActiveX Object I received a code snippet for a class to convert the IPicture format first:
Private NotInheritable Class myClass
Inherits System.Windows.Forms.AxHost
Public Shared Shadows Function GetPictureFromIPicture(ByVal picture As Object) As Image
Return AxHost.GetPictureFromIPicture(picture)
End Function
End Class and I should use it like
Dim pic As Bitmap = MyClass.GetPictureFromIPicture(GflAxObj.GetPicture) The first trap I run into is that obviously VB requires "a private type to be within another type" (hope it's translated good enough from my german version that you understand what I mean). I have no idea what's meant and can't find any hints in the help files and internet...
Trying to make the class public VB tells me it would require a "sub...new" with reference to mybase.new and it's parameters. But this fails because I don't even know which parameters I might have to use.
One more: The last line in the code snippet "Dim pic as ..." refers to the ActiveXObject as "GflAxObj", but I can't see where it is defined. I'm afraid this would be one of the next traps.
Could someone please give me some guidance through this?
Thank you very much
Michael
|
|
|
|
|
First of all i'm sorry if there is already an answer to this question but I looked for approximately an hour and couldn't find one so i'm asking it.
I'm trying to create conditional logic which includes a "and or" statement but apparently it doesn't work. I was wondering if there is a way to do this or at least emulate it. The code is something like this If textbox1.text = Nothing And Checkbox1.Checked = True And Or Checkbox2.Checked = False Then... Thanks for any responses in advance.
modified 8-Sep-21 21:01pm.
|
|
|
|
|
Saying "and/or", if I understand it right, means "if any of them is true"; which means just the Or operator. I might be wrong, the Or in English language means either one of two is true but not both while the Or in Logic means either one of two is true but if both are true, it's ok.
English Or (known in programming as XOr )
flase or false => false
flase or true => true
true or false => true
true or true => false
Logical Or
false or false => false
false or true => true
true or false => true
true or true => true
Eslam Afifi
|
|
|
|
|
You cant try it .
if (textbox1.text = Nothing And Checkbox1.Checked = True And Checkbox2.Checked = False) or (textbox1.text = Nothing And Checkbox1.Checked = True or Checkbox2.Checked = False)
Regard
Anubhava Dimri
Anubhava Dimri
|
|
|
|
|
Brian Wernick wrote: The code is something like this If textbox1.text = Nothing And Checkbox1.Checked = True And Or Checkbox2.Checked = False Then...
Not sure what you want the And OR to do. You could use something like:
If (String.IsNullOrEmpty(TextBox1.Text) AndAlso CheckBox1.Checked = True ORELSE CheckBox2.Checked = False) Then
ANDALSO and ORELSE allows the code to shortcircuit if the evals fail. Instead of checking if the textbox1.text = nothing, use string.IsNullOrEmpty which will check for both a null reference or empty string value.
If in doubt how your checks will evaluate to, put a break point on the line to pause execution. You can then break out the checks on at a time into the watch or immediate window to ensure your getting the results your expecting.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Hi,
I'm new to programming and thought that VB was an easy bus to hop on....
Currently I'm working through Visual Basic 2008 Step by Step.
And indeed, taking it step by step, I'll get there.
But for now I stand still.
I want to enable a button only when an user scrolled all the way down in a textbox.
I wanted to use the VScrollProperties of the scrollbar in the TextBox.
There are upper and lower limits wich gets or sets the range of the scrollbar, but I don't see how to use them as an Event Handler.
Carol
|
|
|
|
|
I do not believe their is an easy way to communicate with the scrollbar in the textbox. To do that you may have to resort to using WinAPI, however you might be able to monitor clicks in the control and see which lines are visible (if the last line is visible then the scrollbar is at the bottom).
If you look into the WinAPI, you would also look into the WndProc function of the textbox control.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
hai guys, i am using inet to upload a picture to imageshack.
but my code does not work. cant find the problem.
pls help
Private Sub Command1_Click()
Dim intFile As Integer '// Next available number for the Open statement
Dim ImageData As String '
Dim Body As String '// Body contents
Dim Header As String '
'// Get the image contents
imagepath = App.Path & "\" & "test.jpg" ' max 3mb image size limited
intFile = FreeFile
Open imagepath For Binary As #intFile
ImageData = String(LOF(intFile), Chr(0))
Get #intFile, , ImageData
Close #intFile
Body = "Content-Disposition: form-data; name=""fileupload""; filename=""" & vbCrLf
Body = Body & "Content-Type: multipart/form-data" & vbCrLf
Body = Body & vbCrLf & ImageData
Header = "Host: imageshack.us" & vbCrLf
Header = Header & "Content-Type: multipart/form-data & vbCrLf"
Header = Header & "Content-Length: " & Len(ImageData) & vbCrLf & vbCrLf
'upload now
Inet.Execute "http://www.imageshack.us", "POST", Body, Header
While Inet.StillExecuting
DoEvents
Wend
Dim s$, ret$
s = Inet.GetChunk(1024)
Do Until s = ""
ret = ret & s
s = Inet.GetChunk(1024)
Loop
'check upload completed
If InStr(1, ret, "Show Advanced Linking") > 0 Then MsgBox "upload completed"
End Sub
|
|
|
|
|
afridy wrote: my code does not work
This is not an adequate statement of a problem. I will be astonished if someone will audit your code for you.
You need to give us some idea of what the problem is and where it occurred.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
intFile = FreeFile 'where is FreeFile declared?
Header = Header & "Content-Type: multipart/form-data & vbCrLf" 'do you really want vbCrLf included in that string?
I got that far and gave up, what are you trying to do
|
|
|
|
|
thank you for the reply Eliotta,
freefile is a built in vb file i/o fuction right?
|
|
|
|
|
|
ok eliotta, i added the link in my prevous post to the original project i am referring to.
|
|
|
|
|
yah i am not sure about my header and body compilation.
i just copied that from a code and compilied.
let me give the url of that code i was referring to.
ill edit an append here the url to that code in a min.
<a href="http://planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=69883&lngWId=1">http:
|
|
|
|
|
When you use the DLLImport attribute to declare an API declaration there is a CharSet property that tells which version of the API call to use - Ansi, Unicode or CharSet.Auto in which case either the operating system or the language decides (for example C# defaults to ANSI for some reason).
How can I know which version was actually called if I specified CharSet.Auto? Any thoughts?
|
|
|
|