|
yes i want keyboard hook but in VB6.0
|
|
|
|
|
According to google[^], there's plenty of info available.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hiya all, I'm unsure whether to place the question here or in asp.net, but opted for here seeing as I use VB.Net as codebehind.
I'm trying to meassure how long time two differnet segments of code uses to excute, approximately - it is only for comparing and personal interest.
However - I end up with results which I just can't seem to accept as being correct.
What I do is use "ticks" at start and end and subtract the two, thinking this would give me the time in ticks between the two... like this:
dim longStart, longEnd as long
dim doubleDiff as double
doubleDiff = 0
longStart = DateTime.Now.Ticks
For intCounter As Integer = 0 To 24999
Next
longEnd = DateTime.Now.Ticks
doubleDiff = longEnd - longStart
doubleDiff = doubleDiff / TimeSpan.TicksPerMillisecond
longStart = DateTime.Now.Ticks
For intCounter As Integer = 0 To 24999
Next
longEnd = DateTime.Now.Ticks
doubleDiff = longEnd - longStart
doubleDiff = doubleDiff / TimeSpan.TicksPerMillisecond
However - this presents me with some odd result. Sometimes the former code segment displays as 0. Sometimes the second codesegment presents as one number and sometimes as that number plus what the first codesegment has displayed as.
So if I for instance get 15.12 as result for segment one, then I will often get X or X+15.12 for the second segment on subsequent runs. X often also is the result of first segment of code multipled with 10 which leads me for sure to belive something is going on which shouldn't be.
I am doing something terrible wrong, but I don't know what - it should be pretty straight forward...
Anybody got some advice for me, or can smack me on the head so I find out what is wrong
---------------------------
127.0.0.1 - Sweet 127.0.0.1
|
|
|
|
|
If you read the documentation for DateTime.Now() , you'll find that the accuracy and resolution of the clock is very dependant on the hardware clock and only to about 10 milliseonds. Since your results are coming in very close to the clocks resolution, it is very possible to get calculated results of 0 milliseconds, even while using the Ticks counter.
The number of Ticks per Millisecond is constant at 10,000 to 1. But, there is no way in hell that DateTime.Now() will ever return a Tick count that accurately.
If you want to more accurately time something that can execute quicker than about 20 milliseconds, you'll have to use a high-resolution timer library. The .NET Framework doesn't come with one, well, 2.0 does anyway. This library, or class, will have to use the Win32 functions QueryPerformanceCounter and QueryPerformanceFrequency to get sub-millisecond accuracy. You can find an example of writing a wrapper class for these functions here[^] on MSDN. It's written in C#, but is easily converted to VB.NET if need be. There's even a few articles here on CodeProject. Just search the articles for "QueryPerformanceCounter".
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have one active directory.
I want VB code that prevent users from sharing there user name and password. I want to prevent two user to access the domain by the same user name.
Is there anly help. plz
thanks
|
|
|
|
|
y_mmohd wrote:
I want VB code that prevent users from sharing there user name and password.
And people in Hell want ice water. I seriously doubt VB can do anything about users' mouth's and ear's.
y_mmohd wrote:
I want to prevent two user to access the domain by the same user name.
In both a domain environment and Active Directory, this is not possible to do since concurrent logins are not tracked by either service. In AD, the Last-Logon and Last-Logoff attributes are not replicated between domain controllers, so in order to use this information to check to see if the previous user instance logged out before the current one logged in, you'll have to discover and poll all the domain controllers involved with teh domain this user is logging into.
On top of that, in order to control login, you'll actually have to write a new GINA.DLL and deploy it to all the workstations in your domain. This is something that is just not done in VB or VB.NET.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Could help me plz. and tell me how can i do this.
Or if there any link.
Thanks
|
|
|
|
|
You really didn't read my post did you?
YOU CAN'T DO THIS! The information required to be able to track concurrent connections in AD just doesn't exist!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have seen a few posts about getting outlook's calendar information aka appointment items. Here is a quick way of getting the information
Imports Microsoft.Office.Core
Imports Outlook
Function Test()
Dim myOlApp = CreateObject("Outlook.Application")
Dim myNameSpace = myOlApp.GetNameSpace("MAPI")
Dim myCalendar = myNameSpace.GetDefaultFolder(OlDefaultFolders.olFolderCalendar)
Dim myItems = myCalendar.Items
Dim apptItem As AppointmentItem
For Each apptItem In myItems
If apptItem.Start >= Date.Today Then
Debug.WriteLine(apptItem.Subject & " : " & apptItem.Start)
End If
Next
End Function
|
|
|
|
|
Hi ,
I want to compare the text of two html pages and then highlight the changed text.Do you have any idea on how to do this
|
|
|
|
|
Are the pages similar ? That is, do they have the same layout except for the text ? Perhaps you can just load one, then compare the two as strings, and do an insert where text is different to make a new composite document ?
Is it XHTML ? If it is, then you can do it by comparing XML nodes, and building a new document that highlights in one colour for stuff only in the first document, and another for stuff only in the second.
The XML way is definately cleaner, if it's possible.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
actually I need to check a two versions of the same page but if I compared the two versions as text I will not get an accurate result for instance maybe a picture has been changed and even the font size might change I just want to highlight the changed text
|
|
|
|
|
Then, is it XHTML ? Can you make it XHTML ? XHTML is HTML that is valid XML, it means you could load it into an XML document and compare it as XML.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thank you for your response.
actually the page is a regular html page .DO you have any suggestions on how to highlight the changed text only.
|
|
|
|
|
Mohsen Saad wrote:
actually the page is a regular html page
Can you convert it to XHTML ? All you need to do is make sure that the nodes match ( which they probably do ) and turn tags like <br&gr; into <br/&gr;. Otherwise, you're going to be parsing the nodes as well as the text.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am creating an image map and want to fire an onclick event instead of jumping to another page. What is the best way to do this using VB.Net?
Thanks for any help!
Steve
|
|
|
|
|
I'm under the impression that the control to do this is new in ASP.NET 2.0.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
It is but it is a timing thing! The 2.0 release is still in beta, and my hosting service will not load 2.0 until it is released and even then probably not for a couple of months.
Cheers:
Steve
|
|
|
|
|
Web hosts are allowed to host the beta 2, they just have to sign a guarentee that they'll upgrade to the full version on release.
It's possible that you can hack something in 1.1, but I wouldn't recommend it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian:
Thanks for the quick replies!! I am new to .NET and have been looking all over thinking this should be a slam dunk. To hear that it will not be so easy was reassurance that I had not missed something.
Thanks again!!
Steve
|
|
|
|
|
No worries. If I had to do it in 1.1, I'd chop up the image into smaller ones, so I had a single image that I wanted to be an onclick entirely.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi.
I have a VBA two functions inside MS Access. The functions take in Double and String as arguments
and pass back results thru these arguments.
One of these functions is failing me - a Run-Time crash.
Here are my VBA function prototypes:
Private Declare Function Convert_MGRS_To_Geodetic Lib "ConvertSystems.dll"
(ByVal strMGRS As String, ByRef Lat As Double, ByRef Lon As Double) As Long
'this has runtime crash
Private Declare Function Convert_Geodetic_To_MGRS Lib "ConvertSystems.dll"
(ByVal Lat As Double, ByVal Lon As Double, ByVal Precision As Long, ByRef strMGRS As String) As Long
My VC++ functions are:
long __stdcall Convert_MGRS_To_Geodetic (char* MGRS,
double *Latitude, double *Longitude)
long __stdcall Convert_Geodetic_To_MGRS (double Latitude,
double Longitude,long Precision,
char* MGRS)
The problem is with the second function. I want to return a valid string back in strMGRS (the 5th argument).
Help - I have tried changing ByRef to ByVal and both have same results - runtime crash.
Thanks,
Johnny
|
|
|
|
|
Hi. I think I solved my problem. I changed my VC++ function to use char MGRS[16]:
long __stdcall Convert_Geodetic_To_MGRS (double Latitude,double Longitude,long Precision,char MGRS[16])
And then I changed my VBA code to declare strMGRS as:
Dim strMGRS As String*15
The biggie was probably in the VC++ side (the .DLL).
Regards,
Johnny
|
|
|
|
|
Have a VB.NET application (inventory system) built by 3rd party that uses MSDE for backend. The program is v-e-r-y s-l-o-w making requests to the database. I have been told that there are too many connections, wrong connection type, etc, etc. No stored procedures have been created. Need help to understand the optimum design (maybe a "how-to" overview) to retrieve data from maybe 3-5 tables, in order to fill a datagrid just to list the contents of the inventory. Also, the form that contains the datagrid also contains several drop-down list that can be used to filter the results. Should I be using stored procedures? What do I do with the data for the drop-down list data -- can they be stored in memory so that I don't need to get the same info every time I make another call to the DB?
Really a newbie at this and need a starting point... all feedback is most appreciated.
Rob S
|
|
|
|
|
Rob570 wrote:
I have been told that there are too many connections
MSDE has a limit on the number of concurrent batch workloads that can be processed at once. If you have a large number of clients this could be a big part of the performance problem and new code may not make much of a difference at all.
Rob570 wrote:
Should I be using stored procedures?
Yes. Stored procedures are not only more secure but they are also much faster.
Rob570 wrote:
What do I do with the data for the drop-down list data -- can they be stored in memory
It really depends on how often the data changes. If it doesn't change very often or the new changes are not required immediately then storing it in memory may help the performance of your application.
|
|
|
|