|
I thank you very much I work on it and I will check back with you.
|
|
|
|
|
Hi,
I thank you for your assistance. things work fine. I would like to improve in software development skills. Will you guide me on that? I would really appreciate that.
Also, if possible I like to estblish a technical correspondent with you.
Here my email: wnmichaud@yahoo.com
|
|
|
|
|
Hi,
I'm glad you're making progress.
I suggest you study by reading books and on-line articles (such as on the CP site), and ask questions in the appropriate forums here; that way you get fast and multiple replies, something no single person can offer. I'll typically will be one of the repliers in many of the CP forums.
PS 1: Publishing your e-mail address isn't a good idea, bots will catch it and send you spam.
PS 2: You can express your opinion about the replies by voting them up or down...; that helps in setting a person's reputation.
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 Luc,
I have another issue I like to tackle on.
I like to have a session log off on the said project we discussed.
If the user does not perform any click, let's say during 10 minutes , automatic log off, revert back to the login page.
Thanks,
|
|
|
|
|
Hi Waner,
I don't know the answer, however I trust a little Google action should provide a few ideas and perhaps code examples as well.
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.
|
|
|
|
|
You could use LEFT JOIN instead of INNER JOIN between the tables. Just rewrite the SQL query behind your view.
|
|
|
|
|
Hi I am new to Visual Basic programming, I am presently working in vb6..... I need to do the following operation.
I have a global variable, which is a flag. I have a timer which will set this flag after certain amount of time. I also have a function, which has a for loop. Inside this loop it will check whether the flag is set or not. If it is set it comes out of the loop or else it will do some operation for a certain number of times.
Is this possible in Visual Basic 6.0
I tried it but the timer is not waking up after its interval is reached or the Vb is hanging...
'''''''''''''''''''Code
Public g_TimeOut As Boolean
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Timer1_Timer()
g_TimeOut = True
Timer1.Enabled = False
End Sub
Private Function Testing(nCount As Integer) As Integer
Dim index As Integer
Dim flag As Boolean
flag = False
index = 0
For index = 0 To nCount
If (g_TimeOut = True) Then
Debug.Print "Got the signal from the timer so ending the counter"
flag = True
Exit For
Else
Debug.Print "Still Counting...." & index
Sleep 1000
End If
Next index
If (flag = True) Then
Debug.Print "Did not got the signal, still ending the counter."
End If
End Function
Private Sub Form_Load()
Timer1.Interval = 5000
Timer1.Enabled = True
Testing (10)
End Sub
modified on Wednesday, February 16, 2011 1:42 AM
|
|
|
|
|
My first thought was:
In your timer event -> timer1.enabled = false
this deactivates your timer
Now I tried what Aslam told you, and it works.
I cannot remember: What did I before google?
modified on Wednesday, February 16, 2011 3:47 AM
|
|
|
|
|
Vb is hanging?
Try this code:
For index = 0 To nCount
If (g_TimeOut = True) Then
Debug.Print "Got the signal from the timer so ending the counter"
flag = True
Exit For
Else
Debug.Print "Still Counting...." & index
DoEvents
Sleep 1000
End If
Next index
If nCount<5 then the timer is useless.
If (flag = True) Then
Debug.Print "Did not got the signal, still ending the counter."
End If
Here the condition: flag = True False. True means Got the signal.
|
|
|
|
|
If you're new to VB, abandon VB6 now before you learn too many bad habits. VB6 is dead and hasn't been supported by Microsoft for quite a long time.
Pickup VB.NET instead, or C#, and learn that. You can get the Express (Free) editions of VB.NET or C# here[^].
|
|
|
|
|
Thanks Aslam,Thomas,Dave
did not see that flag = True mistake(did a silly mistake), ya corrected it. Also after putting DoEvents its working now. But its entering the timer1 function 2 times. I am getting the output like this
Still Counting....0
Still Counting....1
Still Counting....2
Still Counting....3
Still Counting....4
Still Counting....5
Inside the Timer
Got the signal from the timer so ending the counter
Got the signal from the timer so ending the counter
Inside the Timer
@Dave - I need to do some enhancements to an already existing VB6 project. For that only I am trying this.
|
|
|
|
|
|
Why not converting your entire project into VB.NET?
You can do that by creating subsystems.
One by one convert them if you can’t convert entire system at once.
A lot of tools around the world to convert from 1 language to other.
Try this one:
vbconversions[^]
I found it useful.
|
|
|
|
|
This idea would be ok ... but there are two reasons why we didn´t:
1) The rest of the company only uses C#. So the .NET parts I have to write are in C# (which I like very much). If I only talk about VB.NET they scream "heresy".
2) Beside that, the code base I´m working on is quite large, and .... ugly (= evolved over more than 12 years, there were a lot of changes). Converting this to VB.NET would only result in having a big bunch of ugly .NET code. Not really better!
I cannot remember: What did I before google?
|
|
|
|
|
Here's a "technical" reason: Windows 8 won't support the VB6 runtime.
|
|
|
|
|
That would be nice: Than we will gain a lot of money to convert it
Can we be shure (Win8->noVB)?
I cannot remember: What did I before google?
|
|
|
|
|
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.
|
|
|
|