Pass Strings By Ref To VB6 OCX?

Aug 31, 2010

I need to pass 2 strings from VB.NET to an OCX written for VB6. VS2008 put a wrapper on the OCX, but while the routine is called, the string parameters are not correctly received.

I do not know why but I am guessing that it is because, as I understand it, in VB6 parameters are passed By Ref as a default while in VB.NET, parameters are passed Bv Val as a default.

When I imported the OCX into VS 2008, it seems to have automatically defaulted the string parameters for the routine I need to By Val because the ocx export info did not specify anything.

Is there anyway to override VS 2008 so that I can pass the strings correctly to the OCX? Is there something else instead that I could do?

I have 30000 files encrypted with FastEncrypt by JSoft, which seems to have gone out of business, and I need to incorporate FastEncrypt into a VB.NET program in order to use them.

View 1 Replies


ADVERTISEMENT

Pass Strings From Net To C++ DLL And Back?

Mar 4, 2009

I've been pulling my hair out on this issue, and I can't find any topics that seem to help on this one.

I have a 3rd party unmanaged C++ DLL function which takes a string (char *) as one of its parameters then modifies that string internally.[code]...

View 5 Replies

Pass Strings From VB To C++ DLL And Back?

Mar 4, 2009

I have a 3rd party unmanaged C++ DLL function which takes a string (char *) as one of its parameters then modifies that string internally.[code]...

Currently this code runs without exception, but desc shows 40 spaces when displayed to the messagebox. I've tried StringBuilders, but they don't seem to work. I've also tried changing the 2nd parameter to be ByRef but this causes a read/write memory exception.

View 5 Replies

Pass Different Font Type Strings Into RichTextBox?

Feb 25, 2010

I have situation where I have to retrieve different fields from Access Database and put into one RichTextBox but they have to be displayed as DIFFERENT font types/colors.

I am able to get the database field data into RichTextBox but not able to set font styles or font colors. They are displayed in default font style. Please help me with sample code by giving example, i.e., taking two to three different string types and sending them to RichTextBox with different font color and styles.

View 2 Replies

VS 2010 Pass Multiple Strings To A Command Prompt .exe Program?

Dec 16, 2010

I need to open up a cmd prompt, then run a file called adb.exe which opens a shell to communicate with my android cell phone...

Heres what I need:

My Form1

Label1.Text = "adb.exe shell"
Label2.Text = "su"
Label3.Text = "mkdir /etc/folder"

[Code]....

Heres the problem... I can execute any normal dos command automaticly, but once i open the ssh prompt (adb.exe shell), i dont know how to keep putting commands in there...

The commands are stored in strings, and i need to take the commands from the strings, and type them into the command prompt like above.

View 2 Replies

Way To Concatenate List Of Strings Into A Comma-separated Strings, Where Strings Are Members Of An Object?

Oct 16, 2009

Say I have a List(Of Tag) with Tag being an object. One member of Tag, Tag.Description, is a string, and I want to make a comma-separated concatenation of the Description members.Is there an easier way to do this than to read the Description members into a List(Of String) and then use the Join function?

View 2 Replies

VS 2008 Send An Object Instead Of Strings Which Includes Multiple Unsigned Integers And Strings

Aug 13, 2009

I am working on a UDP Client/Server, and currently i have them sending back and forth strings, which i convert to bytes, and then open the bytes to read. I want to now send an Object instead of those strings, which includes multiple unsigned integers and strings.

View 39 Replies

Prepend A String To All Strings In A List Of Strings?

Aug 5, 2010

I have a list of strings. For each string in that list, I want to prepend another string. I wrote a method to do it, but I was wondering if there was something already in .NET I could use to do this. It seems like something that could be built in, but I was not able to find anything.

Here is the method I wrote:

Private Function PrependToAllInList(ByRef inputList As List(Of String), ByRef prependString As String) As List(Of String)
Dim returnList As List(Of String) = New List(Of String)
For Each inputString As String In inputList
returnList.Add(String.Format("{0}{1}", prependString, inputString))

[code].....

It works, but I would rather use built in functions whenever possible.

View 5 Replies

VS 2008 Using List Of Strings Or Array Of Strings?

Oct 16, 2009

I'm migrating from VB6 to VB.NET, in hence my questions below:

I have to write a function that returns array of strings.

How can I initiate it to empty array? I need it since I have to check if it's empty array after it returns from this function.

Is list of arrays better for this purpose? If I use a list - Is it empty when it firstly defined? How can I check it it's empty?

View 3 Replies

VS 2005 Update Table - If All Results Is PASS Then The Table2 Should Be Updated As Pass

Jun 8, 2012

I have two tables:

table1

case_no flow result
tc_1 001 pass
tc_1 002 pass
tc_1 003 pass
tc_2 001 pass
tc_2 002 fail
tc_2 003 pass


table2"

case_no result
tc_1 pass
tc_2 fail

Table2 should be updates from table based on the results... If all results is PASS then the table2 should be updated as pass... if any result is FAIL then the entire case_no should be updates a s fail..

View 7 Replies

Sockets - VB9 .Net 3.5 (2008) Code Works On The First Pass.Then Second Pass It Just Hangs On

Jun 19, 2009

This code was working consistently, but now...This code works on the first pass.Then second pass it just hangs on Code:Dim tcpClient As TcpClient = tcpListener.AcceptTcpClient() for about 2 minutesThen the code will fork for another pass, then fail.....

Code:Imports SystemImports System.TextImports System.Collections.GenericImports System.XmlImports System.Xml.LinqImports System.Net.Sockets

[CODE]....

View 2 Replies

Pass Data To Dialog - Manipulate And Pass Back?

Jan 15, 2010

Just started VB programming this week and have found a wealth of information about what I'm trying to do. Problem is, some of it is more complete than others.Here's what I'm trying to do:In Form1 (my main form), I want to instantiate a class that contains a couple of properties (speed setpoint and position setpoint). When I click a button, I want to pass this data to Form2 and populate two textboxes on Form2 with the properties of this object. I want to manipulate the property values on Form2 and click an OK button which closes the dialog and returns the manipulated data, updating the property values of the object. Here's the algorithm I'm following:1) On Form1, instantiate the class2) On Form1's "Pass Data" button click event handler, instantiate a Form2 object and invoke the ShowDialog method, passing the object as a parameter.

3) On Form2, overload the ShowDialog method to accept the object as a parameter and modify the method so that it returns the manipulated class data.4) On Form2, in the ShowDialog method, populate the textboxes with the class data that was passed in.Here's where I get stuck. If I press the OK button on Form2 (DialogResult.OK), it returns me to Form1, but what hook do I have in Form1 to receive the manipulated class data that the ShowDialog method is returning?Here's an example of what I'm thinking about:

Code:
Public Class Form1
Dim clsController1 As New MotionController

[code].....

I'm sure it's probably a very elementary question, but every explanation I've found seems to be incomplete.

View 2 Replies

Find Strings Inside Strings?

Aug 15, 2011

I have been looking for examples to find the string between two strings. This top one works fine;

Public Sub ReadData(ByRef keywordStart As String, ByRef keywordEnd As String, ByVal filename As String)
Using reader = New StreamReader(filename)

[Code].....

Now the first one is fine - Ext_Volume is result of the string between the strings <Volume> and </Volume>. <Volume> and </Volume> are unique so this is straight forward.

However the second one - "^FDExp:" is unique, but "^FS" is not unique. There are occurances of "^FS" before and after "^FDExp:".

How do I get the string to search AFTER the occurrence, not before etc?

View 5 Replies

How To Extract The Strings Out Of An Array Of Strings

Jun 24, 2011

Dim str As String
Dim str2 As Array
str = "blabla duhduh"
str2 = str.Split(" ")

View 2 Replies

Use Regular Expression To Get Strings Between 2 Strings?

Apr 6, 2012

Say the string is something like

bla bla bla bla (cat) bladfdskdfd dsgdsdksf (dog)
dfdshfdskdskfsdfkhsdf sdkfhdsfkdf (kathy) fdsfhdskfhdsfkd (doggy)

I want a generic.list (of string) containing

cat
dog
kathy
doggy

How to do that with regular expression in vb.net

Later I want to do something more complicated like getting all strings between "url":" and ", from this strings

[Code].....

View 1 Replies

VS 2010 Finding Strings Within Strings?

Jan 8, 2012

Is there an easy way to find a certain string within a string and then return the strings that you find as an array?I have written this:

Public Function FindStrings(ByVal strSourceString As String, ByVal strStartString As String, ByVal strEndString As String) As String()
Dim StringStartposition As Integer
Dim StringEndPosition As Integer
Dim Currentposition As Integer = 1

[Code]...

View 16 Replies

VS 2010 Separate Strings Into Other Strings?

Jan 16, 2011

I have this string called time. It's value is in this format: HH:MM:SS The numbers change, but the format stays the same. I want to separtate the code into 3 strings Hour, Minutes, Seconds.

View 2 Replies

DataGridView - Convert Nulls To Empty Strings And Display It In The Grid As Empty Strings

May 14, 2009

I have a DataGridView that has some columns with dates. It binds to an in-memory Datatable which gets loaded from an string array of data passed back from the backend Some of the rows returned have nulls for the date columns. Solution 1: If I define the Date column in the DataTable as "string" I can easily convert those nulls to empty strings and display it in the grid as empty strings (desired results). However, if the user clicks on the date column header to sort by date, it doesn't order the rows as you want. You get a purely string sort order. Not acceptable

[Code]...

View 2 Replies

VS 2005 To Pass Or Not To Pass?

Apr 16, 2009

I am looking for some input. I am helping with a web application that is fairly large. We have some logic factored out into classes, not a true business logic layer (yet ). The classes are setup to pull values directly from the QueryString or Session variables and I'm not sure that that mehtod is proper or even a

The reason I would like some input is, there may be a chance to rewrite or at least refactor the code.

[Code]...

View 2 Replies

Puts The Strings From Text Box 2 Between The Strings In Text Box 1?

May 17, 2010

Here's the weird problem I am trying to solve but cannot get my mind around it. In a text box 1, the user enters 2 or more strings separated by comma. then in text box 2, the user enter 1 or more strings separated by comma. The output then puts the strings from text box 2 between the strings in text box 1

Example:

TextBox1 = visual basic, java, perl
TextBox2 = is better, compared to

[Code]...

View 1 Replies

Pass A Value From A Sub Procedure To A Function Procedure .... Pass The Whole Subprocedure To The Function Procedure Argument?

Mar 30, 2012

Im a student doing an assignment, how do i pass the value from a sub procedure to a function procedure....i want to pass the value from decSubtotal to a function procedure named CalculateDiscount; check out my code--

[Code]...

View 1 Replies

How To Add Two Strings

Aug 14, 2009

I have a text box where i have time stored in it and i have another text box with the time as well. these text box have stored time as "string" . now i want to add times but gets an error message(ex on monday the emp works 2 hrs and tuesday 5 hrs and i want to display 7 hrs in total hrs worked for the week)[code]

View 5 Replies

Add 2 Strings Variables

Jul 14, 2011

I used to add 2 strings variables and it works but when I tried using VB2008 it didn't work. [code]

View 9 Replies

Add Numbers In Strings?

May 2, 2010

I need to add numbers in strings My program concatenate the numbers instead

Dim first As String
Dim complete1 As String
Dim complete As String

[Code]....

View 2 Replies

Adding Strings In .net?

Aug 19, 2009

I have a function where I have to add two values (declared as string) on two different pages, So Iam bringing one value from one page to the second page where I have second value and adding both of them to display the result in a label. But I am not able to do that. eg: 1st value is 4.20 ( both values are time in seconds) and 2nd value is 0.34 then I want the result as 4.54( instead I am gettign the result as 4.24.0.34 , So can anyone tell me how to add these two ..My code is attached.

Dim L1 As String
L1 = main.TimeElapse(Value1).ToString
'Label1.Text value is the below line
Status.ShowSuccess("Ready: Result is " + _Myfunction.GetTimeInSeconds.ToString("N1") + TimeElapse(value1).GetTimeInSeconds.ToString("N2") + " seconds")

View 4 Replies

Best Way To Manage Strings?

Aug 21, 2010

I am writing a program that uses an array with three columns and a varying amount of rows. I need to load info on a list of files in an archive(specifically: file name, size, path), and I am wondering what the most convenient way to store strings(to be loaded into the array) is.

For example: I tried creating a new .resx file in my project, and writing a function to be executed on form1_load that reads the strings from the .resx file and places them in the array in their correct column, but unfortunately had no success.

I really have no idea how resx files work, I can put strings in them using the resource editor, but I don't know how to retrieve them using resourcemanager.

I would just put the info straight into an array, but it's much easier to update a .resx file when the archive changes than it is to update the code.

Could someone please tell me how to use .resx files in vb.net? Or an easier way of accomplishing my goal?

View 7 Replies

C# - Extracting Strings In .NET?

Nov 26, 2009

I have a string that looks like this:

var expression = @"Args("token1") + Args("token2")";

I want to retrieve a collection of strings that are enclosed in Args("") in the expression.

How would I do this in C# or VB.NET?

View 4 Replies

Can't Add Two Strings Into A Listview Box

Nov 27, 2009

When i try to put two string in a ListView1 i get this error.

Quote:

Error1Operator '&' is not defined for types 'System.Windows.Forms.ListViewItem' and System.Windows.Forms.ListViewItem'.C:UsersAdminDocumentsProForm1.vb5037FileFind

My code

Dim lvi As New ListViewItem(foundFile, 0)
Dim str(1) As String
Dim itm As ListViewItem

[Code]....

View 27 Replies

Concatenate Strings Or Use &

Jan 29, 2012

In Visual Studio 2010 for Windows Phone , every time I want to concatenate 2 strings , I get an error message:

[Code]....

View 4 Replies

Create Strings On The Fly?

Oct 22, 2010

I'm trying to create a number of strings based on one long string that i'm passing.

Basically this is an example of my long string

StrMain = AL123456 - PR123456 - RD123456 - LO123456

So in this case I want to create 4 separate strings.

Str1 = AL123456
Str2 = PR123456
Str3 = RD123456
Str4 = LO123456

But there isn't always that many or there may be more so I need to count how many - there are and with that then create the amount strings needed.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved