473,738 Members | 3,854 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

can't use Currency in a function declration!

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 QueryPerformanc eFrequency Lib "kernel32" (ByVal
lpFrequency As Currency) As Long

Private Declare Function QueryPerformanc eCounter Lib "kernel32" (ByVal
lpPerformanceCo unt As Currency) As Long

Nov 21 '05 #1
11 2956
"Adrian" <Ad****@nospamh otmail.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 QueryPerformanc eFrequency Lib "kernel32"
(ByVal lpFrequency As Currency) As Long

Private Declare Function QueryPerformanc eCounter Lib "kernel32"
(ByVal lpPerformanceCo unt As Currency) As Long

These are declarations for the wrong language (VB6). In VB.Net:
Private Declare Function QueryPerformanc eFrequency Lib "kernel32"
(ByRef lpFrequency As Long) As Boolean

Private Declare Function QueryPerformanc eCounter Lib "kernel32"
(byref lpPerformanceCo unt As long) As boolean
Armin
Nov 21 '05 #2
Thanks for the quick reply and help

"Armin Zingler" <az*******@free net.de> wrote in message
news:uP******** *****@TK2MSFTNG P14.phx.gbl...
"Adrian" <Ad****@nospamh otmail.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 QueryPerformanc eFrequency Lib "kernel32"
(ByVal lpFrequency As Currency) As Long

Private Declare Function QueryPerformanc eCounter Lib "kernel32"
(ByVal lpPerformanceCo unt As Currency) As Long

These are declarations for the wrong language (VB6). In VB.Net:
Private Declare Function QueryPerformanc eFrequency Lib "kernel32"
(ByRef lpFrequency As Long) As Boolean

Private Declare Function QueryPerformanc eCounter Lib "kernel32"
(byref lpPerformanceCo unt As long) As boolean
Armin

Nov 21 '05 #3
Sorry it still gives the same error!?

"Adrian" <Ad****@nospamh otmail.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*******@free net.de> wrote in message
news:uP******** *****@TK2MSFTNG P14.phx.gbl...
"Adrian" <Ad****@nospamh otmail.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 QueryPerformanc eFrequency Lib "kernel32"
(ByVal lpFrequency As Currency) As Long

Private Declare Function QueryPerformanc eCounter Lib "kernel32"
(ByVal lpPerformanceCo unt As Currency) As Long

These are declarations for the wrong language (VB6). In VB.Net:
Private Declare Function QueryPerformanc eFrequency Lib "kernel32"
(ByRef lpFrequency As Long) As Boolean

Private Declare Function QueryPerformanc eCounter Lib "kernel32"
(byref lpPerformanceCo unt As long) As boolean
Armin


Nov 21 '05 #4
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 QueryPerformanc eFrequency Lib "kernel32"
(lpFrequency As Currency) As Long
Private Declare Function QueryPerformanc eCounter Lib "kernel32"
(lpPerformanceC ount As Currency) As Long

Dim curFreq as Currency
Dim curStart as Currency
Dim curEnd as Currency
Dim dblResult as Double

QueryPerformanc eFrequency curFreq 'Get the timer frequency
QueryPerformanc eCounter curStart 'Get the start time

'Some code to test

QueryPerformanc eCounter 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****@nospamh otmail.com.uk> wrote in message
news:db******** **@nwrdmz01.dmz .ncs.ea.ibs-infra.bt.com...
Sorry it still gives the same error!?

"Adrian" <Ad****@nospamh otmail.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*******@free net.de> wrote in message
news:uP******** *****@TK2MSFTNG P14.phx.gbl...
"Adrian" <Ad****@nospamh otmail.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 QueryPerformanc eFrequency Lib "kernel32"
(ByVal lpFrequency As Currency) As Long

Private Declare Function QueryPerformanc eCounter Lib "kernel32"
(ByVal lpPerformanceCo unt As Currency) As Long
These are declarations for the wrong language (VB6). In VB.Net:
Private Declare Function QueryPerformanc eFrequency Lib "kernel32"
(ByRef lpFrequency As Long) As Boolean

Private Declare Function QueryPerformanc eCounter Lib "kernel32"
(byref lpPerformanceCo unt As long) As boolean
Armin



Nov 21 '05 #5
"Adrian" <Ad****@nospamh otmail.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

Nov 21 '05 #6
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*******@free net.de> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
"Adrian" <Ad****@nospamh otmail.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

Nov 21 '05 #7
"Adrian" <Ad****@nospamh otmail.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 QueryPerformanc eFrequency Lib "kernel32" (ByVal
lpFrequency As Currency) As Long


See:

<URL:http://www.pinvoke.net/default.aspx/coredll/QueryPerformanc eCounter%20.htm l>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #8
Armin ,,,,,, Long ????

No not long,,, you should use the decimal datatype for currency values

regards

Michel Posseth [MCP]

"Adrian" <Ad****@nospamh otmail.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*******@free net.de> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
"Adrian" <Ad****@nospamh otmail.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


Nov 21 '05 #9
"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

Nov 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8865
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 txtTotal.Text = lblAmtdue.Caption + Val(txtTotal.Text) 'tries to format contents of txtTotal.Text as currency; doesn't work txtTotal.Text = Format$(txtTotal.Text, "Currency")
2
574
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 multiply(by int)& show, have a constructor w/ & w/out arguments. Header file should have private data & all 6 functions from above.Class definition file should implement my ADT class. What I have so far: Main program #include "jahcurrency.h" #include...
2
5690
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 me how to modify this block of code.Thanks Console.WriteLine ( NumberValue.ToString ( formatString , n ) ); NumberFormatInfo numberFormatInfo = new System.Globalization.NumberFormatInfo();
6
9552
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 to shine when writing accounting software :-) How are others dealing with this? -- - Mitchell Vincent
4
1894
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 using. So there was no way it would ever work. The customer is happy to buy another Dot Matrix printer because the ND2500 can be used elsewhere. So which printer should I get that can plug and play with Access? Paul
7
4069
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 return the new amount in the needed currency, I need this function to work real time (obtaining real time currency exchange rates), any ideas???
2
2234
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 to data type money, table 'tblCustomer_Revenue', column 'RevenueQtr01'. Use the CONVERT function to run this query. Any help with this would be appreciated.
2
1778
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 $538.20, then add two taxes (7% ---$37.67 and 6% ---$32.29) and the total amount should be $608.16. Total=Subtotal (1 + Tax1 +Tax2) all controls are formated as currency. $608.16 = $538.20 + $37.67 + $32.29
4
12440
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 this: can Access create the document and place it as an OLE object to the relevant table? Any help is greatly appreciated. Ricky
0
8787
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9473
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9334
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9208
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6053
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4824
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3279
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.