|
ns wrote:
Are these 10 characters 10 bytes in memory?
I don't think it will take 10 bytes because VB uses unicode which means 2 bytes per character..
|
|
|
|
|
Thanks! Plus apparently VB uses some space to store the string length..........
Appreciate your help,
ns
|
|
|
|
|
Heres the synopsis:
Heres my problem:
FRom the VB I am sending:
Dim MyString(0 To 2) As String
MyString(0) = "a "
MyString(1) = "aaaa"
MyString(2) = "mmmm"
Call MyCString(MyString(0))
============================
where:
Public Declare Sub MyCString Lib "MyProj.dll" _
Alias "?MyCString@@YGXPAD@Z" (ByVal invar As String)
==========
and in the C dll:
__declspec( dllexport ) void MyCString(char * invar)
{
strcpy(invar+4, "From The C Code");
return;
}
This makes the value of MySTring(0) = "a From The C Code" in VB because the dll did : strcpy(invar+4, "From The C Code");
But how do I change MySTring(1)in the dll ?
Thx,
ns
Appreciate your help,
ns
|
|
|
|
|
ns wrote:
But how do I change MySTring(1)in the dll ?
I think you can increment the address position, something like this, however I know the following doesn't work exactly how you need it to. This atleast provides the idea.
Show(int* x)
{
int* y;
cout *x << endl;
y = x += sizeof(int);
cout << *y << endl;
}
Nick Parker
You see the Standards change. - Fellow co-worker
|
|
|
|
|
hi, i have a problem. I am using Visual Basic and is using File System Object. Now after i create a text file, i want to assign variables..
Dim fso As New FileSystemObject
Dim fsoStream As TextStream
' Create a text file, and return a reference to a TextStream
Set fsoStream = fso.CreateTextFile("c:\junk\junk.txt", True)
' Write to the file
fsoStream.WriteLine "First line in the text file."
fsoStream.WriteBlankLines 2
fsoStream.WriteLine "Line after two blank lines."
fsoStream.Close
Set fsoStream = Nothing
Set fso = Nothing
The letters in bold is the probleam i am having..
i want to assign a variable instead of String text..
Aslo wats the meaning of reading file..i wrote the code but it does nothing
Nash Hon
|
|
|
|
|
it depends on what type of variable is. If it is a string then it is pretty straightforward:
Dim abc as String
...
fsoStream.WriteLine abc
However, if it's some other type, you would have to do some type casting:
Dim abc as Integer
...
fsoStream.WriteLine CStr(abc)
Keep in mind however that some variables cannot be type-casted.
Hope that helps
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
Hi!
I'm quite new at VB, but i've been using VC++ for a while!
I would like to know if there is some function (like sleep in c), that can be used to stop application for a determined time.
I'm aware of timers and little functions (Ex. for loops..., but we don't actually have much control on the time they take...).
Thank you for your time
Rui
|
|
|
|
|
In VB.NET, you can use System.Threading.Thread.Sleep(milliseconds) .
In VB6, you would need to import the API function:
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Thank you very much Richard, its working!
Rui
|
|
|
|
|
I have a service that continually retrieves data from a Web Service and pushes it to our client software. This is extremely easy in VB.NET. However, as our program grows I've encountered 2 problems I'm not entirely sure how to solve:
1) We're beginning to add more data "feeds" (other web services). Some of these provide the same data as others. Some changes are due to cheaper prices, geographic considerations, etc. At any rate, my first problem is how do I create the Web Service Reference dynamically? In other words, I'd prefer to use a configuration XML file to tell my service which web service to use for data and then have my service retrieve the data but I don't see a way to do this dynamically.
2) Let's say I use two different Web Services for something like current weather conditions and each service has it's own format for the retrieved data. I'd like to be able to "massage" this data into the format our application requires (in XML) without having to write parser logic each time we need to support a new format. Is this a good fit for XSLT? If so, could someone point me in the right direction?
Thanks!
|
|
|
|
|
Dim rSQL As String
Dim intID As Integer
rSQL = "Select Max(OrderNumber) from OrderGenerate"
Set RS = Conn.Execute(rSQL)
intID = RS.RecordCount + 1
txtOrderNo.Text = intID
the objective of the above code is to abstract a new OrderNumber from the OrderGenerate table in Access. (OrderNumber is an Autonumber). However, when run, the textbox just show 0 all the time, even tho it should show the current OrderNumber + 1. Why is this? Thank you!
|
|
|
|
|
I'm not sure why the textbox is showing 0, but looking from your SQL Statement,"Select Max(OrderNumber) from OrderGenerate" ,would only return 1 row, the maximum(largest) OrderNumber.Then RS.RecordCount would only return 1, thus your textbox would always remain "2"
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
Someone from a third party vendor has written a vb script for my company. I just wanted to update the script on my own since I can no longer contact the vendor. Here is what he has left us. We have 4 files: .bas, .cls, .exe, .vbp
I'm under the impression that I need to open the vb script and then compile it and should recreate the .exe and everything should work. The problem is I don't know if I have the correct file to open or what vb editor he used and if it is compatible with what I am using. I'm using .net. Any help would be appreciated, and I can give more details as needed.
Thanks,
Dan
|
|
|
|
|
First, this is NOT vbscript.. it is full VB.
Files are as follows:
vbp - Visual Basic project file - This is what you open in the VB IDE to open the project.
exe - Obviously the compiled application.
cls - A class source file. non-.NET versions require that each class be in it's own source file.
bas - A code module. This file holds only code, no form definitions.
By what you have told me I assume that the application does not interact with the user outside of possibly some simple dialog boxes maybe? I say this because you didn't point out any .frm files, the files that hold userform definitions.
You will need to use VB to open this project and recompile when you have made the changes that you need. What particular version I can not say for sure. I would think that it could be anything from Version 4 to 6. Open up the vbp file in notepad and it sould give you some indication of hte version needed if you don't already know.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
|
|
|
|
|
I have Visual Basic. net. When I try to open the .vbp it tells me visual basic 6 migration is not supported with this version. So I'm assuming is version 6. You are right there are no forms and it requires no user intevention. The program simple updates one database and puts it in another so we don't have to do it manually. The problem is I moved one of the databases onto another server therefore the path has changed and it its no longer updating. If I just want to update the program then what would I need to do assuming I have version 6. Do I open the .vbp or what. I see no reference to the path of the old computer in the .vbp, but I do see it in the .bas. Any more help would be appreciated. If you don't want me to directly email you back please let me know.
Dan
|
|
|
|
|
Well if all you have is VB.NET then you are goingt o be in a bind. I belive that you only get the option to upgrade older VB6 projects if you have the Enterprize Architect version. Sounds like maybe you only have Pro. You probably don't want to upgrade the project anyway.
Changing the path in the bas file will only get you so far. You will have to recompile once the change it made. That will require that you have VB6.
If you are in a pinch and don't have access to VB6 (There is a copy in the older MSDN CD's) You can send me the project, let me know what you need changed, and I can rebuild it for you. Provided that you don't reference any other components that I don't have things should be ok.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
|
|
|
|
|
Could someone tell me how to get the short filename from a long filename using VB.NET? In VB you'd have to pull it from the kernel but for one thing I can't seem to get that to work and secondly, I'd prefer to use the proper .NET class/namespace for it if it's available.
Thanks,
Matt
|
|
|
|
|
I don't know how to do this, but make sure that windows does create short
name for it. on 2000 and xp it is turned off by default. an there is no short names for the files.
Die DOS die ...
|
|
|
|
|
dear all,
i want to run my vb exe from the run dialog box in windows with some command line parameters.
how do i read those parameters in vb
|
|
|
|
|
In VB6 you use the Command$ function. It returns a string of the arguments passed into the app. You then have to parse it apart and act on each one.
in VB.NET check this out:
http://www.vb2themax.com/Item.asp?PageID=TipBank&ID=510[^]
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
|
|
|
|
|
nSQL = "Insert Into OrderDetail (OrderNo, ProductCode, ProductDesc, Quantity, Price) Values ('" & strOrderNo & "', '" & strCode & "', '" & strDesc & "', " & iQuantity & ", " & iFullPrice & ")"
Set RS = Conn.Execute(nSQL)
DataGrid2.Refresh
What the above code is trying to do is that when a command button is pressed, the values in the textboxes are saved to the OrderDetail table. However, what I also wish to happen is that the datagrid (the datagrid is bound to this OrderDetails table) is updated with this new record. This is not happening - what am i doing wrong?
Thanking you in advance!
|
|
|
|
|
if the OrderNumber is an autonumber(as opposed to text) in the Order table of the database, is it possible to display this number in a textbox on loading of the order generation form?
Thank you in advance!
|
|
|
|
|
I have doen this in the past by using a separate table that only contains the autonumber feild and a column for a username. I add a new record to the table (by writing the username), to get a new invoice number, then a run a querry that grabs the top 1 from the list with that username. I then use that number in the table that contains the invoice data. Seems to work quite cleanly.
Not sure just how leagle it is with regards to DB theory, but it has worked in the past.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
|
|
|
|
|
Does anyone know how you would detect an mp3 file that's currently playing, through WinAmp or Windows Media Player, and display the song information?
Any help would be much appreciated
|
|
|
|
|
I think, there is no universal way for both players, but at least for WinAmp there must be some way, because some time ago I saw a plugin which writes the currently played song to the mIRC client and also lot of other plugins for WinAmp displays the song info. But this is an issue for the WinAmp Plugin SDK, how it is with WMP, don't know...
Good luck!
|
|
|
|