|
Given that you posted in the VB forum, and have not posted in the C++ forum ( I went there to answer this ), I'd say you need to talk to your teacher about your ability to keep up with their course. Doing what you've been asked, is quite trivial, I can't imagine how your course ware would not lay out exactly how this is done, as it's very basic. So, I think your teacher needs to know that you're not able to follow the classes, so they can try to talk to you about options, or offer some remedial work to get you up to speed. Certainly, anyone who asks for help here, and especially any student, should be posting code to show they have some idea what they are doing, and are trying to learn, which is what this exercise is all about. I've not written any c++ for years, but I could have done this assignment for you in the amount of time I've spent writing this. That simply does not help you. You need to try, ask for help if you need it, and expect hints, not solutions, so you can make your time in school worthwhile, by actually thinking about the coursework, and learning something along the way.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
HI,
I AM GOING TO CREATE REMOTE LOGIN SYSTEM.THIS APPLICATION DESIGN N CLIENT & SERVER SYSTEM.
I HAVE SO MANY DOUBT IN THIS APPLICATION. PLEASE CLARIFY FOLLOWING DOUBTS,
1) SUPPOSE ONE PERSON GOING TO LOGIN CLIENT SYSTEM, AUTOMATICALLY INSERT FROM TIME IN DATABASE.THIS TIME SHOULD BE IN SERVER TIME NOT CLIENT TIME.. HOW ILL GET SERVER TIME?
2) PERSON LOGIN SINCE MORNING 9PM, SUPPOSE PERSON GOING TO BREAK SO HE IS USING LOGOFF KEY. AUTOMATICALLY OUR APPLICATION INSERT INTO LOGOFF TIME..
HOW WILL CALL LOG OFF METHOD ?
WHENEVER PERSON GOING TO LOGIN, TIME SHOULD BE INSERT INTO DB AND ALSO OUT TIME, WHEN WE CALL SHUT DOWN OR LOG OFF IN PC.
PLEASE GIVE SOLUTION FOR ME.
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
Mail To : foreverkans@gmail.com
|
|
|
|
|
Caps lock key broken ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
WHY ARE YOU YELLING???
m2kannan wrote: HOW ILL GET SERVER TIME?
Somewhere in your server code, use DateTime.Now().
m2kannan wrote: HOW WILL CALL LOG OFF METHOD ?
Just like you call any other method.
Seriously, these question are not answerable because you've left out so much information, like how your app is designed, what code you have running where. Do you have SQL stored procedures doing the database work, or do you have a server component that your running that does the database work, how does the client talk to the server, ...
Seriously, the two questions you asked are VERY basic topics that anyone who took a single programming class would know the answers to.
|
|
|
|
|
As the others have said, some of your questions are at a beginners level while the overall level of complexity of your project is quite large, you maybe want to consider not undertaking such a large project without more experience, knowledge and research.
|
|
|
|
|
I wrote a program in VB6 that paly a sound when ever a key is press anytime. How it can be run in the background. I mean it work even if it is not in focus. Can some body help me?
|
|
|
|
|
VB6 is outdated and useless. It sounds like you're doing beginner projects. Drop that smelly dog of a language and learn something that will lead to actual employment, as well as giving you the tools you need to write the applications that you're going to want to be able to write.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
On top of what Christian said (yes, VB6 is old, outdated, and unsupported) this would require you to implement a global keyboard hook, something that VB6 alone is incapable of doing.
|
|
|
|
|
I have a text file in c:\ as abc.txt
which displays
empid=e001, name=john, salary=5000
..
...
.....
Now, we need to have a method which wil take empid as parameter and will find the line with the empid and create a text file with that line
e.g if we pass e001 to the method
it will write
empid=e001, name=john, salary=5000
to a new file with the name e001
So all these files created will be stored in a folder c:\repository
Could you please help to code that in vb.net.
Many thanks
|
|
|
|
|
Sound trivial, a little bit of regex, some basic file management code. In fact, string.Split would do it fine. Perhaps if you don't know how to do it, you should advertise for someone to write it for you. Be careful tho, a lot of the people who place low bids on projects nowadays, barely know how to type. They come here and post their projects and hope someone will do it for them.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
My reply actually contained all the info someone would need to write this code, but I get a 1 vote for not doing the work for you ? I'm happy to provide my contract rates.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Evened it out for you
I guess the guy can't read since you did give him the answer to his question all be it in a somewhat obscure form
|
|
|
|
|
I try to always give answers that a programmer, or someone who has read my article on how to use google, should be able to use to solve their problem. I don't really provide code often anymore.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
This is simply knowing how to manipulate strings and files. If you don't know these simple techniques, you really have no business even starting this project. Seriously, if you want to continue to write code, pickup on beginners book on VB.NET and work through it. Without these basic concepts, you have no hope of completing the simplest of projects, like this one.
|
|
|
|
|
i have a third party .dll file which was provided with a hardware, i also have a .lib and .h file. i have included the dll file into my working folder and added the following code into my VB app, but still it gives an error "Runtime error 53 - file not found", i tried all the things that are suggested in various forums but still the problem exists
Option Explicit
Private Declare Function Connect Lib "E:\Projects\Sample Code\vb Test\device.dll" (ByRef h As Long, ByVal ID As Byte, ByVal nullptr As Long, ByVal speed As Long, ByVal proto As Byte) As Long
on command click i have written the following code
Private Sub btnConnect_Click()
Dim dvReturn As Long
Dim dvHandle As Long
Dim port As Byte
Dim speed As Long
Dim protocol As Byte
port = 1
speed = 9600
protocol = 4
dvReturn = Connect(dvHandle, port, 0, speed, protocol)
If dvReturn Then
lblStatus.Caption = "Failed"
Else
lblStatus.Caption = "Connected"
End If
End Sub
the function prototype in the .h file is as follows
extern unsigned long __cdecl Connect(unsigned long *h,unsigned char ID,void *,unsigned long, unsigned char);
can any one suggest what may be the problem
Naveen
|
|
|
|
|
Why are you not using unsigned longs in your declaration ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi,
several comments:
1.
as Christian said, keeping signed/unsigned correct would be better
2.
in most C/C++ environments a long takes 32-bit, in .NET that would be an Integer, not a Long.
3.
the void* should be something passed ByRef, not ByVal.
However, if the above were the only errors, I would expect a different message (such as "method not found").
4.
why are you using the full file path? this makes porting your app to a different PC almost impossible. It should be sufficient to put the DLL file next to your EXE file (in bin/Debug or bin/Release).
5.
IF your DLL references other DLL files, and one of them isn't found, the same error message would appear.
they too should be either in your EXE's folder, or in some folder that is listed in the Windows PATH environment variable.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Here is an example:-
"string of 23 characters"
The above string has 23 characters, including the spaces
What I want to do is count the number of charactersand then split the string at the next space after the half number, in this case, half of 23 is rounded up to 12 so I need to split the string between the "3" and the "c" to read like this:-
"string of 23" and "characters"
I've tried various string functions, and combinations of them but cannot work out how to do it.
I'd appreciate your help.
Regards,
Steve
Thanks for your help and advice!
Steve
|
|
|
|
|
Hi,
I'm not going to give you any solution; I do suggest you try and solve this little task in several steps, it is a typical beginner's mistake to try and solve it in one complex statement (which often never gets composed correctly). With many statements, you can execute the required steps, similar to your explanation in English words, AND you can check intermediate results.
So don't worry if you use ten lines of code for this; once you got it working correctly, you can try and optimize it.
One hint: you don't need loops, a few simple string methods will do.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
You will could use the following methods of your string variable, to achieve your requirements :-
.Length
.Substring
.Replace
like so:-
Dim FullString = "string of 23 characters"
Dim FirstPart As String
Dim SecondPart As String
FirstPart = FullString
SecondPart = FullString.Substring(FullString.Length /2)
FirstPart = Replace(FirstPart, SecondPart, "")
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
I think is this the code you need:
Dim FullString As String = "String of 23 characters"
Dim HalfStringLen As Integer = Fix(FullString.Length / 2)
Dim FirstPart As String = FullString
Dim SecondPart As String = ""
Do
If FullString(HalfStringLen) = " " Then
FirstPart = Microsoft.VisualBasic.Left(FullString, HalfStringLen)
SecondPart = LTrim(Microsoft.VisualBasic.Right(FullString, FullString.Length - HalfStringLen))
Exit Do
End If
HalfStringLen = HalfStringLen + 1
Loop Until HalfStringLen = FullString.Length At end of loop, FirstPart and SecondPart will contain FullString spitted.
Note that If the full string have not espaces, FirstPart will contain the entire FullString.
Ignazio
|
|
|
|
|
Hi Ignazio and Steve,
Thanks for your replies, they have both helped me a lot and it's helped me to solve my problem.
again, thanks
Steve
Thanks for your help and advice!
Steve
|
|
|
|
|
Congratulations! You managed to con someone into doing your work for you! Don't do it again.
|
|
|
|
|
I have a very strange request from client.
The scenario is: I have a server with some media file assigned to unique id's and the server is conected to a series of USB flash drives port (20). Now, a user comes down & plugin his/her USB drive. Every USB drive has an .txt file, the .txt file names are nothing but the unique id's which are already stored on server.
Once the user plugin he's/her USB drive, the server should be able to read the .txt file name(unique id) and get all the media files from the server and copy it to USB flash drive. Once its done we shouls close the port.
Just to let you guys know, no monitor will be there and once we copy the files to USB it should intimate the User.
I know it sounds strange. Any help / direction would be truly appreciated.
Thanks
Sagar
|
|
|
|
|
The hard part, I guess, is detecting the drive being attached. I'm not sure there's an event you can use, although autoplay does fire in the OS itself. You might just check what drives are connected every few seconds, and if you find a new one, go ahead and read the text file. It sounds straightforward from there, look up the files from the Ids and copy them. I'd expect a windows service to do this work.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|