Mr.M 89 Future Programmers

@Null well the article that I came across when doing this research did mention something about driver but I didn't understand that part of driver but I think you have some information on this because the article suggested that I create the driver first then this engine and other engines that I will be using within my project.

The problem is that I'm new to C language so that's why I want to do this project in VB.NET but VB.NET lack most of the powerful features which C++ provide within this project so what I thought was to make the engines in C++ then the whole project be in VB.NET and VB.NET will receive data from the engines and will also send data/commands to the engines as well.

Do you @Null have any guide, tutorial, or anything that may help me in developing this driver in C++?

@Ketsuk Yes the engine is in Kernel Mode.

Mr.M 89 Future Programmers

Hi Dw.

I'm developing a software but now due to some complexity of the program I had to do some engine with C++ and I want to be able to call and receive the events from a service. Here's the C++ code that receives calls when an application tries to execute the code is for listening to these events at an OS level so I want to be able to receive events from this file I think I will make it as a DLL file and a VB.NET program will receive these events or show these events (pass it from dll to VB.NET form)

 NTSTATUS.PsSetCreateProcessNotifyRoutine Ex(
    _In_   PCREATE_PROCESS_NOTIFY_ROUTINE_EX.     NotifyRoutine,
   _In_ BOOLEAN                           Remove
 );
Mr.M 89 Future Programmers

Can you clarify what the button you want it to do and what are those 7 options and how you want to use them.

Mr.M 89 Future Programmers

I don't get you straight

Mr.M 89 Future Programmers

I thinks this whole changing has a bad impact simply by looking on the threads, I also have a thread which was in a middle of being answered but now its quite and even the rate of answering post has dropped way down compared to the previous theme. I now just be even lazy to open this site because finding new and unanswered post I have to first type the tag then click New for new post and so on. Just check and compare the rate of posts and comments on posts and compare with older them and feature, this changing just pull me down when ever I think of opening the site, but maybe its because I'm not familiar with it yet, but I find usage gone down/ dropped.

Now mostly you find people like Jim, and others those are high rated the ones that are active in commenting in posts. Check by your self and see, most posts only have comments from those high ranked people.

The question is why? Its surely not the complexity of the questions asked but I think other people are experiencing what I'm experiencing to be lazy now to scroll, search, the older system/theme was a piece of mind, easy, and simple, its makes you active even on finding questions/posts.

Mr.M 89 Future Programmers

I think the OP means Visual Studio

Mr.M 89 Future Programmers

But the site is also not compatible with all devices. I'm using BlackBerry and for me I can't find the search button or field, the old feature was good because on my Watched Articles I would simply click let's say I want to go check the new posts under VB.NET then I would simply click the link within my article or any article that's under the forum I want to go to and I would be presented with that list that shows which article has been updated, which one is new, when it was posted, how many people have viewed it, how many replies are there currently. I think that was best especially spotting the articles and click to see only new or unanswered ones and so on.

Mr.M 89 Future Programmers

Well for me I would start by asking if there is some sort of new daniweb theme guide to how we now find like Watched articles, Market, etc. What is still there and what is not because I normally access dani with a cell phone and it was all changed up. I accessed it using laptop yesterday and I thought it was just a few changes I thought the site was the same layout on big screen but was a surprised to see its completely different.

For tagging I think if all the relevant post will be found in one place like if I can click a vb.net button and see vb.net post despite the search then it would be great, this is because I find it irritating on stackoverflow to keep clicking that top button which shows a sort of drop down with all the post you have posted in order to shift the forums, like to move from vb.net to let's say java I have to do that and that only if I had ever posted on java otherwise I will have to search java then scrawl which switching the forum is a bit not so friendly at least for me.

Mr.M 89 Future Programmers

@Jim the script when I run produce this error:

Script: C:\Windows\system32\StripBlanks.vbs
Line: 5
Char: 1
Error: The handling is invalid
Code: 80070006
Source: (null)

Any reason why I'm seeing this error when trying to run your script?

Thanks.

Mr.M 89 Future Programmers

How?

Mr.M 89 Future Programmers

@Jim. Normally there are no blanks because every count is written on a new line but the file I think got some few blanks at the end of which I also don't want them because it will produce problems such as this I'm having and also when I want to get the total lines are there in a file. So I don't think a script will damage course I don't want the blanks on a file.

Mr.M 89 Future Programmers

Just tried the above but still the label is blank. I think if I could be able to remove the blanks I will end up with the last known count. Is there a way to remove the blanks at the end of text file without reading the entire file because the file is large, its can't be opened now on my computer my RAM has low memory.

Mr.M 89 Future Programmers

Well I don't think your code is VB.NET, I think that's a C#.

Mr.M 89 Future Programmers

@Jim, let's me just enlighten you what I'm doing. I have program1 which performs a count and for each count its writes it on the file the format is "00000-00000" its started like this: 00000-00001, 00000-00002, 00000-00003, 00000-00004, 00000-00005 now its around 00520-98164 its will stop at 99999-99999

I haven't added the code to read the last line and extract each digit so that the count will continue because I will have to extract each digit to its own variable for easy of counting.
So for now I use the program2 to get the last written count and populate it on the label then I type that value on program1 code (variables)

@Tinstaafl thanks, will try out that and see.

Mr.M 89 Future Programmers

Hi Dw.

I have a very huge text file with size "662 MB" and its can't be opened by a notepad on my computer so I created a program to only read the last line because there is a software that is writing to this file some counts, so I don't want the counts to be repeated so if the computer happens to shutdown or crash, I use this program to read only the last line of this file and populate the text on the last line.

Now the problem is that I don't know what happened but a battery was drained and the laptop shutdown and someone tried to turn it on but that coursed the computer to dump everything because the battery was already low. Now the problem is that the program the time the computer was started while the battery was drained the program only wrote a blank on a text file so the last line is blank.

How can I read the secondlast, thirdlast line on a text file?

Here is the code I use to read only the last line.

 Using sr As New StreamReader(File.OpenRead("D:\test"))
 Dim LastLine As String, I, J As Integer, P As Long
 Do
     I = 0 : J += 128 : P = sr.BaseStream.Length - J
     If P < 0 Then P = 0
     sr.BaseStream.Position = P
     Do
         LastLine = sr.ReadLine : I +=1
     Loop Until  sr.EndOfStream
 Loop Until I > 1 Or P = o
 sr.Close()
 lblDisplay.Text = …
Mr.M 89 Future Programmers

You can do it like this:

 Private Sub Form_Load()
 ' Disable the next button so that it won't be clicked.
 CmdNext.Enabled = False
 End Sub

On button ok you can enable the next button.

Mr.M 89 Future Programmers

Hi Dw.

How to check if the running process has been injected by another process or there is another process running as another process.

What I mean is, let's say the explorer has been injected by another process and both these processes run as one process and the explorer process will normally consume lots of memory when being injected, so the main question is how to get this, or I will have to use the hashing?

But I think hashing will course problems as if a new or another explorer is opened, but I'm not sure of this yet.

Mr.M 89 Future Programmers

You mean before or during the uninstallation process?

Mr.M 89 Future Programmers

@Minimalist, yes thanks didn't notice that error while typing.

@Arun_14, I believe you can minimize the number of buttons by either placing your similar or relative codes on one button and separate by "IF" statement or even place them on a function.

Also instead of:

 If Add = True Then

You need to do it like this:

 If Operation = ("your operation here") Then
 ' That was your first operation so do your first calculations here
 RunningAnswer = Value1 (your operation here) Value2
If RunningAnswer IsNot Nothing And SecOperation = ("your second operation here") Then
 Answer = RunningAnswer (your second operation here) SecValue2
 ' Then you can go on adding the else and repeat the above if statement
 ' To ensure you recognize all the operations.
 End If
 End If

This is because the use may not always want to use both same operations, this will help if there are also a mixture of operation such as: 5*2-5 or 20/2+8, etc.

Mr.M 89 Future Programmers

For the error in conversion, that's means maybe the imputed data are taken as string or the problem is that you do not take care of the operations (signs {+,-,/,*}).

Coming to your actual problem of not getting the desired answer, this can be coursed by you not taking care of the signs, if I were you I would declare a variable that will hold the operations so that they won't interfere with your calculations. If you had done that you would also declare variables to hold the values.

On mine I made mine to be able to hold 2 values and one operation, meaning the calculation is like this (1) (+) (1) right, on the left I have the first value and at the center I have the operation then on the right I have the value again so I would have 3 variables to hold value one, value 2, and then the operation and you would simply check which operation was used then process like this:

 If Operation = "+" Then
 Answer = Value1 + Value2
 Else
 If Operation = "-" Then
 Answer = Value1 + Value2
 End If
 End If

Now coming to your problem you simple need to add another variables which will hold the third value and the second operation then proceed with your calculations.

Mr.M 89 Future Programmers

Yes. Thats true. Will try investigating code of doing this because I haven't done this. Is it also possible to it the condition was met to redirect the user from this site to another. This is similar to login, except that its only has one input text which is validated and once valid normaly you are redirected to where you want to but I want to redirect to specific site, or getting the response as valid or invalid?

Mr.M 89 Future Programmers

Hi Dw.

I would like to know how can i auto type and submit a form using vb.net, I'm not using Webbrowser or should I use it? I just saw another post similar to this except that the OP requested to auto click the button. What I want is to type on a website form and submit and get respond back.

The website only has 1 textbox and 1 button.

Thank you.

Mr.M 89 Future Programmers

Well for me I will say first of all, you need to have love, passion, of programming, then the term "Creative" is kinder broad in programming as there are many things you can be creative on within software development which may include (Creative GUIs, Creative Protocols your software will follow, Creative use(encryption, etc))

So secondly you will have to simplify the term Creative to how your software will be in terms of GUI, how your software will function, how its saves/transfer data, how data is accessed those are the things you must be creative on so that your software will be unique and also if its deals with valuable information it won't be that easy to be hacked, but for that you need to be able to think out side the box and conduct tests to ensure that is safe and its not hacked easily.

1) Get basics of Programming
2) Have passion, and love for it as it sometimes make you even think of throwing your laptop away, but remember its all about love, passion.
3) Get idea of your software
4) Plan your software activities step by step.
5) Start developing piece by piece of the steps.
6) If you are stuck feel free to ask and show us where you stuck, if we could we will help you out where you stuck.
7) Finish your project (software).

Its that simple but don't forget its also stressful but that's how it is, …

Mr.M 89 Future Programmers

@IPSWITCH how?

Mr.M 89 Future Programmers

I think what you will need is something like this "For i As String = F To O" but not sure if it works with alphabets and a you can notice I didn't add the "Step" because I don't know how in alphabets but in numbers the step would be "1" or "-1".

Then in your code you would need to change "F" to "i".

Mr.M 89 Future Programmers

Hi Dani.

I was wondering is it possible to add a feature where when there is a watched article update(s) on top on the menus where it say (Watched) have some sort of notification similar to received mails. I noticed the requirement of this feature after I wasn't able to connect to my emails, and since I'm using a blackberry I also don't see when there is an update unless I open the first top post/article to see if there are updates or not, yes Dani do send notification emails, and also do move the updated post upper, but if there are too many threads watched its not easy to remember which was first, unless you are accessing Dani with a computer you are able to easily see if there are updates because the article has some notification to indicate it.

But I'm not sure if this is only blackberry problem or all mobile devices using mobile daniweb view are experiencing this.

Thanks.

Mr.M 89 Future Programmers

Ok cool.

Mr.M 89 Future Programmers

Try reading through this and see if there can be anything that might work on your case.
http;:// www.dreamincode.net/forums/topic/77470-poor-quality-of-image/

Mr.M 89 Future Programmers

What I think you will need to do is add 2 textbox, one for "FromPage" and another for "ToPage" properties which indicates which pages to be printed, its uses a Range, say you want to print from page 3 to 7 so on the first textbox you will write 3 and on the other textbox you will write 7.

 ' Example
 PrintDialog1.PrinterSettings.FromPage.Equals(TextBox1.Text)
 PrintDialog1.PrinterSettings.ToPage.Equals(TextBox2.text)

I think modifying like that will enable you to print only that page range.

Mr.M 89 Future Programmers

Thanks. But I'm not clear where you said "burn the file without FINALIZING mode".

Well the projects forces me to use CD/DVDs but I couldn't use +R, -R CD/DVDs because once burned they can be read only without re-modifying the contents inside so RW are handy for that but the problem is permanently burn a file there and it stay there till a disc dies, similar to R disc but with an ability to modify the line(s) inside the file(s).

Or the solution maybe to create a standalone executable file that will automatically copy these file to a computer with an unrecognized format and update the files lines as necessary as required then when the disc user attempt to eject the disc, the software will then overwrite the files inside the disc with the one that has been modified and delete those that were copied to a computer.

But the problem with that is that most people like my self disable the AutoRun on our computers so this won't work in most computers and on Linux and other none Windows OS, also not to mention that the AV software will detect it as an unlawful/malicious software due to its behavior so this is not a good idea to use autorun also its may consume more time when the contents are let's say 1GB so just think of how long it will take from overwriting, to deleting and finally to eject the disc, a user will wait too long before a …

Mr.M 89 Future Programmers

@SavedLema I think you should be more clear when saying (if you want to develop computer installed software then you can use VB.NET) I think its for Windows based OS but now there are chances for your software to run on other none Windows OSs.

But what I can tell the OP is that VB.NET is easy to learn, it is close to human language (english) when generating/writing codes. But I personally suggest you add some other languages at a later stage such as Java, C/C++ because if you are planning to go deep sometime there are one or two things that will require you develop your own sort of SDK or API to mount with VB.NET to gain access to other more complex, high stuffs.

But as a starter VB.NET is the good choice.

Mr.M 89 Future Programmers

What's the error?

Mr.M 89 Future Programmers

Yes that's achievable, you will have to make sure you have used an extension that is not used by any file, since the sample I did bellow only checks and get a list of files but an extension. Also since you will be working with two extension you will have to code them separately one for extracting which will search for ".gov" and change it to ".sql".

Suppose your path is "D:\Test\" and you have more then one file inside. So you can do it like this:

 Dim D As DirectoryInfo = New DirectoryInfo("D:\Test\")
 For Each File As FileInfo In D.GetFiles("*.sql")
 Dim OriginalFileName As String
 OriginalFileName  = File        
 Dim result As String
 result = Path.ChangeExtension(OriginalFileName, ".gov")
 File.Move(OriginalFileName ,result)
 Next

Now you can use the very same code above for searching for ".gov" files to change them back to ".sql". Also note that you will have to swap around the extension to set it back to the original.

You can place the above code under a button to change extension, then copy it again and past it on the button to set to original and on the code just change the extensions.

HTH.

Mr.M 89 Future Programmers

www.vbdotnetforums.com/reporting-printing/7947-printing-range.html

Mr.M 89 Future Programmers

Hi Dw.

I have a question of how can one detect a
program attempting execute/run and also most
importantly how to allow/deny programs to
execute/run.
I'm sure we all have came across with UAC
where it ask you to allow or deny that program
from running, normally this for elevating
privileges to Admin, but I don't want to use
UAC rather want to create something working
like it except that UAC only notify on privilege
elevation but mine I want it to detect a
program that is attempting to execute then ask
a user if s/he wants to grant or deny that
particular program from running.
Thank you.

Mr.M 89 Future Programmers

Oops I thought maybe java can have some support for this. I guess the language perfect for this is C++. Will start another thread there regarding this and when I get some help will then post the thread link here.

Mr.M 89 Future Programmers

Check the below code. You need to pull the image.

 Dim connection As New SqlConnection("connection string here")
 Dim command As New SqlCommand("SELECT Picture FROM MyTable
 WHERE ID = 1", connection)

 connection.Open()

 Dim pictureData As Byte() = DirectCast(command.ExecuteScalar(),
 Byte())

 connection.Close()

 Dim picture As Image = Nothing

 'Create a stream in memory containing the bytes that comprise
 the image.
 Using stream As New IO.MemoryStream(pictureData)
 'Read the stream and create an Image object.      from the data.
 picture = Image.FromStream(stream)
 End Using

Note how image is read from database before displaying.

Mr.M 89 Future Programmers

Meant While not White, also meant Line not like.

Mr.M 89 Future Programmers

Sorry to take so long. The very good example for this is HDD(Hard Drive Disk) they are re-writable disks and we can format them, but remember this, the root drive or HDD containing OS has Drive0 which has a reserved 100MB for the OS to use, this is taken from the main HDD and is kept private so that nothing except OS can access that portion so what I'm asking is a bit similar but different. Coming back to my question.

Suppose I write a file to a RW DVD/CD and the file is "test.txt", is it theoretically possible to keep this file permanent on a RW white it is enabled for modification? Like I want to add some like to it or remove some line to it but not removing its self from a media?

Or is there any way possible to lock the RW from being formatted. I have here 2 RWs one is CD and the other is DVD. I now uses DVD because CD was some how locked by a virus and now its can't be formatted, someone told me to use a Linux OS to format it, but I don't have it or know anyone near me who has it, so this also gave me an idea on a project I'm developing to use the similar approach but want to allow modification/updating of file but not removing it on a media.

How did a virus lock my RW CD, and how can I perform the …

Mr.M 89 Future Programmers

That's simple. You don't want to print all pages right? Your DGV is updated with new pages everyday right, now you have a code to print certain pages all that's left now was for you to add some sort of a tool and use that tool as identifier of a page to print. I don't know how your page are placed (are they in order or) but the idea of what you can do now is:

1) Add let's say a ListBox and populate the number of pages there. (Don't populate the total, you need to populate "1,2,3,-to the last page") you can use the "For Each" to get the numbers. Or

2) Add a TextBox and on the code on the link I posted above change the hard coded number to TextBox and on a TextBox you will only type the number and click print that will just print the page number you choose.

Here is it suppose you go with the second option:

 Application.PrintOut
 FileName:="", Copies:=1,
 Range:=wdPrintRangeOfPages,
 Pages:=TextBox1.Text

Also if you would like to let a user choose how many copies you will have to add another tool for it.

Mr.M 89 Future Programmers

Hi Dw.

I have a question of how can one detect a program attempting execute/run and also most importantly how to allow/deny programs to execute/run.

I'm sure we all have came across with UAC where it ask you to allow or deny that program from running, normally this for elevating privileges to Admin, but I don't want to use UAC rather want to create something working like it except that UAC only notify on privilege elevation but mine I want it to detect a program that is attempting to execute then ask a user if s/he wants to grant or deny that particular program from running.

Thank you.

Mr.M 89 Future Programmers

Well I guess VB.NET isn't capable of developing a sort of UAC to allow/deny execution of programs, I will ask Java or C++ but C++ is out of my understand. This will remain unsolved till I find solution on other post and link the solution here for someone who might have the same problem.

Mr.M 89 Future Programmers

You can just hide the console instead. Use something like

 Proc.StartInfo.CreateNoWindow = True

Or but I'm not sure if it will apply, just before your essential information try hiding it using the bat code within your code you will do something like:

 Proc.Send {"The code to turn on the char hide here", "Enter"}

NOTE: not sure of the format but it must have or start with "Send" but the rest is like the above, and also note that at least for me when I used this method I had to close any on top app running like Task manager because these make the command prompt loose focus and the typing will be done on an on top app or app with focus.

This sends one commands to command at a time so you will have more commands.

Mr.M 89 Future Programmers

You haven't said where are you having difficulties. But check this for saving and retrieving image from SQL Server.

http://www.codeproject.com/Articles/437937/Save-and-Retrieve-Image-from-a-SQL-Server-Database

Mr.M 89 Future Programmers
Mr.M 89 Future Programmers

Use

 For Each

Statement and under the "In" point to your directory (full path) where you have your csv files.

Mr.M 89 Future Programmers

Mmm the dropdownlist I think has some indexes which you can play around with to get what you want. But since you didn't say whether the selected year should remain the first selected even if the program restarts, and also you said you need to change the "default selected" I think you either want to re-arrange or want to just remember the selected value.

To do so you will need a global variable that will hold the selected value, but for your app to remember your choice you will need something to write your choice/selection(database/text file) at.

You can either keep/remember the index or the selected value, your choice.

 ' Suppose you want to keep the index. This is your global variable
 Dim SelectedIndx As Integer

Now you need to put this inside the dropdown selected item .

 SelectedIndx = DropDownList1.SelectedIndex

Now you will need 'IF' statement on your refresh to ensure the selected data remains selected.

 If SelectedIndx = Nothing Then
 ' Because we haven't saved any selected the default will apply.
 DropDownList1.SelectedIndex = 0
 Else
 ' We have stored something so let's replace default and use our own default selection based on what was selected.
 DropDownList1.SelectedIndex = SelectedIndx
 End If

Well there are some adjustments you will have to do, this is just an idea I thought while reading your post.

HIH.

Mr.M 89 Future Programmers

Ow you can do as ddanbe said or put a label in your Form1, your choice and if you want to display a message then you can just hide the label and point Form1 to send message to this label then on Form2 point it to retrieve this message.

ddanbe commented: Good advice. +15
Mr.M 89 Future Programmers
Mr.M 89 Future Programmers

On your code bellow the new entry add this

 Form2.MsgBox("Your Message Here")

To you code.