|
Yeah, I thought you may have forgotten the reference.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Make sure you have the proper DLL referenced in your project or the Import statement will not work.
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
My Blog[^]
|
|
|
|
|
Hi All,
Can someone guide me on how to build a windows application specifically used for batch printing? Please....
besah
|
|
|
|
|
Which bit are you stuck on ? The wizard generates a shell of an application for you, then you need to look up printing support on MSDN, the next step is really to decide where your batches come from, and how to store/edit/run them.
'How do I write this application' is not a valid question, because it's too broad. Tell us which bit you can't do, and what you've done already to try and make it work, and we can point you in the right direction.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanx a lot for your reply.
Actually,I haven't started to build it yet because I have no idea where and how to start to write the codes.Does it requires the same way to write the codes like a standard vb.net program?I am totally blank to write the codes.Therefore, i need a guidance from the beginning... please...
besah
|
|
|
|
|
It's not the worlds most complex program. It has printing support, just like any app that has printing support, but it prints more at a time than most apps. Which would be controlled by a loop.
What issues were you expecting that would make a program whose job is to print a lot of stuff to be fundamentally different from any other app ? ( I'm not being sarcastic, I'm wondering if there's a detail here that you've not explained yet )
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Events wont fire for MeasureItem and DrawItem when attempting to create an owner draw context menu for a notify icon. I even tried to use this article http://msdn.microsoft.com/msdnmag/issues/04/02/CuttingEdge/default.aspx which features a control that is supposed to extend the capabilities of the standard MenuItem class to include customizations on color and Icon and although it works fine for context menus of other controls it just wont work for a NotifyIcon control.
Can someone please confirm if this is indeed a bug and maybe give some info on where this should be reported?
|
|
|
|
|
i want to get all data from that existing Databse and i need create a new XML file,
In my database These are the two field names already in the database
Name
anddress
after creating a XML file i need have a reed and write facility also
how can i do this work using vb.net
thank u all
suis
|
|
|
|
|
Write a stored procedure that returns XML. Then put it in an XML document and use XPath to find nodes you want to delete or edit, and add nodes in the usual way.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Stored procedure doesnt work on the ms access database then how can i do this work !
suis
|
|
|
|
|
Does Access offer XML support at all ? If not, I recommend you use MSDE in future, it's more of a 'real' database.
In that case, you need to select all your data, and iterate through the rows and columns, using an XmlWriter to build the XML document as you go.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
The quick and easy way: Read your data from access into a dataset. Then you should be able to save your dataset as xml.
The not so easy way: Use XmlWriter or XmlDocument. I prefer using XmlDocument, because I can have full control of every element in case you need to make modifications to the data you read.
|
|
|
|
|
If anybody know how to do this .
I have set of images in the folder and i just need show those images
to a perticular form like thumbnail images wise using vb.net.
how can i do this ?
if anybody know help me to solve this problem.
suis
|
|
|
|
|
You can put the images in a picture box, which you can dynamically generate, and get it to show the image stretched ( then it will size it to the thumbnail ). I don't think VB.NET is anywhere near powerful enough for you to read only part of an image to create a thumbnail, nor is that really viable anyhow for jpgs, or other compressed formats. If you get into memory issues ( and you well may ), then you should create smaller images out of the big ones, and use those.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Can u give me some sample code for this ?
suis
|
|
|
|
|
Bitmap bm = Bitmap.FromFile(mypath)
Bitmap thumb = new Bitmap(20, 20, PixelFormat.24bit)
Graphics gr = Graphics.FromBitmap(thumb)
gr.DrawImage(bm, 0, 0, 20, 20)
gr.Dispose()
bm.Dispose()
This is pseudocode, don't copy and paste. I load a bitmap, create a smaller one to hold my thumbnail, create a graphics object that draws to that bitmap, and draw the image scaled onto the graphics object. Then I dispose of the graphics object and the bitmap ( if you were using C#, I'd recommend the 'using' statement, but VB.NET does not offer it ).
This does not take into account issues of aspect ratio, nor does it set a stretch drawing mode to increase quality ( a thumbnail will never be high quality, however ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello coders,
I am trying to seperate one line of vb code into lines by vbcrlf (carriage return - linefeed) or the colon : characther
As you know
Dim i: i=3
statements are exactly the same as
Dim i
i=3
I have the following code to be seperated.
Dim input As String = "Function X(i As String):Dim q As integer=" & vbCrLf & "Dim P as byte"
Normally , If I use the
Dim pattern As String = "[\n|.*:*.]"
pattern
it will be seperated into three lines (as I wanted)
But If I use the following line , it will be into 4 lines (I do not want it to be happened)
Dim input As String = "Function X(i As String):Dim q As integer=""q:p""" & vbCrLf & "Dim P as byte"
I need to modify the pattern, which will not accept colons inside quotes.
How can I do that?
Thank you for you time
Emre YAZICI
Best Regards
Emre YAZICI
|
|
|
|
|
Use a group like this: ("".*:.*"") to match a colon within quotes. Then fit that in so it will find those anywhere, and ignore them.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am writing a console application that compares file versions. I can retrieve the file version but i need to compare if file version is less that what i specify that it should be.
It's a simple security patch checker. Here is my file version: "6.00.2800.1622".
Here is the code:
Dim filever as string = "6.00.2800.1622" 'this is example, i get the file version from FileInfo
Dim myfilever as Integer = Ctype(filever, Integer) <-- this line throws an exception
I also tried Integer.Parse method, still same error. I am able to do this in Windows Forms application. Why is console application different, and how can i accomplish this? Any help on this would be appreciated.
Enes M
|
|
|
|
|
|
The problem is that those points in the string make it an invalid number. If the output of the string as a number should just be something like 60028001622 (without the points) you should first remove the points:
filever = filever.Replace(".", "")
Another problem could be the size of the resulting number. Try to use long (or even decimals) to be able to work with larger numbers.
But the better (although a bit more complicated) way would be (like Colin already stated) to split your version into several numbers and test every number separately.
|
|
|
|
|
Thanks Colin and Robert.
After doing some testing, the best way to compare the version is what Colin suggested (split the version into several numbers and compare each one, and set the flag if file version is less).
Although at first I thought that Decimal data type would be appropriate for file version format(6.00.00.2825), but Decimal only accepts one point(.) and 28 places to the right of the decimal.
So my only or best option is splitting the number and comparing each one.
Thanks guys for the help!!
Enes M
|
|
|
|
|
Hi i using this Sample for VB.Net
http://www.freevbcode.com/AuthorInfo.asp?AuthorID=6163
I need update for Close Connections.
API is : SetTcpEntry
Declare Function SetTcpEntry Lib "IPhlpAPI" (ByRef pTcpRow As MIB_TCPROW) As Integer
Inside Command1_Click and area With TcpTableRow, inserting this code for test :
If CStr(GetTcpPortNumber(.dwRemotePort)) = "1452" Then
MsgBox("Found")
.dwState = 12
SetTcpEntry(TcpTableRow) --> BreakPoint
End If
1452 is remote port the my Laptop connected to Game Server in my PC.
I looking using Netstat -n
This Stop in BreakPoint but not Close Connection.
ny idea or Sample Code working ?
|
|
|
|
|
i m using an ASP.NET Web Appication n want to open Text files, PDFs and images on the VB.NET interface... so wat are the components which i need to open these files...
so far.. the images are being opened in Internet Explorer only.. which i dont want.. i want a specific component for both images and text/PDFs
need help how to do this ...
|
|
|
|
|
The System.IO namespace contains all you need to read/write text files. The Bitmap class in System.Drawing will open a bitmap from disc, and allow you to access it's information if you need it. There is no PDF support in .NET, that's why people advertise on this site selling PDF components to plug into .NET. However, a PDF is just text, so if you don't want to display it, you can read it the same as a text file. If it's not compressed ( which is rare ), you can even make changes, so long as the text you add is the same length as the text you remove.
Christian Graus - Microsoft MVP - C++
|
|
|
|