Hi
I want to use the following declarations but vb dotnet keeps complaining
that currency can't be used because it private ?
I have tried it in a module and in the declaration pare same error!
Private Declare Function QueryPerformanceFrequency Lib "kernel32" (ByVal
lpFrequency As Currency) As Long
Private Declare Function QueryPerformanceCounter Lib "kernel32" (ByVal
lpPerformanceCount As Currency) As Long 11 2905
"Adrian" <Ad****@nospamhotmail.com.uk> schrieb Hi
I want to use the following declarations but vb dotnet keeps complaining that currency can't be used because it private ?
I have tried it in a module and in the declaration pare same error! Private Declare Function QueryPerformanceFrequency Lib "kernel32" (ByVal lpFrequency As Currency) As Long
Private Declare Function QueryPerformanceCounter Lib "kernel32" (ByVal lpPerformanceCount As Currency) As Long
These are declarations for the wrong language (VB6). In VB.Net:
Private Declare Function QueryPerformanceFrequency Lib "kernel32"
(ByRef lpFrequency As Long) As Boolean
Private Declare Function QueryPerformanceCounter Lib "kernel32"
(byref lpPerformanceCount As long) As boolean
Armin
Thanks for the quick reply and help
"Armin Zingler" <az*******@freenet.de> wrote in message
news:uP*************@TK2MSFTNGP14.phx.gbl... "Adrian" <Ad****@nospamhotmail.com.uk> schrieb Hi
I want to use the following declarations but vb dotnet keeps complaining that currency can't be used because it private ?
I have tried it in a module and in the declaration pare same error! Private Declare Function QueryPerformanceFrequency Lib "kernel32" (ByVal lpFrequency As Currency) As Long
Private Declare Function QueryPerformanceCounter Lib "kernel32" (ByVal lpPerformanceCount As Currency) As Long
These are declarations for the wrong language (VB6). In VB.Net:
Private Declare Function QueryPerformanceFrequency Lib "kernel32" (ByRef lpFrequency As Long) As Boolean
Private Declare Function QueryPerformanceCounter Lib "kernel32" (byref lpPerformanceCount As long) As boolean
Armin
Sorry it still gives the same error!?
"Adrian" <Ad****@nospamhotmail.com.uk> wrote in message
news:db**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com... Thanks for the quick reply and help
"Armin Zingler" <az*******@freenet.de> wrote in message news:uP*************@TK2MSFTNGP14.phx.gbl... "Adrian" <Ad****@nospamhotmail.com.uk> schrieb Hi
I want to use the following declarations but vb dotnet keeps complaining that currency can't be used because it private ?
I have tried it in a module and in the declaration pare same error! Private Declare Function QueryPerformanceFrequency Lib "kernel32" (ByVal lpFrequency As Currency) As Long
Private Declare Function QueryPerformanceCounter Lib "kernel32" (ByVal lpPerformanceCount As Currency) As Long
These are declarations for the wrong language (VB6). In VB.Net:
Private Declare Function QueryPerformanceFrequency Lib "kernel32" (ByRef lpFrequency As Long) As Boolean
Private Declare Function QueryPerformanceCounter Lib "kernel32" (byref lpPerformanceCount As long) As boolean
Armin
this what I'm trying to do, using the code bellow I insert a call to a web
service at the "some code line" and I want to know in milisecs how long it
takes to return a response.
Private Declare Function QueryPerformanceFrequency Lib "kernel32"
(lpFrequency As Currency) As Long
Private Declare Function QueryPerformanceCounter Lib "kernel32"
(lpPerformanceCount As Currency) As Long
Dim curFreq as Currency
Dim curStart as Currency
Dim curEnd as Currency
Dim dblResult as Double
QueryPerformanceFrequency curFreq 'Get the timer frequency
QueryPerformanceCounter curStart 'Get the start time
'Some code to test
QueryPerformanceCounter curEnd 'Get the end time
dblResult = (curEnd - curStart) / curFreq 'Calculate the duration (in
seconds)
taken from http://gpwiki.org/index.php/VB:QueryPerformanceCounter
"Adrian" <Ad****@nospamhotmail.com.uk> wrote in message
news:db**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com... Sorry it still gives the same error!? "Adrian" <Ad****@nospamhotmail.com.uk> wrote in message news:db**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com... Thanks for the quick reply and help
"Armin Zingler" <az*******@freenet.de> wrote in message news:uP*************@TK2MSFTNGP14.phx.gbl... "Adrian" <Ad****@nospamhotmail.com.uk> schrieb Hi
I want to use the following declarations but vb dotnet keeps complaining that currency can't be used because it private ?
I have tried it in a module and in the declaration pare same error! Private Declare Function QueryPerformanceFrequency Lib "kernel32" (ByVal lpFrequency As Currency) As Long
Private Declare Function QueryPerformanceCounter Lib "kernel32" (ByVal lpPerformanceCount As Currency) As Long
These are declarations for the wrong language (VB6). In VB.Net:
Private Declare Function QueryPerformanceFrequency Lib "kernel32" (ByRef lpFrequency As Long) As Boolean
Private Declare Function QueryPerformanceCounter Lib "kernel32" (byref lpPerformanceCount As long) As boolean
Armin
"Adrian" <Ad****@nospamhotmail.com.uk> schrieb taken from http://gpwiki.org/index.php/VB:QueryPerformanceCounter
Again, this code is for the wrong language. Well, not the language is wrong,
but you are using it in the wrong place. It is VB6 code. You are probably
using VB.net, aren't you? Both are different. Use my declaration. There is
no Currency data type. Use 'Long' as the parameters according to the
declaration.
Armin
OK thanks again, I will try it when I get home and let you know how it goes!
And yes I'm trying to use VB dotnet
Thanks
"Armin Zingler" <az*******@freenet.de> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl... "Adrian" <Ad****@nospamhotmail.com.uk> schrieb
taken from http://gpwiki.org/index.php/VB:QueryPerformanceCounter
Again, this code is for the wrong language. Well, not the language is wrong, but you are using it in the wrong place. It is VB6 code. You are probably using VB.net, aren't you? Both are different. Use my declaration. There is no Currency data type. Use 'Long' as the parameters according to the declaration.
Armin
"Adrian" <Ad****@nospamhotmail.com.uk> schrieb: I want to use the following declarations but vb dotnet keeps complaining that currency can't be used because it private ?
I have tried it in a module and in the declaration pare same error! Private Declare Function QueryPerformanceFrequency Lib "kernel32" (ByVal lpFrequency As Currency) As Long
See:
<URL:http://www.pinvoke.net/default.aspx/coredll/QueryPerformanceCounter%20.html>
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Armin ,,,,,, Long ????
No not long,,, you should use the decimal datatype for currency values
regards
Michel Posseth [MCP]
"Adrian" <Ad****@nospamhotmail.com.uk> schreef in bericht
news:db**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com... OK thanks again, I will try it when I get home and let you know how it goes!
And yes I'm trying to use VB dotnet
Thanks
"Armin Zingler" <az*******@freenet.de> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... "Adrian" <Ad****@nospamhotmail.com.uk> schrieb
taken from http://gpwiki.org/index.php/VB:QueryPerformanceCounter
Again, this code is for the wrong language. Well, not the language is wrong, but you are using it in the wrong place. It is VB6 code. You are probably using VB.net, aren't you? Both are different. Use my declaration. There is no Currency data type. Use 'Long' as the parameters according to the declaration.
Armin
"m.posseth" <po*****@planet.nl> schrieb Armin ,,,,,, Long ????
No not long,,, you should use the decimal datatype for currency values
They are not currency values.
Currency has been used in VB6 only because there was no other 8 bytes
integer (or better: scaled integer) data type. Now we have Long.
Armin
Armin ,,,
'
I sure remember that when i moved from VB 6 to VB.Net that in the
conversion guides was stated that the decimal datatype should be used to
hold currency values
"Nor is the Currency data type. Instead, use the new Decimal data type,
which can handle more digits on both sides of the decimal point, for all
money variables and calculations. Decimal is also directly supported by the
common language runtime."
after a small search http://msdn.microsoft.com/library/de...ypechanges.asp
after some googling i found that some people recomend a 64 bit integer to
hold currency values
regards
Michel Posseth
"Armin Zingler" <az*******@freenet.de> schreef in bericht
news:ev**************@TK2MSFTNGP12.phx.gbl... "m.posseth" <po*****@planet.nl> schrieb Armin ,,,,,, Long ????
No not long,,, you should use the decimal datatype for currency values
They are not currency values.
Currency has been used in VB6 only because there was no other 8 bytes integer (or better: scaled integer) data type. Now we have Long.
Armin
On 2005-07-27, m.posseth <po*****@planet.nl> wrote: Armin ,,, ' I sure remember that when i moved from VB 6 to VB.Net that in the conversion guides was stated that the decimal datatype should be used to hold currency values
That's true, except in this case - since they aren't storing currency
values. The need a 64-bit integer. In VB6, you had to use a currency
value (since that's what they were interanlly). In VB.NET you use Long,
which is a 64-bit integer.
"Nor is the Currency data type. Instead, use the new Decimal data type, which can handle more digits on both sides of the decimal point, for all money variables and calculations. Decimal is also directly supported by the common language runtime."
after a small search
http://msdn.microsoft.com/library/de...ypechanges.asp
after some googling i found that some people recomend a 64 bit integer to hold currency values
The decimal data type is a 64-bit integer internally.
--
Tom Shelton [MVP] This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Bill Stanard |
last post by:
I have had no success using the format function as follows (the two
lines of code run one after the other):
'displays a running total of lblAmtdue.Caption
'contents in txtTotal.Text...
|
by: Willing 2 Learn |
last post by:
I'm still having trouble getting my program to do arithmetic in
cents(keeping all #'s) then convert the answer in a format of dollars &
cents. The main program should add, subtract, scalar...
|
by: zlf |
last post by:
Hi,
Run this code will cause format exception. I think the problem is
induced by using System.Globalization.NumberStyles.Currency since I used
customed currency symbol("My Dollar:").
Please tell...
|
by: Mitchell Vincent |
last post by:
Just making sure I'm not missing the boat here, but are there any
special routines for doing currency math (fixed precision stuff) in .NET?
The wonderful problems of doing math on decimals tend...
|
by: Paul H |
last post by:
OK, I tried getting and old Newbury Data ND2500 working using the "Generic
/Text only" driver in Win XP. It prints, but I could not find a way to set a
custom page size that matches the paper I am...
|
by: meenasamy |
last post by:
Hi all, i need to create a function that takes three parameters(
Original currency, needed currency, amount) i need to convert from the
original currency to the needed currency the amount and...
|
by: sck10 |
last post by:
Hello,
I have a SQL Server 2K table with a field set to currency. When I try to
insert or update a FormView, I get the following error:
Disallowed implicit conversion from data type nvarchar...
|
by: labcheung |
last post by:
Hi all:
I am working on Access 2000 with SP3. The problem is the sum of currency has
$0.01 difference on the total even I use the same equation on all forms.
I have a product which costs...
|
by: etuncer |
last post by:
Hello All,
I have Access 2003, and am trying to build a database for my small
company. I want to be able to create a word document based on the data
entered through a form. the real question is...
|
by: Rina0 |
last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
|
by: erikbower65 |
last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps:
1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal.
2. Connect to...
|
by: linyimin |
last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
|
by: erikbower65 |
last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA:
1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
|
by: kcodez |
last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
|
by: Rina0 |
last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
|
by: DJRhino |
last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer)
If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _
310030356 Or 310030359 Or 310030362 Or...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: lllomh |
last post by:
How does React native implement an English player?
| |