|
IH8Microsoft,
Put in your overlaped structure, even if your not using it, don't call it null, when you are working with devices.
I've come accross that problem with VB6 sp6 on XP sp2 & W2K3 sp1 before.
There may be somthing else I can't see in your little amount of code.
But give it a try, see if it helps...
progload
|
|
|
|
|
Thanks for the suggestion, actually that's what I'm doing.
module:
Public Type OVERLAPPED
Internal As Long
InternalHigh As Long
offset As Long
OffsetHigh As Long
hEvent As Long
End Type
function:
Dim tempNull As OVERLAPPED
bReturn = (ReadFile(lDevice, Buffer(0), UBound(Buffer), BytesRead, tempNull))
"tempNull" is an overlapped type. I know that the name tempNull is not obvious, it's just a temp name.
|
|
|
|
|
Does anyone have sample code, just the setFilePointer and readFile parts, that successfully reads bytes starting beyond the 1st?
|
|
|
|
|
|
I've seen that before, actually I have the source from the "Direct read/write disk access" thread.
It's buggy at best. It seems to read Fat drives ok, but fails to read NTFS. Also, after stepping through it, I discovered that he does not get the correct values for a lot of things. For example, in one section he is looking for BytesPerSector. If it isn't retrieved, he just hard codes in 512. That takes place throughout the code and nothing is reliable.
The one thing that does seem to work is the setFilePointer part. Unfortunately I am using the exact same call and it is not working the same.
I imagine that my problem has a simple solution, I just can't seem to find it.
Just to be sure that we're all on the same page (as sometimes I'm not all that clear) everyting is working fine and not failing at any point, it's just that I can't get readFile to START reading after the 1st byte. IE. it is always starting it's read at the 1st byte no matter what I set the file pointer to.
Thanks
|
|
|
|
|
Hi again,
I create a combobox and I add some items.
When user clicks on it, I don't want he can writes a value in text field..He must take as values only one of the existing items..is there a property for this?
Thanx..
-- modified at 16:03 Wednesday 15th February, 2006
|
|
|
|
|
Set the ComboBox's DropDownStyle property to DropDownList .
Doc's[^] on the ComboBox class.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thank you Dave Kreskowiak..
|
|
|
|
|
Have you actually tried reading the help files on this subject? The answer you seek is contained within.
...Steve
"Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once
|
|
|
|
|
Steve Pullan wrote: "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life."
No truer words have ever been spoken about programming!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi guys,
I make a registry key from setup of one application! When I unistall my program, i need no deleting of this registry key..(There a property when I make this key for this but with no result -> unistallation deletes the key)
Any ideas?
|
|
|
|
|
Either create a custom action in your installer that creates the key or have your applications code create the key. RegistryKey.CreateSubKey()[^] method docs.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thank you for the link..It helps me..
Now, can you help me a little bit again? When my application starts, I want a check for the existence of the key! And if it exists -> go to next code, else create it!
I try to find informations in web, with no result. Can you help me with a new link again?
Thanx in advance..
-- modified at 19:59 Wednesday 15th February, 2006
|
|
|
|
|
All you have to do is try to open the key! If it fails, it doesn't exist! Wrap that in a Try/Catch block and you've got your answer.
Try
Dim key As RegistryKey = Registry.LocalMachine.OpenSubKey("mykeypath")
' Key exists!
Catch ex As Exception
' Key doesn't exist!
End Try
Please tell me you're not trying to use this as a copy protection scheme for your application, 'cause it's really weak...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
is there ole object in vb net.
|
|
|
|
|
No, the is not OLE support in the .NET Framework BCL. You'd have to P/Invoke all the functions to get some form of OLE to work, but exactly what you have to do is entirely dependant on what your doing.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi there,
Ours is an automotive inspection business. All our inspectors inspect
the vehicles and took picures as need and upload them to the webserver
from where every body will have access to these pictures on the web.
As part of the regular business, many pictures are bieng added on to the webserver and so the images folder size is getting bigger day by day and hence it puts a lot of burden on the webserver.
So to move the images from the images folder on the webserver we are implementing a manual process of archiving those images and
cleaning the production images folder on the webserver.
Now, we want to developed some .exe(say FileMover.exe) file that handles the image move activities and schedule it in the windows shecdules to run at the specified intervals. Our idea is to develop this FileMover.exe using Visual Basic.net using Visual studio 2005.
So i need help on how do i do it. I think Windows Service application type project is the right one to pick and go from there.
Could some one plese help me with any articles written on this?
Thanks
-L
-- modified at 16:58 Wednesday 15th February, 2006
|
|
|
|
|
Written on what? Copying/Moving files (File or FileInfo classes), watching a folder (FileSystemWatcher class), creating a service, or processing the images?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello Dave,
I am sorry for the confusion. I have modified my question to my best.
My question was is Windows Service type of project can create an .exe for me? Becauase there are different type of project types when i File/New project in Visual Studio 2005.
And also i was asking if i could be helped with a sample Windows Service application and how to create an .exe file from the application in Visual Studio 2005. Becauase this will be my first time trying to create an .exe type of application using Visual studio. Hope this is understandable.
thanks
-L
|
|
|
|
|
Slow Learner wrote: Becauase this will be my first time trying to create an .exe type of application using Visual studio.
With all due respect, if you are not familiar with VS 2005 at all and you want to write a Windows Service, I think you will get into some deep water. You need to walk before you can run.
If the app's requirements are simply to move files from one directory to another on a schedule, why not simply use a BAT file which can be run as a Windows scheduled task? There's still a lot that can be done in BAT files these days, especially for apps that are not too complex as this one. They have a much lower overhead too.
...Steve
"Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once
|
|
|
|
|
Yeah, I agree with Steve. If this is your first app, you've really bitten off more than you can chew.
Creating a service isn't really easy for a lot of reasons. To start with, you don't get to put in a UI. Services, on startup, are expected to create a seperate thread to start their main execution loop. You also can't just start the service and debug it. You've got to install i, start the service, then attach the debugger to it, making startup problems a bit of a pain to diagnose, ... The list goes on...
If you're not doing any processing of these file, just copying them, you can get away with creating a batch file (*.CMD or *.BAT) run from Windows Scheduler (Scheduled Tasks) that'll do this for you quite easily.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I appreciate all your help and caution. I understand that but i have enough time to understand that and implement in VS 2005. So i thought i could give it shot and in the entire process i will have an oppertunity to learn all about windows services and also get used to VS 2005.
Well i could try the same thing in .bat file or else in vbscript and then schedule it to run. I am not sure if we can schedule a vbscript file. Can i schedule a .vb script file (say FileMove.vb) as .bat file? If i can schedule a vbscript file i think i will opt it writing in vbscript.
Please suggest.
Thanks
-L
|
|
|
|
|
I see where you are coming from and in some ways agree, but keep in mind not to over-engineer the solution.
...Steve
"Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once
|
|
|
|
|
It would be best to not "play around" until the dead-line comes. Get a solution that works first, then you can "play around" writing a better solution. If your dead-line is comming up, you've already got something that works and you don't have to scramble to get your service solution to finished.
So, having said that, yes, you can schedule a .BAT or .VBS to run. If you want to run the .VBS script directly, the command line would be:
cscript
The //e:vbscript thing is in there because some companies disable the Scripting Hosts associations, thereby cripple WSH's ability to determine that correct scripting engine to the run code.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
On the DriveList control when you select a drive there is an icon telling you what kind of drive you selected. For example: I select the C: drive then the icon for a hard drive. Another for a floppy, removable drives, and so on.
I want to place the icon of the drive selected on the root node of a treeview. Is there a way to read the icon and us it as an image on the treeview?
Thank you,
Quecumber256
|
|
|
|