I don't really understand what the TWriteFileCommand in parathesis after the equal sign is for in that statement. When I try to do it in VB.NET, I keep getting errors because I can't get a reference to the CreateCommand function. The closest I've gotten is this:
Dim MyAppBase As OPSupport.App.AppBase
Dim writeFile As TWriteFileCommand
writeFile = MyAppBase.CommunicationLink.CreateCommand(TOPKernel.TCommand.CommandType.WriteFile)
However, I have a green underline after the equal sign @ MyAppBase that flags an error "Variable MyAppBase is used before it has been assigned a value. A null reference exception could result at runtime."What am I missing? Why in the C# code is the instance fine and what do I need to get the equivalent instance in VB.NET?
I am new to vb.net and would like to be able to convert the following code to it's own function - either inside the current module or better yet in a seperate class.This code currently runs in the KEYPRESS event and ensures only numbers, decimal point, 2 decimals etc. are entered and not letters. Works exactly how I want it but would now like it in a function.I need this code in numerous text box controls but I would rather just call it somehow with a function.
I've been having trouble converting the following fairly straight forward c# code into vb.net 4.0, which I understand has anonymous delegates. I just havn't been able to figure it out yet.
_combo.DataBound += (sender, args) => { var item = _combo.FindItemByValue(values[0].ToString()); if (item != null)
[code]...
I have tried the following
_combo.DataBound += Function(sender, args) Dim item = _combo.FindItemByValue(values(0).ToString()) If item IsNot Nothing Then [code]...
But the compiler complains that DataBound can not be called directly, but has to be called with RaiseEvents
I have a function in an external library, for which I do not have the source code, which is causing problems. If I were putting in a breakpoint in my own code, I would put it on the first line of the function, but as it is an external function, I do not have that option. Is there any way to as Visual Studio to break any time the function is called? My current workaround is to do a "Find All References" and put an individual breakpoint on every single call to the function, which is a sucky way of doing things.
I have Crystal Reports 2008 installed on my win7 laptop but when i go to insert references from my application settings the CrystalDecisions references are missing and im not able to find them. Note: they do exist in my "c:windowsassembly" folder.
This is perhaps something that may or may not be feasable in VB.Net. I would like to give my end-user the flexibility to add segments of code to my program, save it to a text file and then run it whenever they need it. This will ease the burden of upkeep; rather than compiling all my code and releasing that at short intervals, I can just let the user update the portion of code they want without having to re-compile the tool.
[URL]
But that does not seem to include variable reference. So if I wanted to add the following code, it won't run.
Dim myText As String = "For n as integer = 1 to 10000" & _ vbCrLf & "me.label1.text = ""label"" & n" & _ vbCrLf & "Next n" AxScriptControl1.ExecuteStatement(myText)
It would be great if I could run something like that, where as long as all the variables were defined, it would run like compiled code.
I have a lot of repetitive code that references components of my main form. I wanted to create a separate module (correct terminology?) for all this code to be contained. I cut the offending code and pasted it into my new module, changing each label reference, etc to form1.label.click
Form1 was then underlined and I get this message:Handles clause requires WithEvents variable defined in the containing type or one of its base types.I think I'm headed in the right direction, but what exactly am I looking for? Here is a sampling of the code that I would like to keep in a separate place other than Form1.vb:
I am using CompilerParameters to dynamically compile code... The problem is when I use: cp.ReferencedAssemblies.Add(CompilerPath & "est.exe") to add a reference to test exe ... (where CompilerPath is the full path name) Compiler Path is not the Compiler Application Path
I get an error when compiling stating that: vb "Could not load file or assembly 'test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified." If I put it in the test.dll in the "compiler apps" path and then call ReferencedAssemblies.Add with the full path it works.
my project was intially mandated to be done in c#.however a large contributor to the project wrote much of the business logic, which he knows well, in vb.net.How difficult would it be to convert the following c# code into vb.net.
I am trying to convert a DLL function call which has the Callback function routine called within the DLL function call.The DLL function call signature is like this:
This code was posted in Chit Chat and everyone is saying how great it is. I just have Visual Studio 2010 and no familiarity with VB6 so I thought it would be good to convert the code to Visual Basic 2010.
Dim wiaManager As WiaClass = Nothing ' WIA manager COM object Dim wiaDevs As CollectionClass = Nothing ' WIA devices collection COM object Dim wiaRoot As ItemClass = Nothing ' WIA root device COM object Dim wiaPics As CollectionClass = Nothing ' WIA collection COM object[code]....
This is my first time writeing a program and i am stuck. i am just looking for were i should go next. i can't figure out how to write in code for the days in the getDay function.
Write a program that computes the cost of a long-distance call. The cost of the call is determined according to the following rate schedule:
a. Any call started between 7:00 A.M. and 9:00 P.M., Monday through Friday, is billed at a rate of $0.30 per minute.
b. Any call started before 7:00 A.M. or after 9:00 P.M., Monday through Friday, is billed at a rate of $0.15 per minute.
c. Any call started on a Saturday or Sunday is billed at a rate of $0.10 per minute.
The inputs will consist of (1) the day of the week, (2) the start/end time of the call, and (3) the length of the call in minutes. The output will be the cost of the call. Input will come from the user and outputs will be displayed via the console window.
I had the following code:[code]How can I convert this code to listbox code? Because the above code is using datagridview but I would like to change it to listbox.
only code I can find after several hours of searching is a PHP function. Although I can more or less see what's happening, I'm not able to convert everything. The main problem is the "temp_getBytes" function. I don't know how to convert that.I already have the file as a byte array, because it was decrypted, so I'm writing the byte array to a memory stream in order to work with the data. I've added a bunch of question marks where I'm having a problem converting the code.
I'm using a SQL Server database and a bindingsource, and i want to filter a numeric field in order to, for instance, when I write 1, the grid shows all the rows in which that field begins whith 1 (1,10,14...). In order to do this, I have to convert the field to varchar, but VB shows an error message when using cast or convert functions. I have this sentence in my
I have this function that maps a IDataReader to a class. It is obviously written in C#. My co-worker wants to use the same method in his code, but he is writing in VB.net. Basically I am having difficulty rewriting this due to the Lambda expressions used in C#. He is running .Net 3.5.
Where inst is the pointer originally passed to RemoteDllSetReceiver buffer & size contain the notification text as defined in the Remote Protocol. Note: notifications may arrive in different threads (e.g. network, timer, audio).
I can't imagine what i mus do with on_received_buffer_t, must it be a delegate? Like you can read, this functions returns notifications from the DLL like connection status, user id...