|
Yes, Microsoft has come out and said they will not support the VB6 runtime beyond Windows 7.
|
|
|
|
|
DoEvents is the devil. It may cause event handlers (that contain DoEvents calls) do become re-entered. If you think you need DoEvents, what you probably need is another thread.
And no I don't have VB examples.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Hi all,
I managed to add a RSS subscription to Outlook 2010 by code:
Private Sub addRSS_subscription()
Dim myApplication As New Outlook.Application
Dim feedUrl As String = "outlookfeed://www.nu.nl/feeds/rss/algemeen.rss%23"
Dim myMAPInameSpace As Outlook.NameSpace = myApplication.GetNamespace("MAPI")
Dim ImportRSS As Outlook.Folder
ImportRSS = myMAPInameSpace.OpenSharedFolder(feedUrl, "Nu.nl RSS", True, True)
End Sub
The thing I don't know how to handle, is to change the delivery location of added RSS subscription from RSS folder to my inbox.
Anyone know how to do this.
Kind regards.
|
|
|
|
|
I managed it by adding a rule to Outlook on the RSS folder by code.
Thanks!
|
|
|
|
|
Here is the problem :
- The application is in VB6.
- A dll provide services of computing.
- In the dll function, VB6 application provides a callback used by dll for progress of computing.
- For exemple, here is the prototype of dll function :
Public Declare Function NeuroComputerLearning Lib "NeuroComputer.dll" ( _
ByVal parameters As String, ByVal stepFunction As Long) As Integer
- Here is the VB6 function that dll has to call :
Function stepLearningFunction(ByVal step As Long, ByVal percent As Long) As Long
FrmMAIN.refreshLearning step, percent
stepLearningFunction = 0
End Function
- Here is the prototype in dll :
__declspec(dllexport) EnumError NeuroComputerTest(
LPSTR parameters,
void (*stepFunction) (LPSTR step));
- The call in VB6 is :
report% = NeuroComputerLearning(parameterFileName$, FnPtrToLong(AddressOf stepLearningFunction))
The dll success to call the "stepLearningFunction" that correctly do his job, but crash at the "return" of the call.
The popup message is :
"Run-time Checl Failure #0 - The value of ESP was not properly saved cross a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention."
How to solve this ?
Best regards.
|
|
|
|
|
Sorry, but I have already the answer.
This is done by a cast in the dll prototype.
We don't declare the call back with its own parameters, but as a long.
We do the cast after.
So :
EnumError NeuroComputerLearning(
LPSTR parameters,
long cbAddress ) {
typedef long (__stdcall *funCB)(long step, long percent, long requestAbort);
funCB stepFunction;
stepFunction = (funCB)cbAddress;
// and then we call the call back
if (stepFunction != NULL) stepFunction( theStep, thePercent);
And it runs perfectly.
I can too add a "abort" parameter that VB6 can fills during process if abort is required.
|
|
|
|
|
Dear all,
Here I attach my Visual Basic Code for Combo Box Control runs in Microsoft Excel Macro, but once the object is run and I click this object control the item will increase continuaously.
Wheather any of you who can asisst me solve this problem..?
Private Sub ComboBox1_Change()
ComboBox1.AddItem "SIDM"
ComboBox1.AddItem "BIJ"
ComboBox1.AddItem "M1D"
ComboBox1.AddItem "THERESA"
ComboBox1.AddItem "YS"
ComboBox1.AddItem "OPTION"
End Sub
Best Regards,
Ahmad Rifai Yusuf
|
|
|
|
|
I think you really need to think this one through. ComboBox Change event fires everytime there is a change to the contents of the ComboBox, and yet you are adding more items to the ComboBox every time it fires. This will set up a continuous loop, that will run forever. You need to fill the ComboBox only once, and then use the Change event to execute instructions against the selected item.
|
|
|
|
|
You either need to make this a once only event, a simple flag and IF THEN would do it, or reset the combo box each time.
Depending on what you need either is a valid option.
<br />
ComboBox1.Items.Clear() would do the trick.
Otherwise as I say just call the population once at the beginning.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC League Table Link
CCC Link[ ^]
|
|
|
|
|
Visual Basic Question?
'Please Modify this program to lock drive C: and D:
Private Sub Command1_Click()
Dim fs As New FileSystemObject
Dim f
Dim strPath As String
strPath = "C:\TestFolder"
Name strPath As strPath & "A"
Set f = fs.GetFolder(strPath & "A")
f.Attributes = -1
End Sub
Private Sub Command2_Click()
Dim fs As New FileSystemObject
Dim f
Dim strPath As String
strPath = "C:\TestFolder"
Set f = fs.GetFolder(strPath & "A")
f.Attributes = 0
Name strPath & "A" As strPath
End Sub
' It has two buttons in a form; lock folder and unlock folder
Please help
|
|
|
|
|
There is no code in here that will "lock" a folder on any drive. No one is going to write your code for you.
In order to help any further, you're going to have to define what you mean by "locking a folder".
|
|
|
|
|
Despite that you didn´t define what "lock" means - as Dave already mentioned - the 2nd question: Convert into what?
I cannot remember: What did I before google?
|
|
|
|
|
I'm trying to make a mail form in wpf/vb.net I havent found the problem in my code
Imports System.Net.Mail
Class MainWindow
Dim username As String
Dim password As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click
Dim mail As New MailMessage
mail.From = New MailAddress(txtFrom.Text)
mail.To.Add(txtTo.Text)
mail.Subject = txtSubject.Text
mail.Body = txtMessage.Text
Dim smtp As New SmtpClient("Smtp.gmail.com")
smtp.EnableSsl = True
smtp.Credentials = New System.Net.NetworkCredential(txtUsername.Text, PasswordBox1.Password)
smtp.Port = 465
smtp.Send(mail)
End Sub
End Class
I am new so any help would be good
Thanks
Frazzle the name say's it all
|
|
|
|
|
So what's the problem/error message?
|
|
|
|
|
Dave Kreskowiak wrote: So what's the problem/error message?
It just times out every time
I googled lol this sounds funny google mail host and port but it doesnt send the message to my account
Frazzle the name say's it all
|
|
|
|
|
You have to use port 587. Reading the documentation on the SmtpClient class states that:
An alternate connection method is where an SSL session is established up front before any protocol commands are sent. This connection method is sometimes called SMTP/SSL, SMTP over SSL, or SMTPS and by default uses port 465. This alternate connection method using SSL is not currently supported.i>
|
|
|
|
|
Thank You sir now I can hard wire it to send me log files in my apps
I wonder why google site search returned the wrong port.
Frazzle the name say's it all
modified on Tuesday, February 15, 2011 11:23 AM
|
|
|
|
|
Hi,
Does anyone knows how to export/extract/copy (or whatever is the right word) a file wich is added to the soulution, on the startup of a program, like somekind of installation?
cheers
|
|
|
|
|
Instead of start up, you can make it a part of installation process. This will then be just a one time action. This[^] might help.
|
|
|
|
|
In my company each user has a username based on their login name. For example, John Smith would have a user name of JSmith. However my program needs to retrieve the full name of the user. The System.Environment.UserName only return the login in name. However on all our computer when you click Ctrl-Alt-Del it comes up with a window that lets you lock the computer, start the task manager, etc. On this window though it shows the login information and it says "John Smith is logged on as MyCompany\jsmith" and has the time the user logged in. So I know the full user name is stored in some setting, but I don't know where or how to access it. Any help would be appreciated. Thanks in advance.
|
|
|
|
|
Use UserPrincipal.Current.DisplayName .
Further, this[^] article should be helpful to you (even though it is for C#).
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
Hi I am starting a new project that will be used by one user per copy. It will require a data store, upon witch many calculations will be required. My question is, What type of data source would You use for this type of app. I am "new to developing" so any input would be appreciated.
My first thought would be to use xml as a data source, what do You think?
If You think I am on the wrong track Please feel free to say what an idiot
BTW This will be My first data centric app.
Frazzle the name say's it all
|
|
|
|
|
Is the data to be shared by all copies of the program?
Is there likely to be more than a very small amount of data?
If the answer to either of those questions is yes then I would suggest that you would be better using one of the SQL variants. SQLExpress or SQL C.E..
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
|
|
|
|
|
The answer to the first question is no
And to the second Yes
(Sorry I don't know how to quote your message)
So the next question I have is what model should I use? EG. I would be using OO so would dao or enties?
BTW thank You for Your input!
Frazzle the name say's it all
|
|
|
|
|
frazzle-me wrote: (Sorry I don't know how to quote your message)
After you have hit the 'Reply' widget, select the text you want to quote from the original message and then hit the 'Quote Selected Text' button. (The big orange one )
If dao in your question means what it used to mean then it has been replaced by ADO.NET[^]. If you follow the links on that page, you will get a fairly good understanding of how it works.
The Entity Framework[^] can be a little complex, particularly if your database schema changes quite a lot during development. Once again if you follow the links on that page you will get to understand how it works.
For a first 'data centric' application I would probably tend toward ADO, but I am a conservative sort of person. If after you've had a play with both, you think you've got your head round Entities then go for that, otherwise use ADO.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
|
|
|
|