|
Do you mean through VB or just visualy through windows?
Second option: Click Control Panel, System, Hardware Tab, then Device Manager
Later
|
|
|
|
|
In code, you could use the System.Management namespace and WMI.
RageInTheMachine9532
|
|
|
|
|
thank you i will try it out
|
|
|
|
|
In code, you could use the System.Management namespace and WMI.
RageInTheMachine9532
|
|
|
|
|
I've created a crystalviewer control on the form. now I want to scroll the CR control by mouse wheel.
I use the MOUSE_WHEEL(event) to get the value of e.delta. but should i do when e.DELTA=120 or -120 to scroll the crystalviewer.;)
got another question but this one is a hell for me.
|
|
|
|
|
I wonder why streamwriter.writeline does not do what it is supposed to do? For example, in the following code, I try to write 5000 lines to a file, then I found after writing about 4800 lines, the precedure exits without any error. This did not caught my attention until the other day I tried to write some database records to a text file and it never finish writing up all of the records. However, response.write would faithly do the work for me. Why?
Private Sub testSW()
Dim i As Integer
Dim sw As StreamWriter
sw = New StreamWriter("c:\test.txt")
For j = 1 To 5000
sw.WriteLine(j & " test@test.com")
Next
End Sub
|
|
|
|
|
You need to call Close and Dispose at the end of the sub.
Due to technical difficulties my previous signature, "I see dumb people" will be off until further notice. Too many people were thinking I was talking about them...
|
|
|
|
|
thanks. I am a little dumb, to be honest. Sigh ...
|
|
|
|
|
i require the code which can automatically change screen resolution
Sachin323
|
|
|
|
|
Automatically change the resolution based on what?
Changing the screen resolution is a concept best left to games, in which case you would use either DirectX or OpenGL. Changing it in a normal Windows app is VERY bad practice.
RageInTheMachine9532
|
|
|
|
|
Hi, EveryBody,
I want to display pictures stored in a database. First I use the following code(VB6) to save the picture to the database:
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim stream As New ADODB.stream
Set cnn = New Connection
cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=H:\test.mdb;"
cnn.CursorLocation = adUseClient
cnn.Open
Set rst = New Recordset
rst.ActiveConnection = cnn
rst.Open "t1", cnn, adOpenKeyset, adLockOptimistic
rst.AddNew
rst!p_name = "dd"
stream.Type = adTypeBinary
stream.Open
stream.LoadFromFile "H:\pp.jpg"
rst!pic = stream.Read
Set stream = Nothing
rst.Update
cnn.Close
------------------------------
and then I use the following code(ASP) to display the image:
<%
Dim cnn
Dim rs
' Clear existing HTTP header info
Response.Expires = 0
Response.Buffer = TRUE
Response.Clear
' Set the HTTP header to an image type.
Response.ContentType = "image/JPEG"
cnnPubs=getdbconn() ' the function return the db connection
set rs=server.CreateObject("adodb.recordset")
rs.Open "SELECT FROM t1where id=1",cnn
Response.BinaryWrite rst("pic")
Response.End
%>
and I use to show the image.
the first(vb) code works well.
but I alway can not display the image, I just got a image like red X.
please help me to solve the problem.
Thanks a lot!!!
Best!
Alan
|
|
|
|
|
I have to be produce a zoomed in image of a picture that is displayed. in a seperate box to the reg size image. I have the cooords and dimensions of the area that I want, but I cannot figure out how to either extract part of the image or simply copy the image and then zoom in.
This is the AxImgEditLibCtl that I am referring to. I tried to create a graphics object, and use the methods that it provides, but because the initial image that I am using is a .tif like file there is a number of images contained within it, and therefore the graphics class doesn't work (I have tested with simple gif and jpegs and it does work)
If anyone has worked with this class before I would appreciate some input because I have tried for way too long and have only gone in circles.
Thanks
|
|
|
|
|
It would be cool if I cold some how obtain an image or bitmap of the picture that is currently being displayed
|
|
|
|
|
I have a VB6 program that needs to reference the Microsoft Outlook 9.0 Object Library since it will be running on a machine the still uses Office 2000. The machine I want to compile the program under uses Office 2003 which uses the Microsoft Outlook 11.0 Object Library. When compiled under this machine it will not run on the Office 2000 machine because it cannot find the object. Is there a way that I can ad a reference in VB6 to the 9.0 Object library? I can compile under a 2000 machine but I want to avoid that if possible. Thanks!
"It has become appallingly obvious that our technology has exceeded our humanity."
- Albert Einstein (1879-1955)
"I think there is a world market for maybe five computers."
- Thomas Watson (1874-1956), Chairman of IBM, 1943
"640K ought to be enough for anybody."
- Bill Gates (1955-), in 1981
"Half this game is ninety percent mental."
- Yogi Berra
|
|
|
|
|
You cna't do it unless the machine you compile the app on actually has Office 2000 on it. Any machine your app runs on would need Office 2000 on it. You referencing any version of the library will not give your app the ability to use any version of Office. The machine MUST have the version of Office that you compiled against.
RageInTheMachine9532
|
|
|
|
|
I had this same problem with using the WORD and EXCEL object libraries. The following example I'll use is with WORD, but you can modify it for your own project.
Dim wA as Object<br />
Dim WordWasNotRunning as Boolean<br />
<br />
Sub Test()<br />
On Error Resume Next<br />
Set wA = GetObject(, "Word.Application")<br />
If Err Then<br />
Set wA = CreateObject("Word.Application")<br />
WordWasNotRunning = True<br />
End If<br />
On Error Goto 0<br />
<br />
<<Insert Code Here>><br />
<br />
If WordWasNotRunning then wA.Quit<br />
Set wa = Nothing<br />
End Sub
This code creates an object and then by using the GetObject/CreateObject opens whichever object library is installed on the machine. The boolean is so that you do not close the Word application if they already had it opened with another document, if you don't do it this way, then you will leave multiple WinWord.exe processes running on the machine and your program will crash after you have initialized it at least once. (MAKE SURE YOU DESTROY THE OBJECTS!!)
HINT:
Design your program first by loading the object libraries for Office so you can debug the program and get the helpful dropdown menus. Then before you compile it, change the code to the code on top and get rid of the library References. I also found out that older versions of office do not use the same constants (i.e. wdStory, etc.), so use the actual values like '6'. Hope that helps.
-Garrett
|
|
|
|
|
Yeah thanks...I found that the CreateObject lets me do "late binding" so that I can reference whatever object library is installed on the machine. I'm not at work so I can't post my code but when I get back on Mon. I may post a little of it. The Outlook object lets my reference folders such as my inbox with numbers like 6 (which is my inbox on my machine) and it compiles and runs fine on my machine that runs Office 2003 without having to reference the outlook obj library. Then I emailed the exe to the guy that sits behind me who runs Office 2000 and when he ran it, it threw a run-time error. I think it has to do with the 6. I tried something like olFolderInbox but then it wouldnt build. I'll have to post some code...
"It has become appallingly obvious that our technology has exceeded our humanity."
- Albert Einstein (1879-1955)
"I think there is a world market for maybe five computers."
- Thomas Watson (1874-1956), Chairman of IBM, 1943
"640K ought to be enough for anybody."
- Bill Gates (1955-), in 1981
"Half this game is ninety percent mental."
- Yogi Berra
|
|
|
|
|
I have a String being sent to an Excel spreadsheet through a VB.NET application. The string is loaded from a database. An example is "00001".
I export the data to Excel using the following code:
mExcelApp.Worksheets(1).Range("A1:A1").Value = "00001"
But everytime it formats it as an integer so it becomes "1".
How can I change it?
Also, is there a statement to autosize column widths...?
HELP ME!
Any good web-sites on this?
Thanks in advance.
Regards,
Erik J. Long
|
|
|
|
|
You could either change the Format of the cell to Text or send the string with a single quote prefixed to it:
mExcelApp.Worksheets(1).Range("A1:A1").Value = "'00001"
RageInTheMachine9532
|
|
|
|
|
[In reply to your other posting...]
As is often the case, Dave beat me to the punch. I was gonna say the same thing, dammit.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
RageInTheMachine9532
|
|
|
|
|
The cells in Excel are by default set to General and Excel formats them based on what it thinks you have entered in the cell, in this case any number padded with leading zeroes will be reduced. You can change the format of the cell in code with:
MyExcel.MyWorksheet.Cells(1,1).Numberformat="@"
However, when I've done this it caused a strange display problem when the text was very long. Another way to force it to display as you type is to put an apostrophe "'" before the text. The apostrophe won't appear in the cell's display but will in the fx bar across the top.
There is an AutoSize column width method but the syntax escapes me for the moment. Whenever doing anything with Word or Excel, record a macro of you doing it manually. This can be found in Excel in Tools->Macro->Record Macro. It will show you the syntax of any command you have performed.
Hope this helps.
|
|
|
|
|
Hi there guys.
Have a little problem. I need to search through a Word doc, and highlight all occurrences of what we are calling "tagged fields". A tagged field is in the format <<sometext>> (eg. <<name>> or <<addr1>>
Am having a problem with getting word to find these fields. If I search for "^50^50" (<<), then it finds OK, ditto "^52^52"(>>), and if there is a single char between the tags, the ^50^50^$^52^52 works fine. Unfortunately, the text may be of different lengths. Aha - can use the * wildcard! Unfortunately not....when attempting ^50^50*^52^52, keeps telling me that invalid pattern match is being used, since need to explicitly use wildcard matching.
Any ideas anyone?
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
S'ok - cracked it....just use an escape char '\', so to find my fields, I have used
\<\<*\>\>
with wildcards turned on.
Simple really!
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
I've been trying to use the databinding directly to an ADO recordset. Everything works ok except if someone else changes a Record in the source, the DataCombo/list do not see the change. Same if a record is added or deleted. How would I program this to see any changes/Additions? My programs are all shared, using a Database on a server.
|
|
|
|