|
Hi all..
I use the web browser control on a vb6 form ..
the problem is :
if the user choosed to work offline (from Internet Explorer) the (connect / stay offline)dialog appears as soon as the form loads (before i try to navigate any page)
I want to prevent this from happenning ..
any suggestions?
|
|
|
|
|
Try stopping the browser firing till your ready. Look Here
|
|
|
|
|
Dim RS As AdodB.Recordset
Set RS = New AdodB.Recordset
Dim intCurrentRecord As Integer
Dim iOrderNo As String
Dim strProductCode As String
Dim strDesc As String
Dim iQuantity As Integer
Dim iPrice As Integer
iOrderNo = txtOrderNo.Text
strProductCode = Adodc3.RS("ProductCode")
strDesc = Adodc3.RS("ProductDesc")
iQuantity = Adodc3.RS("Quantity")
iPrice = Adodc3.RS("Price")
With intCurrentRecord
Dim editSQL As String
editSQL = "update OrderDetail set ProductCode = '" & strProductCode & "', ProductDesc = '" & strDesc & "', Quantity = " & iQuantity & ", Price = " & iPrice & ""
Set RS = Conn.Execute(editSQL)
End With
the (intended) purpose of the above code is that when the user pressed the edit button, having changed the details of the current record in the datagrid, that the SQL statement would execute the update. however, i am not referring to this current record properly, it is not recognising it, throwing an error of "method or data member not found", what can i do to fix this? thank you!
|
|
|
|
|
I wrote a multi page tiff editor. User can draw rectangles and delete pages. Another function is that you can convert .tiff files to PDF. I used Acrobat plug in for that. Every thing worlks fine. But the problem is that sometimes when the conversion is done, some random pages background is black in PDf. Can't figure out if is an Acrobat conversion issue or .Tiff issue when it is edited. If anyone had this problem, please let me know. Thanks a lot.
Zulfikar Ali
|
|
|
|
|
hi everybody!
I have a question. I'm working on a program for win98 that needs to copy large files over the network and i want to display a progress,
so the use does not try to close my program thinking it hung.
I know the is way to make the shell copy a file, but i can't remember it.
Can anyone please let me know how it is done.
(i can not use copy with progress, 2000 and xp only)
and I want to do it through api
Thank you in advance
ilya
|
|
|
|
|
|
Thank ! Thank ! Thank very much!
|
|
|
|
|
I would like to know how to print using VB.NET in a WEB FORM, NOT a windows form and NOT in plain vb. All the links on the net say how to do it using these last two rather than vb.NET WEB forms, and I cannot convert the code to vb.NET!!I don't want any user interaction so I want to be able to set the printer, and all printer settings from the code. I have been searching frantically and have not been able to find anything on the net. I want to print an html file, as it is seen in a web browser, not the html code
|
|
|
|
|
Can object names be designated in (VB.NET) dot syntax on the fly? e.g., in c#:
for (i=0;i<5;i++){
["bullet" + i].Text = list.ChildNodes[i].InnerText;
}
...would work, but this VB doesn't seem to:
For i = 0 To 4
("bullet" & i).Text = list.ChildNodes(i).InnerText
Next i
Is there a syntax in VB.NET that allow such a thing?
|
|
|
|
|
("bullet" & i). is interpreted as a string, try using the same syntax as in c#
["bullet" + i].Text = list.ChildNodes(i).InnerText
|
|
|
|
|
Yeah, I tried that first, but VB didn't seem to like it either.
|
|
|
|
|
For i = 0 To 4
("bullet" & i).Text = list.ChildNodes(i).InnerText
Next i
I didn't think it would work, that would 'break' vb's typing. I think that was part of the argument when they re-wrote sections before release. VB programmers panicked when they say what the new language was like. Personally the nearer to c# (apart from readability) the better.
|
|
|
|
|
I have in my VB:
Call MyCString(myStringCopy, k, lengthOfStrings)
with:
Dim myStringCopy As String ' no fixed size
Dim k
Dim lengthOfStrings
Dim MyString(0 To 2) As String
MyString(0) = "a"
MyString(0) = Left(MyString(0) & String(10, Chr(0)), 10)
MyString(1) = "bbbb "
MyString(1) = Left(MyString(1) & String(10, Chr(0)), 10)
MyString(2) = "mmmm"
MyString(2) = Left(MyString(2) & String(10, Chr(0)), 10)
For i = 0 To 2
myStringCopy = myStringCopy + MyString(i)
Next
===========
Public Declare Sub MyCString Lib "MyProj.dll" _
Alias "?MyCString@@YGXPAD@Z" (ByVal ByValString As String, numberOfStrings As Long, lengthOfStrings As Long)
====================
The C dll:
i
nt MakeArray(char* ByValString, int numberOfStrings, int lengthOfStrings, char*** pStringArray)
{
int i;
*pStringArray = (char**) malloc(numberOfStrings*sizeof(char*));
if (!(*pStringArray)) return(1);
for (i = 0 ; i < numberOfStrings ; i++)
{
(*pStringArray)[i] = &(ByValString[lengthOfStrings*i]);
}
return(0);
}
__declspec( dllexport ) void MyCString(char * ByValString,int numberOfStrings, int lengthOfStrings)
{
char** stringArray;
rtnVal = MakeArray(ByValString, numberOfStrings , lengthOfStrings, &stringArray);
printf(stringArray[1]);
free(stringArray);
}
I get bad dll calling convention.
Please help!!
Appreciate your help,
ns
|
|
|
|
|
As I understood the description, you exporting some function from the C++ code (assuming from the way the name of the function is decorated). As the rules for formatting the name are not standardized in C++, it is allways a good idea to use old plain C exports (adding extern "C" keyword to the function declaration).
Also you have to specify the calling convention when exporting function from DLL. If I am not wrong, it should be the __stdcall for DLL exports.
Next thingie - I guess, that the String type in VB is mapped to the BSTR in C/C++, not to the char directly, so I guess you have to change the declaration and be prepared for receiving the UNICODE strings.
Hope this helps, but don't blame me if not
|
|
|
|
|
Erm....haven't looked in any detail, but would guess the problem is caused by you declaring variables without specifying a type (Long int et). By default, in VB6 any typeless vars are VARIANTS - and your function needs longs....
|
|
|
|
|
dear all,
how do i access ini files using vb6?
Also is there any function (api or vb) through which i can know the file system on my disk
<marquee>rishabhs
|
|
|
|
|
uhh...the same way you access text files, with FileSystemObject
Dim fso as FileSystemObject
Dim txtStr as TextStream
Set txtStr = fso.OpenTextFile(file path)
Do While Not(txtStr.AtEndOfStream)
txtStr.ReadLine
Loop
rishabhs wrote:
Also is there any function (api or vb) through which i can know the file system on my disk
What did you mean by File System ? FAT32 and NTFS ??
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
|
|
|
|
|
thanx for ue concern "Notorious SMC"
yes by file system I mean FAT32 or NTFS.
how can i find out the filesystem on my harddisk along with the volume labels and partition size?
<marquee>rishabhs<marquee>
|
|
|
|
|
I personnally use the windows API. I declare this :
Public Declare Function GetPrivateProfileString _
Lib "kernel32" Alias "GetPrivateProfileStringA" _
(ByVal lpApplicationName As String, _
ByVal lpKeyName As Any, ByVal lpDefault As String, _
ByVal lpReturnedString As String, _
ByVal nSize As Long, _
ByVal lpFileName As String) As Long
Public Declare Function WritePrivateProfileString Lib "kernel32" _
Alias "WritePrivateProfileStringA" _
(ByVal lpApplicationName As String, _
ByVal lpKeyName As Any, _
ByVal lpString As Any, _
ByVal lpFileName As String) As Long
to ba able to use the API function, then, in my code, when I want to read a parameter in the .INI file, I do this :
Dim l_sStringRead as String
Dim l_lRet as Long
l_sStringRead= " "
' I do this to allow some memory for the string which will be passed
' as a parameter
l_lRet = GetPrivateProfileString("Section", "Parameter", "DefaultResult",_
l_sStringRead , Len(l_sStringRead ), "MyINIfile.INI")
l_sStringRead = Left(l_sStringRead , l_lRet) ' l_lRet = length of string returned
If you want to write into the INI file, use this :
Dim l_lRet as Long
l_lRet = WritePrivateProfileString("Section", "Parameter", _
"ValueToStore", "MyINIfile.INI")
Hope this helps !
Jerome
|
|
|
|
|
I have:
MyString(0) = "a"
MyString(1) = "bbbb "
MyString(2) = "mmmm"
What I want to do is make each element 10 characters long with
1. zeros in the extra spaces
and
2. blank spaces.
So that
MyString(1) = "bbbb000000"
or
MyString(1) = "bbbb "
Are these 10 characters 10 bytes in memory?
Appreciate your help,
ns
|
|
|
|
|
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
|
|
|
|