typedef unsigned short MFSTATUS; // known as a WORD - 16 bits for sure
MIFAREAPI_API MFSTATUS MIFAREAPICC MF_ReadCardBlock( DWORD dwBlkAdr, DWORD dwRdrKey, DWORD dwKeyAB, DWORD dwRspBufSz, BYTE *pRspBuf );
HOW DO I TRANSLATE IT TO VB?
Declare Function MF_ReadCard Lib "MifareAPI.dll" Alias "MF_ReadCardBlock" (ByVal BlkAdr As Long, ByVal RdrKey As Long, ByVal KeyAB As Long, ByVal BuffSize As Long, ByRef buffer As Byte()) As Short
I have some VB6 code that I am converting to VB.net and came across this section
Declare Function TmSendByLen Lib "tmctl.dll" Alias "TmSendByLength"(ByVal id As Integer, ByRef msg As Any, ByVal blen As Integer) As Integer 'snip'
[code]....
I have not come across the Alias term before but I can guess what it does. What I am unsure of is the reasoning behind overloading the alias. If that is what is happening.I need to create overloads for the TmSendByLen function as the 'As Any' is not supported in VB.net so I am not sure if I should just remove the alias or if I should leave it in place.
Private Declare Auto Function InternetSetOption Lib "wininet.dll" (ByVal hInternet As IntPtr, ByVal dwOption As Integer, ByVal lpBuffer As IntPtr, ByVal lpdwBufferLength As Integer) As Boolean
I have several classes that use a bunch of strings for directories, arguments, etc.
At the moment, they're all just declared globally within the class like so:
VB.NET Private str1 As String = "path" Private str2 As String = "path2" Private str3 As String = "arg"
To me, that looks awful and doesn't seem like the proper way of doing things. So, I was thinking, should I make a property for each string and then use a constructor to initialize them?
Would that make a difference at all? Is that the proper way of doing things?Also, some strings are used in a ton of different places and they're basically just being copied from one class and pasted into another. So, do you think I should do what I suggested above, but with a class whose sole purpose is to house those strings so that the code isn't duplicated a million times everywhere? Would that be the most efficient way of doing things?
i'm making practice with GDI+ and i need an help with the creation of a new brush:i have two if condition and for each if i need to define a new kind of brush(Solid,HatchBrush)[code]but when i try to apply to a graphic object the brush i have an error: "nBrush not declared"..there is a way to declare a brush object without properties and then tell if it must be solid or hatch? there is another way to solve this problem?
In my VbNET2008 window application I include a EXCEL Spreadsheet and it generate 2 error messages when I declared the WorkBook and Worksheet.
Here are the error message:
Error 3 Type 'objExcel.Workbook' is not defined. Error 4 Type 'objExcel.Worksheet' is not defined.
Here are the coding that generated the error messages:Imports Microsoft.Office.Interop.Excel
Dim objExcel As Microsoft.Office.Interop.Excel.Application = CType(CreateObject("Excel.application"),Microsoft.Office.Interop.Excel.Application) Dim objWorkBook As objExcel.Workbook = CType(objExcel.Workbooks.Add, objExcel.Workbook) Dim objWorksheet As objExcel.Worksheet = CType(objExcel.Worksheets(1), objExcel.Worksheet)
Why are static variables set equal to 0 in the declaration when 0 would be the default value of the numeric variable anyway when it's first declared? Not including the "=0" in the static declaration seems to work with no problem.
What will happen when 3 function calls same function at a time? I have 3 Function, f1,f2,f3.. Those function after completing their task will call finish() function. What will happen if Finish is Called morethan once..
I have found aa solution to a problem in one of my reports but its in VB.NET and I am not sure how to convert it to C#, I tried to do it online with one of the tools but it cant determine the events been used or something like that. If there is anyone savy at both languages maybe you can help me figure out its translation?
Here is the VB code:
Private Sub XrLabel1_BeforePrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintEventArgs) Handles XrLabel1.BeforePrint
I have this little function for forcing a download of MP3 files. I have it integrated into my VB app but would like it to be converted from C# to VB so that I can use other functions in my APP_Code directory.
Is there an English - Visual Basic dictionary thae translate my thoughts to code? I am taking courses at the local community college and having difficulty with this "foreign" language.
I have found the following code which can get the harddisk no in VB6.0.I would like to translate it into vb.net code.I have tried the auto upgrade function in vb2005 and translated the following code to vb.net, but the outcome did not run probably.Can anyone give me some help to translate the following VB6.0 code into vb.net code?
So, I'm taking Intro to Programming and I'm working through the exercises in a chapter about String Manipulation and the For Next loop.We haven't gotten to arrays yet, so I'm trying to do this just with what's been covered.The exercise is to translate a word into pig latin.If it begins with a vowel, you add "-way" to the end of the string. If it doesn't, you add "-" and then the first character to the end until you reach a vowel and "ay" to the end of that. So "Chair" would become "air-Chay".[code]
I am trying to translate some VB codes to C++. And I am not quite sure what this line does.
IIf (n& 1=1, 0.0005, -0.0005)
I know what IIf(logic, true_value, false_value) does, and I guess the & operator is supposed to concat two strings. But I am not sure what the intention of using "n & 1 =1".
In C, Pascal, and C++ it is possible to use the FormatMessage function to retrieve a "friendly" error message that corresponds to a COM HRESULT error code. This question contains sample code that demonstrates the C++ approach. Of course it would be possible to build a managed C++ assembly to perform this function for C# and VB.NET code, but I'm wondering: is there a way to translate COM error codes using the .NET system libraries?
I have an application written for the UK market that currently only supports English (UK) and a client wants to deploy part of the application out to a non UK site and syncronise the data back to the UK HQ.I can convert the application labels and messages using resource files and the loc culture information but was wondering how you would convert the database bound data.E.G.Here is the HQ based table