|
You will need to get the type definitions that are defined in the Windows API from the APIViewer program and include them in your program.
You will Need the BITMAPINFO structure. And the BITMAPINFOHEADER. Look at MSDN to see how to fill both of these structures.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I am working on a project where I need to Launch another program with command Line parameter in VB. The program is MTRUN.EXE from Rational Visual Test. My code works fine on NT and 98 and Win2000 (no Service pack) but it fails on Win 2000 SP1 and SP2 and Win2000 Server.
It will actually launch MTRUN.EXE but then MTRUN.EXE will prematurely die/exit. If I put a break point at the line that will call "CreateProcess" or SHELL, and then use F8, it will work fine...launch MTRUN.EXE and Continue execution as required.
Please what will I do to make it work fine at run mode on Win2000
Bob
|
|
|
|
|
Can you post the code?
Or email it to me and i'll try to help - o_be@hotmail.com
|
|
|
|
|
Here is a SQL string I am execute with an ADO connecion object.
objAdoCon.Execute "insert into MEQUERY " _
& "(MESystemListCode, MEQueryName , MESystemListDesc, MESelect, MEFrom, MEWhere, MEDefaultOrder, MEStoreProc) " _
& "values " _
& "(" & cboSystem.ItemData(cboSystem.ListIndex) & ", " _
& "'Profile', " _
& "'" & Trim$(txtQuery.Text) & "', " _
& "'" & Trim$(txtSelect.Text) & "', " _
& "'" & Trim$(txtFrom.Text) & "', " _
& "'" & Trim$(txtWhere.Text) & "', '" _
& Trim$(txtOrderBy.Text) & "', '" _
& Trim$(txtStoredProc.Text) & "')"
Here is the result of this query..
objADOCon.Execute "insert into MEQUERY (MESystemListCode, MEQueryName , " _
& "SystemListDesc, MESelect, MEFrom, MEWhere, MEDefaultOrder, " _
& "MEStoreProc) " _
& "values " _
& "(3, 'Profile', 'Merchant Search', 'merchant', 'merchants', " _
& "'merchant like '%Bob%'', 'merchant', '')
give this error:
Error #: -2147217900
Error Desc: Line 1: Incorrect syntax near '%Bob%'.
Error Source: Microsoft OLE DB Provider for SQL Server
How can I execute this proc with out having the '' in the query...
Latter
Confusios say "Man who run in front of car get tired, Man who run behind car get exhausted."
|
|
|
|
|
'merchant like '%Bob'' needs to look like this:
'merchange like ''%Bob'''
Basically you want to check all your textboxes for single quotes and replace any single quotes with two single quotes.
You could also try making this a stored procedure and using an ADO command object, it *might* make things easier but I'm not guaranteeing anything. Good luck!
Andy Gaskell, MCSD
|
|
|
|
|
Thanks Andy,
Worked great.
latter
Confusios say "Man who run in front of car get tired, Man who run behind car get exhausted."
|
|
|
|
|
I am trying to use Vb6 to count the number of records of a particular set of fields in Access.So i did the following:-
1) Inserted MSFlexGrid on the form.
2) added a data control to the same form.
3) Set the "DatabaseName" property of the Data control to the name of the database(in Access) from which i'm trying to count the records.
4) Set the "RecordSource" property of the Data control to the name of the table(in the database) from which i'm trying to count the records.
5)Hook up MSFlexGrid control to the data control.
6) Write a SQL statement to select the particular fields I'm Looking for.
Say for instance a table that has fields FIELD1, FIELD2 and i want to list only FIELD1 at "run time".I write the appropriate SQL Statements.
But when i run the code The MSFlexGrid shows all the Fields and not just the field i'm looking for.
SO WHAT DO I DO TO LIST ONLY THE FIELD THAT I AM LOOKING FOR AT RUN TIME IN vb6????
Thanks a lot
|
|
|
|
|
Change the recordsource during runtime.
you might have to modify your datacontrol to use sql statement instead of a table.
Confusios say "Man who run in front of car get tired, Man who run behind car get exhausted."
|
|
|
|
|
Hi,
I have some weird problem and being new to VB I have no idea why it does not work. I created a splash form with a login button. With a successful login the code goes frmSplash.Hide frmMain.Show
This works, now I am on frmMain.Show.
On this form I have 3 command buttons. All I want to do after any command button hit is do frmMain.Hide then i.e. frmAdmin.Show.
Well .Show is not available only ShowWhatsThis? I do not get the frmAdmin to display and I have no clue as to why.
What did I miss?
Thanks
samantha
|
|
|
|
|
I think you'll have to post some code as I can't see how you can be getting the .ShowWhatsThis and not .Show for a Form. How did you create the frmAdmin, using the wizard? If you used the wizard what type of Form did you create?
Michael
|
|
|
|
|
BOYAKASSHAA!!
I'ee agree with Micheal...
Need more input
Confusios say "Man who run in front of car get tired, Man who run behind car get exhausted."
|
|
|
|
|
Make 3 forms.
1 called frmSplash
1 called frmMain
1 called frmAdmin
--- frmSplash code ---
Option Explicit
Private Sub Command1_Click()
If Text1.Text = "username" And Text2.Text = "password" Then
frmMain.Show
Unload Me
Exit Sub
Else
GoTo Wrong
End If
Wrong:
If MsgBox("You have entered a wrong username or password.", vbRetryCancel, "My Project") = vbCancel Then
Unload frmMain
Unload frmAdmin
Unload frmSplash
Else
Text1.Text = ""
Text2.Text = ""
End If
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
End Sub
--- frmMain code ---
Option Explicit
Private Sub Command1_Click()
Load frmAdmin
frmAdmin.Show
Unload Me
End Sub
Thankz, Drew
|
|
|
|
|
The reason ".ShowWhatsThis" and no ".Show" happened because you mustn't of called the "form" function. ie: Command1 function has no argument of .Show, closest match is .ShowWhatsThis
Thankz, Drew
|
|
|
|
|
Has anyone got a simple implementation for this :
I'm working on a web site for a client who has some existing data in x999y format where x and y are alpha and 999 is numeric. Each part of the format varies in length.
I need to be able to sort in the proper order you would expect so that S11B comes after S1VZ (i.e, 11 > 1).
Since this has to run on an ASP page either VBScript or JavaScript would be good (if you can do it in SQL that would be excellent as the DB could do all the work!).
I haven't thought of a fast solution - I've had a looooog week and can't think anymore ....
Thanks in advance, jlb.
|
|
|
|
|
You can do it within the database, in which you may wish to include in your Select statement the same values but put together in another order(i.e. left(some_field, 1) + right(some_field, 1) + substring(some_field, 2, 2)). You would not populate that field, however when the user select the "some_field" column to sort by, you can sort your other column instead. Hope this helps some.
Nick Parker
|
|
|
|
|
Hi
Can anyone tell me how to create a multilingual application in VB?
S.S. Ahmed
ss_ahmed1@hotmail.com
http://glowbutton.faithweb.com
|
|
|
|
|
|
thank you very much
S.S. Ahmed
ss_ahmed1@hotmail.com
http://glowbutton.faithweb.com
|
|
|
|
|
http://www.microsoft.com/globaldev is a great starting point.
|
|
|
|
|
Thanks
S.S. Ahmed
ss_ahmed1@hotmail.com
http://glowbutton.faithweb.com
|
|
|
|
|
I'm looking on suggestion on how to check and see if an application is running. The referenced knowledge base article is old and I was thinking that there has to be a better way of doing this in VB6...
Thanks to those who responded to the original posts!
|
|
|
|
|
I'm not sure what you found in the article, there are two popular techniques.
1. Use FindNextWindow, looking for a window with the same name as yours. If found then exit.
This is the most common method. It fails (or is at least difficult) if the window title is variable or there are many different windows that might or might not be open.
2. Check the list of running processes looking for your .exe name. There should be only one. If two found then exit.
Thanks for the help,
Bill
|
|
|
|
|
Hey there,
I own a very small specialty autoparts store. Mainly we deal on stock parts for classic cars and performance parts for later models and racing teams. I have some very small experience with VB but it's not enough to get me through this program. What I need is simply a way of managing a small inventory of parts in a sequential file database. I'd like to use a .txt or .doc file so I can print easily/email my complete inventory list to customers.
I simply want one form for me to be able to enter new products into this file (I have a product code and some other info. I've already made this form). I then need a restock button to bring up an input box that will allow me to adjust inventory for new amounts.
The only other form is an invoice form for my end only. I want to be able to check and make sure we have enough stock, warn me if we don't have enough and finally just tally a total cost. This invoice just needs to print out to a .txt or .doc as well.
The forms are done. I just need the code. It's mostly basic stuff and I really don't need anything fancy. I'd like it done before Tuesday afternoon, but I'm thinking a good VB coder could knock this out pretty quickly.
I'll pay through PayPal, CC, or Snail Mail. Contact me on my hotmail account as it's easier to check when I'm away.
Reply if you're interested or drop me an email: sammrichardson@hotmail.com
-Sam Richardson
|
|
|
|
|
How can I to load dll "abc.dll" to my project if I want to use in my project the export functions of that dll ???
|
|
|
|
|
Have a look at the code below, this is one way of loading a DLL in VB. Use the loadlibrary function to load the dll.
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" _
(ByVal lpLibFileName As String) As Long
Private Declare Function LoadString Lib "user32" Alias "LoadStringA" _
(ByVal hInstance As Long, ByVal wID As Long, ByVal lpBuffer As String, _
ByVal nBufferMax As Long) As Long
Private Sub Form_Load()
Dim hInst As Long, lResult As Long, x As Long
Dim LCID As Long, sLcid As String
Dim resString As String * 255
Dim sCodePage As String
sCodePage = String$(16, " ")
Label1.AutoSize = True
Label1.Caption = ""
LCID = GetThreadLocale() 'Get Current locale
sLcid = Hex$(Trim$(CStr(LCID))) 'Convert to Hex
' Display decimal value of the LCID (Hex in Parentheses)
Form1.Caption = "LCID " & LCID & " (" & sLcid & ")"
x = GetLocaleInfo(LCID, LOCALE_IDEFAULTANSICODEPAGE, _
sCodePage, Len(sCodePage)) 'Get code page
sCodePage = StripNullTerminator(sCodePage)
' Load dll with string table resource.
' Might need to change path for the resdll.
hInst = LoadLibrary("resdll" & sLcid & ".dll")
' Get string with ID 101.
lResult = LoadString(hInst, 101, resString, 255)
With Label1.Font
.Name = "Lucida Sans Unicode"
.Size = 14
.Charset = GetCharSet(sCodePage) 'Convert code page to charset
End With
' Display the localized string.
Label1.Caption = resString
End Sub
S.S. Ahmed
ss_ahmed1@hotmail.com
http://glowbutton.faithweb.com
|
|
|
|