|
sajan ss wrote: 'System.IO.Stream' cannot be converted to 'System.IO.StreamReader'."
I guess that means you've got the wrong variable type. Use a Stream instead, or use it in place. I believe you will find it has a Read and a Write method.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am developing an embedded C application for a small microcontroller. One thing I have found useful in the past was to write a DOS-based PC front end which would simulate the main aspects of the target environment. I would thus have three pieces of code:
-1- The common code, which would run identically on the PC and in the final application, thus allowing it to be debugged on the PC.
-2- The PC-side code for routines like get_time_of_day(), set_time_of_day(), switch_motor(), check_switch(), etc. would virtualize them as appropriate. The user could turn switches on and off via the keyboard, as well as adjust the relationship between real time and the time reported to the application. Hardware functions like motors would be displayed on screen.
-3- The microcontroller code for those routines would perform them on real hardware.
Previously, I've used Turbo C for DOS to do the PC front end, but that's rather clunky. I'd like to migrate to using Windows. I've done a little Windows programming in C, but it would seem like it would be more convenient to have a vb.net application maintain the user interface and have it communicate somehow with a C application which would simulate the microcontroller.
I wouldn't be looking to do a super-detailed hardware simulation, but rather a more general one (e.g. I'd use a PC version of the get_time_of_day() function to simulate getting time of day, rather than trying to write a PC function to simulate pulsing the processor pins necessary to communicate with the real-time clock chip).
Has anyone done anything similar, or can anyone offer any advice? Two notable ceaveats:
-1- It would not be acceptable for the VB program to simply call a C function which would have to completely finish execution before control could return to VB, but...
-2- It would be acceptable to have the C application only yield control during its own check_event() and wait_event() procedures. I don't feel a need to simulate interrupts and other such features.
The first requirement would suggest that simply using a DLL would probably not work well, unless I used multi-threading and had a means for threads to communicate. Having applications that share messages with each other would seem a better solution.
|
|
|
|
|
Vb.net has a built in control called serial port (I'm not sure if they have one for usb). If you have a microcontroller that can interface with a serial port then you could send messages between your pc and microcontroller with a serial port (just make sure your settings match on each side). Just write some code in each program to interrepret the messages and data so each program can act accordingly.
hope this helps,
Mike
|
|
|
|
|
Perhaps I didn't make myself clear. My goal is to, during development, run on the PC the same source code that will be run on the target device, but with some different libraries to handle the I/O. I will also be wanting to have the PC talk to a real device, but that would come later.
The compile/build/execute cycle for PC code is much faster on the combile/build/burn/execute cycle necessary for an embedded system. Further, it's much easier to monitor the internal workings of a PC app than an embedded one. Perhaps I should use an ICE for development, but I've never had much luck with them.
As I think about things some more, it may be better to do the whole simulation thing in C; if I want to simulate the device talking to the PC, since the end-user application for that purpose will probably be written in VB, I could perhaps code the simulation app so that it would some bizarre TCP port at 127.0.0.1 was its serial port and then let the end-user app talk to it that way.
On the other hand, since the target system is in fact comprised of multiple processors (most of which will have fairly simple code), having the code run stubs on a PC that simply exchange TCP information on port 127.0.0.1 with a VB front end might not work too badly either. The one annoyance would be that I currently have a decent-looking version of the LCD coded in C (the C code was written for the purpose of generating the design to get the real custom LCD manufactured, but it can draw the display with selected segments enabled or disabled) and that would have to be redone for VB, but otherwise VB might be nicer.
modified on Tuesday, February 05, 2008 2:32:33 PM
|
|
|
|
|
I am using an update panel which updates the datagrid when the button is clicked. How do i update it automatically (every 3 seconds) instead of clicking the button.
many thanks
|
|
|
|
|
This is an ASP.NET question, please ask it in the right forum.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi all
i have an quick Project i must do for a Client, is it advisable to use a Stored Procedure for Access as a Backend, and how is that Compiled, i always do sql, OR SHOULD I use naked SQl ?
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Just to be clear, do you want stored procedures for Access as the backend database, or are you using Access as a front-end to a SQL Database?
If you want stored procedures for Access, then you cannot. The closest you will get is to use a Query, which is effectively the same as an SQL View.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Thanks you, that means i wil use a naked SQL , a Query .
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Access doesn't support stored procedures.
It does support stored queries, if that is enough for your purposes. (It's basically a stored procedure that is limited to a single query, and has no other featuers like flow control commands.)
As such, stored queries doesn't add much, so it's mostly a matter of taste if you want to use them or not.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Hi there VB Pros i'm doing a project that requires to encrypt and decrypt files.
I need to create this algo from scratch.
Anyone has any clues as to how to do that??
|
|
|
|
|
How complex does it have to be?
You could use a simple character replacement method, based on a string provided by the user or some other source.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Got your message. Does not have to be complex a simple encryption algorithm to encrypt and decrypt files.
The button sub routine will contain the algo when the user clicks the button the file gets encrypted.
|
|
|
|
|
Where does the requirement that you do it from scratch come from? Its 99.99% likely that if you write your own algorithm it won't last 15 minutes of cryptanalysis....
|
|
|
|
|
wantta know how to solve this problem!!!!
xlApp = New Excel.Application
xlBook = xlApp.Workbooks.Add
when added workbooks to excel application
this error occour..
"Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))"
|
|
|
|
|
Hi,
I also got this error, when i try to run my already created application on my friends PC, the problem is he has the Office 2000 in his pc installed.
Do one thing uninstall the office from your pc and install the XP or higher version of office.
Hope this will help you.
with regards
Yogesh Agarwal
|
|
|
|
|
thanks alot for u advice..
yes, it is cause of my excel is old version..
now upgrade to office2003.. it is ok...
|
|
|
|
|
yogesh_kumar_agarwal is right!
You'll probably need to use 'Late Binding'
instead of 'Early Binding'.
Therefore do NOT use the MS Excel ObjectLibrary and
Imports Microsoft.Office.Interop.Excel .
'Google' for MS Excel, Late Binding & VB.NET and
you'll probably get your answer.
Good Luck.
|
|
|
|
|
thank you answer ...
i can solve it now, by update office to 2003
|
|
|
|
|
|
That's odd. There is a managed API, but it's very limited and buggy. You can use it for simple video playback, etc, however.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
sir,
can you provide me the link from which i get Managed API ?
Thanks
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
How Can I Compress And Decompress A File Using Visual Basic 6.0
Manoj
|
|
|
|
|
Check out this MSDN article[^]
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Hello there,
I have a “load” event on a startup form with a notifyicon that starts a timer on another form to execute code at a given time from settings in My.Settings. This works well.
Then I make use of a login form to stop the timer and load the form where the timer is on and adjust My.Settings via numericupdowns to change the given time to execute the code and use a button to start the timer again.
The problem is that it is not using my new settings. I tried My.Settings.Save() – which only works when I restart the app.
The timer is stopped before I adjust the numericupdowns and it does start again on the button exit.
Help please
|
|
|
|